--- freebsd-buildutils-7.1.orig/debian/control +++ freebsd-buildutils-7.1/debian/control @@ -0,0 +1,27 @@ +Source: freebsd-buildutils +Section: devel +Priority: extra +Maintainer: GNU/kFreeBSD Maintainers +Uploaders: Aurelien Jarno , Guillem Jover +Vcs-Browser: http://svn.debian.org/wsvn/glibc-bsd/trunk/freebsd-buildutils/ +Vcs-Svn: svn://svn.debian.org/glibc-bsd/trunk/freebsd-buildutils/ +Build-Depends: debhelper (>= 5.0.0), pmake, flex, bison, libbsd-dev +Standards-Version: 3.8.1 + +Package: freebsd-buildutils +Architecture: any +Depends: ${shlibs:Depends}, bsdmainutils, unzip, patchutils, dash, original-awk, make +# +# The following dependencies are needed because of symlinks in /usr/lib/freebsd: +# sh -> dash +# awk -> original-awk +# gmake -> make +# +Conflicts: freebsd5-buildutils, freebsd6-buildutils, pmake +Provides: freebsd6-buildutils, freebsd7-buildutils +Description: Utilities for building FreeBSD sources + This package contains the FreeBSD counterparts of some standard build + utilities (make, yacc, lex ..) + . + They have some specific modifications needed to be able to build FreeBSD + sources (such as kfreebsd-7). --- freebsd-buildutils-7.1.orig/debian/dirs +++ freebsd-buildutils-7.1/debian/dirs @@ -0,0 +1,10 @@ +usr/share +usr/sbin +usr/bin +usr/share/man/man1 +usr/share/man/man5 +usr/share/man/man8 +usr/lib +var/db +usr/share/mk +usr/lib/freebsd --- freebsd-buildutils-7.1.orig/debian/copyright +++ freebsd-buildutils-7.1/debian/copyright @@ -0,0 +1,50 @@ +This package was debianized by Nathan Hawkins on +Fri, 11 Oct 2002 20:43:20 -0400. + +It was downloaded from FreeBSD CVS (http://www.freebsd.org/) + +Upstream Author: The FreeBSD Project + +Copyright: + + Copyright (c) 1980, 1983, 1985, 1987, 1988, 1989, 1990, 1991, 1993 + The Regents of the University of California + Copyright (c) 1988, 1989 Adam de Boor + Copyright (c) 1989 by Berkeley Softworks + Copyright (c) 1995 Peter Wemm + Copyright (c) 1996 Søren Schmidt + Copyright (c) 1998 John D. Polstra. + Copyright (c) 1997 John-Mark Gurney + Copyright (c) 1998, 2000 Robert Nordier + Copyright (c) 1999 Global Technology Associates, Inc. + Copyright (c) 2000 Poul-Henning Kamp and Dag-Erling Coïdan Smørgrav + Copyright (c) 2000 Massachusetts Institute of Technology + Copyright (c) 2000, 2001 David O'Brien + Copyright (c) 2002 Juli Mallett + Copyright (c) 2003 Joseph Koshy + Copyright (c) 2003 Poul-Henning Kamp + Copyright (c) 2003 Dan Nelson + Copyright (c) 2005 Max Okumoto + Copyright (c) 2006 Daniel M. Eischen + + +License: + + Redistribution and use in source and binary forms, with or without + modification, are permitted under the terms of the BSD License. + + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +On Debian systems, the complete text of the BSD License can be +found in `/usr/share/common-licenses/BSD'. + --- freebsd-buildutils-7.1.orig/debian/links +++ freebsd-buildutils-7.1/debian/links @@ -0,0 +1,3 @@ +bin/dash usr/lib/freebsd/sh +usr/bin/original-awk usr/lib/freebsd/awk +usr/bin/make usr/lib/freebsd/gmake --- freebsd-buildutils-7.1.orig/debian/changelog +++ freebsd-buildutils-7.1/debian/changelog @@ -0,0 +1,346 @@ +freebsd-buildutils (7.1-2) unstable; urgency=low + + * patches/15_manpages_gzip.diff: new patch to gzip manpages with -9 by + default, as required on Debian systems. + * Switch to debhelper 5. + * Bumped Standard-Versions to 3.8.1 (no changes). + + -- Aurelien Jarno Tue, 07 Apr 2009 17:49:03 +0200 + +freebsd-buildutils (7.1-1) unstable; urgency=low + + [ Petr Salinger ] + * New upstream version (RELENG_7_1_0_RELEASE) + + -- Aurelien Jarno Sun, 11 Jan 2009 11:59:32 +0100 + +freebsd-buildutils (7.0-2) unstable; urgency=low + + [ Petr Salinger ] + * fix implicit-pointer-conversion by including appropriate headers. + Closes: #493770. + * add Vcs-* fields into debian/control. + + -- Aurelien Jarno Tue, 05 Aug 2008 14:30:25 +0200 + +freebsd-buildutils (7.0-1) unstable; urgency=low + + [ Petr Salinger ] + * New upstream version (RELENG_7_0_0_RELEASE) + - drop upstream patches 000_fix_make_double_free.diff, + 000_7-current_support_in_bsd.own.mk.diff + - replace 02_silly_macros.diff via sed and 12_unused.diff + - add 13_bsd_sys.diff, 14_config.diff + - update remaining patches + * Package rename, cleanup + * Upload to Debian. Closes: #344417. + See also #474761, #474762. + + [ Aurelien Jarno ] + * Drop symlink pointing to gcc-3.4. + * Bumped Standard-Versions to 3.8.0 (no changes). + * Update debian/copyright. + + -- Aurelien Jarno Tue, 15 Jul 2008 19:37:00 +0200 + +freebsd6-buildutils (6.3-2) unreleased; urgency=low + + * Don't build-depends nor depends on gcc-3.4. + + -- Aurelien Jarno Sat, 12 Jan 2008 18:02:07 +0100 + +freebsd6-buildutils (6.3-1) unreleased; urgency=low + + [ Petr Salinger ] + * New upstream version (RELENG_6_3_0_RELEASE) + + [ Aurelien Jarno ] + * Bumped Standard-Versions to 3.7.3 (no changes). + * Gzip manpages with -9. + + -- Aurelien Jarno Thu, 10 Jan 2008 14:03:04 +0100 + +freebsd6-buildutils (6.2-1) unreleased; urgency=low + + [ Petr Salinger ] + * New upstream version (RELENG_6_2_0_RELEASE) + + -- Aurelien Jarno Mon, 15 Jan 2007 13:38:31 +0100 + +freebsd6-buildutils (6.0-0.2) unreleased; urgency=low + + * Add cruft to bsd.own.mk necessary to build latest kernel. + + -- Robert Millan Sat, 6 May 2006 13:10:05 +0200 + +freebsd6-buildutils (6.0-0.1) unreleased; urgency=low + + * Fork 6.x branch. + * Switch to libbsd. + - control (Build-Depends): Add libbsd-dev. + - rules: export LDADD=-lbsd + - patches/03_glibc.diff: + - usr.sbin/config/main.c: Nuke strl{cpy,cat} hack. + - usr.sbin/mtree/excludes.c: Nuke fgetln hack. + - usr.bin/make/Makefile: Stop adding LDADD=-lbsd (now passed from rules). + - patches/11_config_allow_override.diff: + - usr.sbin/config/Makefile: s/LDADD=/LDADD+=/g. + * Make dash and gcc-3.4 the default "sh" and "cc". + - control (Depends): Add gcc-3.4. + - links: New. Setup sh and cc symlinks. + * Pass NO_SHARED=NO from debian/rules + - rules + - patches/01_make_fixes.diff: Nuke part that disables NO_SHARED. + * patches/03_glibc.diff: + - Remove s,sys/time.h/time.h,g (was it ever needed?) + - Nuke LIST_* defines (should be in sys/queue.h, or find another + solution, like s,sys/queue.h,bsd/queue.h,g) + * rules: + - Only apply patches with *.diff suffix. + * Move /usr/share/freebsd6-buildutils to /usr/share. + - control (Conflicts): Add pmake. + - patches/01_make_fixes.diff (usr.bin/make/pathnames.h): Remove + PATH_DEFSYSPATH redefinition. + - rules: Install mk and Mk in /usr/share. + * patches/000_fix_make_double_free.diff: New. Patch from upstream + (1.155:1.158). Thanks to Petr for spotting this. + * Build using gcc 3.4, like upstream. + - control (Build-Depends): Add gcc-3.4. + - rules: Pass CC=gcc-3.4 to make. + - patches/06_ftbfs_gcc-4.0.diff: Remove. + * Fixes runtime getopt parsing infin loop. + - rules (COPTS): Build with -D_GNU_SOURCE. + - rules: Rename internal getline function to avoid collision with the one + from Glibc (s/getline/bsd_&/g). + - patches/06_ftbfs_gcc-4.0.diff: Remove (it had dirty getopt hacks as well). + * patches/11_optreset.diff: New. Replace unportable optreset mangling + with reset_getopt () from libbsd. + * Our awk wasn't actualy from FreeBSD, but imported from original-awk. + Let's use that directly instead. + - control (Depends): Add original-awk. + - links: Add link to original-awk. + - patches/00_upstream.diff: Remove hunks that apply to awk. + - patches/05_disable_hardlinks.diff: Ditto. + - rules: Remove commands that work with awk. + - fetch: Remove awk dirs from checkout/update. + * Add gmake (as alias for gnu make). + - control (Depends): Add make. + - links: Add gmake link. + * Massive cleanup in ports/Mk patches. + - rules: Add sed rules that superceed most of the changes. + - patches/09_ports_path.diff: Remove most of the patch, and re-diff. + - patches/10_linux_utils.diff: Merge into 09_ports_path.diff + * patches/09_ports_path.diff: Set PORTSDIR to /usr/share (instead of + /usr/ports). + * patches/09_ports_path.diff: Fix sed regexp. + + -- Robert Millan Fri, 17 Feb 2006 17:20:38 +0100 + +freebsd5-buildutils (5.4-3) unstable; urgency=low + + * Fixed the MACHINE_ARCH variable on i386 (closes: bug#328604). + + -- Aurelien Jarno Sat, 17 Sep 2005 04:36:26 +0200 + +freebsd5-buildutils (5.4-2) unstable; urgency=low + + * Added a dependency on bsdmainutils (closes: bug#323758). + * Bumped Standard-Versions to 3.6.2 (no changes). + + -- Aurelien Jarno Fri, 19 Aug 2005 17:47:15 +0200 + +freebsd5-buildutils (5.4-1) unstable; urgency=low + + * New upstream version. + * Added a fix for GNU/Hurd: define MAXPATHLEN if it is not already fixed. + + -- Aurelien Jarno Fri, 17 Jun 2005 18:53:06 +0200 + +freebsd5-buildutils (5.3+2-4) unstable; urgency=low + + * Use md5sum.textutils instead of md5sum to compute md5. Thanks to Robert + Millan for the patch (closes: bug#313618). + + -- Aurelien Jarno Tue, 14 Jun 2005 20:42:27 +0200 + +freebsd5-buildutils (5.3+2-3) unstable; urgency=low + + * Package adopted by the GNU/kFreeBSD Maintainers. Thanks to Robert + Millan for all the work done on this package. + * Added patch from Victor Hsieh to fix incompatibilities with linux + utilities (closes: bug#306146). + + -- Aurelien Jarno Thu, 9 Jun 2005 01:02:28 +0200 + +freebsd5-buildutils (5.3+2-2) unstable; urgency=low + + * Replace Architecture with Cpu/System in control.in. + * Add /usr/ports, installed as /usr/share/freebsd5-buildutils/ports. + * Move /usr/share/fbmk to /usr/share/freebsd5-buildutils/mk for consistency. + * Misc package cleanup (Nuked debian/mk, etc). + + -- Robert Millan Fri, 4 Feb 2005 01:30:26 +0100 + +freebsd5-buildutils (5.3+1-1) unstable; urgency=low + + * Add brandelf. + - patches/07_brandelf.diff + + -- Robert Millan Mon, 27 Dec 2004 21:39:45 +0100 + +freebsd5-buildutils (5.3-2) unstable; urgency=low + + * patches/01_make_fixes.diff: + - Set INSTALLINFO to `which ginstall-info || which install-info`. + - Do, however, not run install-info at all, and use manual install instead. + * patches/06_ftbfs_gcc-4.0.diff: New. Don't declare maxJobs as static. + This fixes build on gcc-4.0. Thanks Andreas Jochens. (Closes: #285953) + + -- Robert Millan Sat, 18 Dec 2004 01:50:04 +0100 + +freebsd5-buildutils (5.3-1) unstable; urgency=low + + * Fork for 5.x branch (package been renamed). + - patches/02_silly_macros.diff: Sync. + + -- Robert Millan Thu, 25 Nov 2004 20:14:35 +0100 + +freebsd-buildutils (5.2.1+20041028.1-1) unstable; urgency=low + + * Add file2c command. + + -- Robert Millan Fri, 12 Nov 2004 20:13:06 +0100 + +freebsd-buildutils (5.2.1+20041028-1) unstable; urgency=low + + * New upstream snapshot (6.x branch). Drop support for btxld. + - patches/*.diff: Sync. + * Use new CDBS debian/control auto-generation method. + - control.in: New. Set Build-Depends on @cdbs@ tag. + - rules: Set DEB_AUTO_UPDATE_DEBIAN_CONTROL = yes. + + -- Robert Millan Thu, 28 Oct 2004 22:53:34 +0200 + +freebsd-buildutils (5.2.1+20040403-11) unstable; urgency=low + + * patches/002_upstream.diff: Unfuck __unused definition in + usr.bin/lex/flex.skl. + + -- Robert Millan Sun, 20 Jun 2004 13:05:13 +0200 + +freebsd-buildutils (5.2.1+20040403-10) unstable; urgency=low + + * patches/002_upstream.diff: Nuke __unused completely instead of defining + it as empty macro. (Closes: #249892) + + -- Robert Millan Wed, 9 Jun 2004 18:18:47 +0200 + +freebsd-buildutils (5.2.1+20040403-9) unstable; urgency=low + + * control (Build-Depends): Add flex. (Closes: #248265) + + -- Robert Millan Mon, 10 May 2004 14:11:02 +0200 + +freebsd-buildutils (5.2.1+20040403-8) unstable; urgency=low + + * Fix strl{cpy,cat} porting properly in config/main.c. + + -- Robert Millan Mon, 10 May 2004 02:48:47 +0200 + +freebsd-buildutils (5.2.1+20040403-7) unstable; urgency=low + + * Fix stupid FTBFS. + mk/build.mk: Don't attempt to use our make after building it! + * mk/build.mk: Misc cleanup. + + -- Robert Millan Sat, 8 May 2004 21:21:45 +0200 + +freebsd-buildutils (5.2.1+20040403-6) unstable; urgency=low + + * 003_glibc.diff: Fix stupid segfault in config. + * mk/build.mk: Set MACHINE_ARCH for make. + + -- Robert Millan Tue, 4 May 2004 16:20:17 +0200 + +freebsd-buildutils (5.2.1+20040403-5) unstable; urgency=low + + * Fix FTBFS. + mk/build.mk: Set PATH so that our own yacc is used for building config. + + -- Robert Millan Sun, 2 May 2004 18:06:29 +0200 + +freebsd-buildutils (5.2.1+20040403-4) unstable; urgency=low + + * Add awk and config. + + -- Robert Millan Sun, 2 May 2004 14:40:25 +0200 + +freebsd-buildutils (5.2.1+20040403-3) unstable; urgency=low + + * patches/004_lex_bootstrap.diff: Nuked. + * mk/build.mk: Use yacc to generate parse.h for src/usr.bin/lex. + + -- Robert Millan Wed, 14 Apr 2004 14:59:23 +0200 + +freebsd-buildutils (5.2.1+20040403-2) unstable; urgency=low + + * control (Depends): Add dash. + * patches/*.diff: Cleanup in order to submit upstream. + + -- Robert Millan Thu, 8 Apr 2004 00:17:41 +0200 + +freebsd-buildutils (5.2.1+20040403-1) unstable; urgency=low + + * New upstream snapshot. + - patches/*.diff: Resync. + * Really apply the change (Really Closes: #240023) + + -- Robert Millan Sat, 3 Apr 2004 16:02:23 +0200 + +freebsd-buildutils (5.1-4) unstable; urgency=low + + * Fix FTBFS on alpha. (Closes: #240023) + - patches/003_glibc.diff (mtree): Check for _STATBUF_ST_NSEC before + attempting nanosecond tests. + * control: Fix typo in description. (Closes: #239923) + + -- Robert Millan Sat, 3 Apr 2004 13:39:03 +0200 + +freebsd-buildutils (5.1-3) unstable; urgency=low + + * control (Build-Depends): Add bison. + + -- Robert Millan Wed, 24 Mar 2004 22:45:55 +0100 + +freebsd-buildutils (5.1-2) unstable; urgency=low + + * New package: freebsd-buildutils (based on freebsd-utils). + (Closes: #233074) + + -- Robert Millan Tue, 17 Feb 2004 13:36:30 +0100 + +freebsd-utils (5.1-1) unstable; urgency=low + + * Upgraded to 5.1 + * Converted to cdbs, and added Build-Depends for freebsd-source-5.1, + which contains the actual source code. + + -- Nathan Hawkins Tue, 7 Oct 2003 15:18:34 -0500 + +freebsd-utils (5.0-2) unstable; urgency=low + + * Set maintainer to glibc-bsd-devel@lists.alioth.debian.org + * Added me to Uploaders. + * Turn into non-native package. + * Added missing packages to Build-Depends (-libc5-dev, -gcc, byacc) + * Minor fixes in debian/copyright. + * Added dummy freebsd-utils package for upgrading. + + -- Robert Millan Fri, 11 Jul 2003 04:28:37 +0200 + +freebsd-utils-5.0 (5.0-1) unstable; urgency=low + + * Initial Release. + + -- Nathan Hawkins Fri, 11 Oct 2002 20:43:20 -0400 + --- freebsd-buildutils-7.1.orig/debian/compat +++ freebsd-buildutils-7.1/debian/compat @@ -0,0 +1 @@ +5 --- freebsd-buildutils-7.1.orig/debian/rules +++ freebsd-buildutils-7.1/debian/rules @@ -0,0 +1,163 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +DEB_BUILD_GNU_CPU := $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU) +DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) + +PMAKE=pmake +CFLAGS=-O2 -g -Wall -DMACHINE_ARCH='"$(DEB_HOST_ARCH_CPU)"' -D_GNU_SOURCE --include bsd/string.h --include bsd/random.h -I$(CURDIR)/build-tree/src/sys +MAKE_BUILD_FLAGS= CC=gcc NO_WERROR=1 NOGCCERROR=1 NOSHARED=NO NO_SHARED=NO +YACC=$(CURDIR)/build-tree/src/usr.bin/yacc/yacc +export LDADD=-lbsd + +package=freebsd-buildutils + +unpack: unpack-stamp +unpack-stamp: + mkdir build-tree + tar -C build-tree -xzf src.tar.gz + find build-tree -type d -name CVS | xargs rm -rf + find build-tree -type f | (set -e ; while read i ; do sed -i $$i \ + -e "/^__FBSDID/d" -e "s,,,g" -e "s/^LDADD=/LDADD+=/g" \ + -e "s/[ \t]*__\(dead2\|unused\|result\)[ \t]*/ /g" \ + -e "s/getline/bsd_&/g" \ + ; done) + set -e ; for i in \ + build-tree/ports/Mk/bsd.port.mk \ + build-tree/ports/Mk/bsd.port.subdir.mk \ + ; do sed -i $$i \ + -e "s,/usr/bin/,,g" \ + -e "s,/usr/sbin/,,g" \ + -e "s,/bin/,,g" \ + -e "s,/sbin/,,g" \ + -e "s,/usr/ports,/usr/share/$(package)/ports,g" \ + ; done + set -e ; cd build-tree && \ + for i in $(CURDIR)/debian/patches/*.diff ; do \ + echo "--- Patch $$i ---" ; \ + patch -p0 < $$i ; \ + done + + cp $(CURDIR)/build-tree/src/sys/kern/subr_sbuf.c \ + $(CURDIR)/build-tree/src/usr.sbin/config/ + + touch unpack-stamp + +build: unpack-stamp build-stamp +build-stamp: + dh_testdir + + cd build-tree/src/usr.bin/yacc ; \ + $(PMAKE) $(MAKE_BUILD_FLAGS) + + cd build-tree/src/usr.bin/cksum ; $(PMAKE) $(MAKE_BUILD_FLAGS) + + cd build-tree/src/usr.bin/lex ; \ + $(PMAKE) bootstrap ; \ + $(YACC) -d -o parse.c parse.y ; \ + $(PMAKE) $(MAKE_BUILD_FLAGS) + + cd build-tree/src/usr.bin/make ; \ + $(PMAKE) $(MAKE_BUILD_FLAGS) + + cd build-tree/src/usr.bin/mkdep ; $(PMAKE) $(MAKE_BUILD_FLAGS) + cd build-tree/src/usr.sbin/mtree ; $(PMAKE) $(MAKE_BUILD_FLAGS) + cd build-tree/src/usr.bin/file2c ; $(PMAKE) $(MAKE_BUILD_FLAGS) + cd build-tree/src/usr.bin/brandelf ; $(PMAKE) $(MAKE_BUILD_FLAGS) + + cd build-tree/src/usr.sbin/config ; \ + $(YACC) -d config.y ; \ + cp y.tab.c config.c ; \ + PATH=$(PATH):$(CURDIR)/build-tree/src/usr.bin/file2c \ + $(PMAKE) $(MAKE_BUILD_FLAGS) + + touch build-stamp + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + for i in cksum lex make mkdep yacc file2c brandelf ; do \ + cd $(CURDIR)/build-tree/src/usr.bin/$$i; \ + $(PMAKE) install DESTDIR=$(CURDIR)/debian/$(package) BINDIR=/usr/bin ; \ + done + for i in mtree config ; do \ + cd $(CURDIR)/build-tree/src/usr.sbin/$$i; \ + $(PMAKE) install DESTDIR=$(CURDIR)/debian/$(package) BINDIR=/usr/sbin ; \ + done + cd build-tree/src/share/mk ; \ + $(PMAKE) install \ + DESTDIR=$(CURDIR)/debian/$(package) BINDIR=/usr/share + + cp -af $(CURDIR)/build-tree/ports/Mk \ + $(CURDIR)/debian/$(package)/usr/share/ + + # remove trash + rm -rf $(CURDIR)/debian/$(package)/usr/include \ + $(CURDIR)/debian/$(package)/usr/share/man \ + $(CURDIR)/debian/$(package)/var + + # relocate binaries + mv \ + $(CURDIR)/debian/$(package)/usr/bin/* \ + $(CURDIR)/debian/$(package)/usr/sbin/* \ + $(CURDIR)/debian/$(package)/usr/lib/freebsd/ + for i in `cd $(CURDIR)/debian/$(package)/usr/lib/freebsd && ls` ; do \ + ln -s ../lib/freebsd/$$i \ + $(CURDIR)/debian/$(package)/usr/bin/freebsd-$$i ; \ + done + rmdir $(CURDIR)/debian/$(package)/usr/sbin + +clean: + dh_testdir + dh_testroot + rm -rf build-tree + rm -f *-stamp + + dh_clean + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot +# dh_installdebconf + dh_installdocs +# dh_installexamples +# dh_installmenu +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron + dh_installman +# dh_installinfo + dh_installchangelogs + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_makeshlibs + dh_installdeb +# dh_perl + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- freebsd-buildutils-7.1.orig/debian/patches/08_maxpathlen.diff +++ freebsd-buildutils-7.1/debian/patches/08_maxpathlen.diff @@ -0,0 +1,96 @@ +diff -ur ../foo.old/src/usr.bin/make/arch.c ./src/usr.bin/make/arch.c +--- ../foo.old/src/usr.bin/make/arch.c 2005-05-24 17:58:34.000000000 +0200 ++++ ./src/usr.bin/make/arch.c 2005-12-16 23:56:52.000000000 +0100 +@@ -190,6 +190,10 @@ + Error ARGS; \ + } while (0) + ++#ifndef MAXPATHLEN ++# define MAXPATHLEN 4096 ++#endif ++ + /*- + *----------------------------------------------------------------------- + * Arch_ParseArchive -- +diff -ur ../foo.old/src/usr.bin/make/main.c ./src/usr.bin/make/main.c +--- ../foo.old/src/usr.bin/make/main.c 2005-12-16 23:54:51.000000000 +0100 ++++ ./src/usr.bin/make/main.c 2005-12-16 23:57:36.000000000 +0100 +@@ -236,6 +236,9 @@ + { + char *fname, *fnamesave; /* makefile to read */ + FILE *stream; ++#ifndef MAXPATHLEN ++# define MAXPATHLEN 4096 ++#endif + char *name, path[MAXPATHLEN]; + char *MAKEFILE; + int setMAKEFILE; +diff -ur ../foo.old/src/usr.sbin/config/main.c ./src/usr.sbin/config/main.c +--- ../foo.old/src/usr.sbin/config/main.c 2005-12-16 23:54:51.000000000 +0100 ++++ ./src/usr.sbin/config/main.c 2005-12-16 23:56:52.000000000 +0100 +@@ -67,6 +67,10 @@ + #define FALSE (0) + #endif + ++#ifndef MAXPATHLEN ++# define MAXPATHLEN 4096 ++#endif ++ + #define CDIR "../compile/" + + char * PREFIX; +diff -ur ../foo.old/src/usr.sbin/config/mkmakefile.c ./src/usr.sbin/config/mkmakefile.c +--- ../foo.old/src/usr.sbin/config/mkmakefile.c 2005-11-27 22:41:57.000000000 +0100 ++++ ./src/usr.sbin/config/mkmakefile.c 2005-12-16 23:56:52.000000000 +0100 +@@ -65,6 +65,10 @@ + wd = word; \ + } + ++#ifndef MAXPATHLEN ++# define MAXPATHLEN 4096 ++#endif ++ + static char *tail(char *); + static void do_clean(FILE *); + static void do_rules(FILE *); +diff -ur ../foo.old/src/usr.sbin/config/mkoptions.c ./src/usr.sbin/config/mkoptions.c +--- ../foo.old/src/usr.sbin/config/mkoptions.c 2004-08-07 06:19:37.000000000 +0200 ++++ ./src/usr.sbin/config/mkoptions.c 2005-12-16 23:56:52.000000000 +0100 +@@ -48,6 +48,10 @@ + #include "config.h" + #include "y.tab.h" + ++#ifndef MAXPATHLEN ++# define MAXPATHLEN 4096 ++#endif ++ + static struct users { + int u_default; + int u_min; +diff -ur ../foo.old/src/usr.sbin/mtree/create.c ./src/usr.sbin/mtree/create.c +--- ../foo.old/src/usr.sbin/mtree/create.c 2005-12-16 23:54:51.000000000 +0100 ++++ ./src/usr.sbin/mtree/create.c 2005-12-16 23:56:52.000000000 +0100 +@@ -66,6 +66,10 @@ + #define INDENTNAMELEN 15 + #define MAXLINELEN 80 + ++#ifndef MAXHOSTNAMELEN ++# define MAXHOSTNAMELEN 255 ++#endif ++ + static gid_t gid; + static uid_t uid; + static mode_t mode; +diff -ur ../foo.old/src/usr.sbin/mtree/extern.h ./src/usr.sbin/mtree/extern.h +--- ../foo.old/src/usr.sbin/mtree/extern.h 2005-12-16 23:52:51.000000000 +0100 ++++ ./src/usr.sbin/mtree/extern.h 2005-12-16 23:56:52.000000000 +0100 +@@ -57,6 +57,7 @@ + extern u_int keys; + extern int lineno; + extern int dflag, eflag, iflag, nflag, qflag, rflag, sflag, uflag, wflag; +-#ifdef MAXPATHLEN +-extern char fullpath[MAXPATHLEN]; ++#ifndef MAXPATHLEN ++# define MAXPATHLEN 4096 + #endif ++extern char fullpath[MAXPATHLEN]; --- freebsd-buildutils-7.1.orig/debian/patches/09_ports_path.diff +++ freebsd-buildutils-7.1/debian/patches/09_ports_path.diff @@ -0,0 +1,124 @@ +diff -ur ports.old/Mk/bsd.port.mk ports/Mk/bsd.port.mk +--- ports.old/Mk/bsd.port.mk 2006-02-13 14:38:58.000000000 +0100 ++++ ports/Mk/bsd.port.mk 2006-02-13 14:40:38.000000000 +0100 +@@ -3336,7 +3332,7 @@ + .if !defined(DISABLE_VULNERABILITIES) && !defined(PACKAGE_BUILDING) + @if [ -f "${AUDITFILE}" ]; then \ + audit_created=`${_EXTRACT_AUDITFILE} | \ +- ${SED} -nEe "1s/^#CREATED: *([0-9]{4})-?([0-9]{2})-?([0-9]{2}).*$$/\1\2\3/p"`; \ ++ ${SED} -ne "1s/^#CREATED: *([0-9]{4})-?([0-9]{2})-?([0-9]{2}).*$$/\1\2\3/p"`; \ + audit_expiry=`date -u -v-14d "+%Y%m%d"`; \ + if [ "$$audit_created" -lt "$$audit_expiry" ]; then \ + ${ECHO_MSG} "===> WARNING: Vulnerability database out of date, checking anyway"; \ +@@ -3440,7 +3436,7 @@ + @cd ${_DISTDIR};\ + ${_PATCH_SITES_ENV} ; \ + for _file in ${PATCHFILES}; do \ +- file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \ ++ file=`${ECHO_CMD} $$_file | ${SED} -e 's/:[^:]+$$//'` ; \ + select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \ + force_fetch=false; \ + filebasename=$${file##*/}; \ +@@ -4415,7 +4411,7 @@ + @(cd ${_DISTDIR}; \ + ${_MASTER_SITES_ENV} ; \ + for _file in ${DISTFILES}; do \ +- file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \ ++ file=`${ECHO_CMD} $$_file | ${SED} -e 's/:[^:]+$$//'` ; \ + select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \ + if [ ! -f $$file -a ! -f $${file##*/} ]; then \ + if [ ! -z "$$select" ] ; then \ +@@ -4452,7 +4448,7 @@ + @(cd ${_DISTDIR}; \ + ${_PATCH_SITES_ENV} ; \ + for _file in ${PATCHFILES}; do \ +- file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \ ++ file=`${ECHO_CMD} $$_file | ${SED} -e 's/:[^:]+$$//'` ; \ + select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \ + if [ ! -f $$file -a ! -f $${file##*/} ]; then \ + if [ ! -z "$$select" ] ; then \ +@@ -4488,7 +4484,7 @@ + @(cd ${_DISTDIR}; \ + ${_MASTER_SITES_ENV}; \ + for _file in ${DISTFILES}; do \ +- file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \ ++ file=`${ECHO_CMD} $$_file | ${SED} -e 's/:[^:]+$$//'` ; \ + select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \ + if [ ! -z "${LISTALL}" -o ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \ + if [ ! -z "$$select" ] ; then \ +@@ -4519,7 +4515,7 @@ + @(cd ${_DISTDIR}; \ + ${_PATCH_SITES_ENV} ; \ + for _file in ${PATCHFILES}; do \ +- file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \ ++ file=`${ECHO_CMD} $$_file | ${SED} -e 's/:[^:]+$$//'` ; \ + select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \ + if [ ! -z "${LISTALL}" -o ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \ + if [ ! -z "$$select" ] ; then \ +@@ -5173,7 +5169,7 @@ + .endif + + BUILD-DEPENDS-LIST= \ +- for dir in $$(${ECHO_CMD} "${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS}" | ${SED} -E -e 's,([^: ]*):([^: ]*)(:[^ ]*)?,\2,g' -e 'y/ /\n/'| ${SORT} -u); do \ ++ for dir in $$(${ECHO_CMD} "${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS}" | ${SED} -e 's,([^: ]*):([^: ]*)(:[^ ]*)?,\2,g' -e 'y/ /\n/'| ${SORT} -u); do \ + if [ -d $$dir ]; then \ + ${ECHO_CMD} $$dir; \ + else \ +@@ -5489,7 +5485,7 @@ + done + @${ECHO_CMD} '@cwd ${PREFIX}' >> ${TMPPLIST} + .endif +- @for i in $$(${ECHO_CMD} ${__MANPAGES} ${_TMLINKS:M${_PREFIX}*:S|^${_PREFIX}/||} ' ' | ${SED} -E -e 's|man([1-9ln])/([^/ ]+) |cat\1/\2 |g'); do \ ++ @for i in $$(${ECHO_CMD} ${__MANPAGES} ${_TMLINKS:M${_PREFIX}*:S|^${_PREFIX}/||} ' ' | ${SED} -e 's|man([1-9ln])/([^/ ]+) |cat\1/\2 |g'); do \ + ${ECHO_CMD} "@unexec rm -f %D/$$i %D/$${i%.gz} %D/$${i%.bz2} %D/$$i.gz %D/$$i.bz2" >> ${TMPPLIST}; \ + done + .endfor +@@ -5540,7 +5536,7 @@ + add-plist-docs: + .if defined(PORTDOCS) && !defined(NOPORTDOCS) + @if ${EGREP} -qe '^@cw?d' ${TMPPLIST} && \ +- [ "`${SED} -En -e '/^@cw?d[ ]*/s,,,p' ${TMPPLIST} | ${TAIL} -n 1`" != "${PREFIX}" ]; then \ ++ [ "`${SED} -n -e '/^@cw?d[ ]*/s,,,p' ${TMPPLIST} | ${TAIL} -n 1`" != "${PREFIX}" ]; then \ + ${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}; \ + fi + .for x in ${PORTDOCS} +@@ -5563,7 +5559,7 @@ + add-plist-examples: + .if defined(PORTEXAMPLES) && !defined(NOPORTEXAMPLES) + @if ${EGREP} -qe '^@cw?d' ${TMPPLIST} && \ +- [ "`${SED} -En -e '/^@cw?d[ ]*/s,,,p' ${TMPPLIST} | ${TAIL} -n 1`" != "${PREFIX}" ]; then \ ++ [ "`${SED} -n -e '/^@cw?d[ ]*/s,,,p' ${TMPPLIST} | ${TAIL} -n 1`" != "${PREFIX}" ]; then \ + ${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}; \ + fi + .for x in ${PORTEXAMPLES} +@@ -5587,7 +5583,7 @@ + add-plist-data: + .if defined(PORTDATA) && !defined(NOPORTDATA) + @if ${EGREP} -qe '^@cw?d' ${TMPPLIST} && \ +- [ "`${SED} -En -e '/^@cw?d[ ]*/s,,,p' ${TMPPLIST} | ${TAIL} -n 1`" != "${PREFIX}" ]; then \ ++ [ "`${SED} -n -e '/^@cw?d[ ]*/s,,,p' ${TMPPLIST} | ${TAIL} -n 1`" != "${PREFIX}" ]; then \ + ${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}; \ + fi + .for x in ${PORTDATA} +diff -ur src/share/mk.old/bsd.port.mk src/share/mk/bsd.port.mk +--- src/share/mk.old/bsd.port.mk 2006-02-17 14:36:48.000000000 +0100 ++++ src/share/mk/bsd.port.mk 2006-02-17 14:37:53.000000000 +0100 +@@ -1,6 +1,6 @@ + # $FreeBSD: src/share/mk/bsd.port.mk,v 1.307 2004/07/02 20:47:18 eik Exp $ + +-PORTSDIR?= /usr/ports ++PORTSDIR?= /usr/share + BSDPORTMK?= ${PORTSDIR}/Mk/bsd.port.mk + + .include +diff -ur src/share/mk.old/bsd.port.subdir.mk src/share/mk/bsd.port.subdir.mk +--- src/share/mk.old/bsd.port.subdir.mk 2006-02-17 14:36:48.000000000 +0100 ++++ src/share/mk/bsd.port.subdir.mk 2006-02-17 14:38:03.000000000 +0100 +@@ -1,6 +1,6 @@ + # $FreeBSD: src/share/mk/bsd.port.subdir.mk,v 1.31 2004/07/02 20:47:18 eik Exp $ + +-PORTSDIR?= /usr/ports ++PORTSDIR?= /usr/share + BSDPORTSUBDIRMK?= ${PORTSDIR}/Mk/bsd.port.subdir.mk + + .include "${BSDPORTSUBDIRMK}" --- freebsd-buildutils-7.1.orig/debian/patches/11_optreset.diff +++ freebsd-buildutils-7.1/debian/patches/11_optreset.diff @@ -0,0 +1,20 @@ +--- src/usr.bin/make/main.c~ 2006-02-13 20:44:23.000000000 +0100 ++++ src/usr.bin/make/main.c 2006-02-13 20:46:55.000000000 +0100@ +@@ -136,6 +136,8 @@ + time_t now; /* Time at start of make */ + struct GNode *DEFAULT; /* .DEFAULT node */ + ++#include /* optreset */ ++ + /** + * Exit with usage message. + */ +@@ -358,7 +358,7 @@ + if ((optind < argc) && strcmp(argv[optind], "--") == 0) { + found_dd = TRUE; + } +- if ((c = getopt(argc, argv, OPTFLAGS)) == -1) { ++ if ((c = bsd_getopt(argc, argv, OPTFLAGS)) == -1) { + break; + } + switch(c) { --- freebsd-buildutils-7.1.orig/debian/patches/00_upstream.diff +++ freebsd-buildutils-7.1/debian/patches/00_upstream.diff @@ -0,0 +1,337 @@ +diff -ur src.old/usr.bin/cksum/cksum.c src/usr.bin/cksum/cksum.c +--- src.old/usr.bin/cksum/cksum.c 2003-03-14 00:32:28.000000000 +0100 ++++ src/usr.bin/cksum/cksum.c 2006-02-09 19:27:55.000000000 +0100 +@@ -57,6 +57,7 @@ + #include + #include + #include ++#include /* uintXX_t (glibc) */ + + #include "extern.h" + +diff -ur src.old/usr.bin/cksum/extern.h src/usr.bin/cksum/extern.h +--- src.old/usr.bin/cksum/extern.h 2003-03-14 00:32:28.000000000 +0100 ++++ src/usr.bin/cksum/extern.h 2006-02-09 19:27:55.000000000 +0100 +@@ -35,6 +35,7 @@ + */ + + #include ++#include /* uintXX_t (glibc) */ + + __BEGIN_DECLS + int crc(int, uint32_t *, off_t *); +diff -ur src.old/usr.bin/make/main.c src/usr.bin/make/main.c +--- src.old/usr.bin/make/main.c 2005-12-17 12:46:35.000000000 +0100 ++++ src/usr.bin/make/main.c 2006-02-09 19:28:13.000000000 +0100 +@@ -930,6 +930,7 @@ + } + #endif + ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + /* + * FreeBSD/pc98 kernel used to set the utsname.machine to + * "i386", and MACHINE was defined as "i386", so it could +@@ -950,6 +951,7 @@ + machine = "pc98"; + } + } ++#endif + + /* + * Get the name of this type of MACHINE from utsname +diff -ur src.old/usr.sbin/config/main.c src/usr.sbin/config/main.c +--- src.old/usr.sbin/config/main.c 2005-12-17 12:47:02.000000000 +0100 ++++ src/usr.sbin/config/main.c 2006-02-09 19:27:56.000000000 +0100 +@@ -52,6 +52,9 @@ + #include + #include + #include ++#ifndef _DIRENT_HAVE_D_NAMLEN ++#include /* strlen */ ++#endif + #include "y.tab.h" + #include "config.h" + #include "configvers.h" +@@ -455,7 +458,11 @@ + if ((dirp = opendir(p)) == NULL) + err(EX_OSERR, "opendir %s", p); + while ((dp = readdir(dirp)) != NULL) { ++#ifdef _DIRENT_HAVE_D_NAMLEN + i = dp->d_namlen - 2; ++#else ++ i = strlen (dp->d_name) - 2; ++#endif + /* Skip non-headers */ + if (dp->d_name[i] != '.' || dp->d_name[i + 1] != 'h') + continue; +diff -ur src.old/usr.sbin/mtree/compare.c src/usr.sbin/mtree/compare.c +--- src.old/usr.sbin/mtree/compare.c 2005-03-29 13:44:17.000000000 +0200 ++++ src/usr.sbin/mtree/compare.c 2006-02-09 19:27:56.000000000 +0100 +@@ -176,21 +176,22 @@ + (intmax_t)s->st_size, (intmax_t)p->fts_statp->st_size); + tab = "\t"; + } ++#ifdef ST_MTIM + /* + * XXX + * Catches nano-second differences, but doesn't display them. + */ + if ((s->flags & F_TIME) && +- ((s->st_mtimespec.tv_sec != p->fts_statp->st_mtimespec.tv_sec) || +- (s->st_mtimespec.tv_nsec != p->fts_statp->st_mtimespec.tv_nsec))) { ++ ((s->ST_MTIM.tv_sec != p->fts_statp->ST_MTIM.tv_sec) || ++ (s->ST_MTIM.tv_nsec != p->fts_statp->ST_MTIM.tv_nsec))) { + LABEL; + (void)printf("%smodification time expected %.24s ", +- tab, ctime(&s->st_mtimespec.tv_sec)); ++ tab, ctime(&s->ST_MTIM.tv_sec)); + (void)printf("found %.24s", +- ctime(&p->fts_statp->st_mtimespec.tv_sec)); ++ ctime(&p->fts_statp->ST_MTIM.tv_sec)); + if (uflag) { +- tv[0].tv_sec = s->st_mtimespec.tv_sec; +- tv[0].tv_usec = s->st_mtimespec.tv_nsec / 1000; ++ tv[0].tv_sec = s->ST_MTIM.tv_sec; ++ tv[0].tv_usec = s->ST_MTIM.tv_nsec / 1000; + tv[1] = tv[0]; + if (utimes(p->fts_accpath, tv)) + (void)printf(" not modified: %s\n", +@@ -201,6 +202,7 @@ + (void)printf("\n"); + tab = "\t"; + } ++#endif /* ST_MTIM */ + if (s->flags & F_CKSUM) { + if ((fd = open(p->fts_accpath, O_RDONLY, 0)) < 0) { + LABEL; +@@ -223,6 +225,7 @@ + } + } + } ++#if defined(__FreeBSD__) + if ((s->flags & F_FLAGS) && s->st_flags != p->fts_statp->st_flags) { + LABEL; + fflags = flags_to_string(s->st_flags); +@@ -243,6 +246,7 @@ + (void)printf("\n"); + tab = "\t"; + } ++#endif + #ifdef MD5 + if (s->flags & F_MD5) { + char *new_digest, buf[33]; +diff -ur src.old/usr.sbin/mtree/create.c src/usr.sbin/mtree/create.c +--- src.old/usr.sbin/mtree/create.c 2005-03-29 13:44:17.000000000 +0200 ++++ src/usr.sbin/mtree/create.c 2006-02-09 19:27:56.000000000 +0100 +@@ -73,7 +73,11 @@ + static u_long flags = 0xffffffff; + + static int dsort(const FTSENT * const *, const FTSENT * const *); +-static void output(int, int *, const char *, ...) __printflike(3, 4); ++static void output(int, int *, const char *, ...) ++#ifdef __FreeBSD__ ++__printflike(3, 4) ++#endif ++; + static int statd(FTS *, FTSENT *, uid_t *, gid_t *, mode_t *, u_long *); + static void statf(int, FTSENT *); + +@@ -211,10 +215,12 @@ + if (keys & F_SIZE) + output(indent, &offset, "size=%jd", + (intmax_t)p->fts_statp->st_size); ++#ifdef ST_MTIM + if (keys & F_TIME) + output(indent, &offset, "time=%ld.%ld", +- (long)p->fts_statp->st_mtimespec.tv_sec, +- p->fts_statp->st_mtimespec.tv_nsec); ++ (long)p->fts_statp->ST_MTIM.tv_sec, ++ p->fts_statp->ST_MTIM.tv_nsec); ++#endif + if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) { + if ((fd = open(p->fts_accpath, O_RDONLY, 0)) < 0 || + crc(fd, &val, &len)) +@@ -265,11 +271,13 @@ + if (keys & F_SLINK && + (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) + output(indent, &offset, "link=%s", rlink(p->fts_accpath)); ++#if defined(__FreeBSD__) + if (keys & F_FLAGS && p->fts_statp->st_flags != flags) { + fflags = flags_to_string(p->fts_statp->st_flags); + output(indent, &offset, "flags=%s", fflags); + free(fflags); + } ++#endif + (void)putchar('\n'); + } + +@@ -328,6 +336,7 @@ + maxuid = u[suid]; + } + ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + /* + * XXX + * note that the below will break when file flags +@@ -341,6 +350,7 @@ + saveflags = sflags; + maxflags = f[FLAGS2IDX(sflags)]; + } ++#endif /* __FreeBSD__ */ + } + } + /* +@@ -384,11 +394,13 @@ + (void)printf(" mode=%#o", savemode); + if (keys & F_NLINK) + (void)printf(" nlink=1"); ++#if defined(__FreeBSD__) + if (keys & F_FLAGS) { + fflags = flags_to_string(saveflags); + (void)printf(" flags=%s", fflags); + free(fflags); + } ++#endif + (void)printf("\n"); + *puid = saveuid; + *pgid = savegid; +diff -ur src.old/usr.sbin/mtree/extern.h src/usr.sbin/mtree/extern.h +--- src.old/usr.sbin/mtree/extern.h 2004-01-11 20:38:48.000000000 +0100 ++++ src/usr.sbin/mtree/extern.h 2006-02-09 19:27:56.000000000 +0100 +@@ -29,6 +29,9 @@ + * @(#)extern.h 8.1 (Berkeley) 6/6/93 + * $FreeBSD: ./src/usr.sbin/mtree/extern.h,v 1.13 2004/01/11 19:38:48 phk Exp $ + */ ++ ++#include ++ + extern uint32_t crc_total; + + #ifdef _FTS_H_ +diff -ur src.old/usr.sbin/mtree/misc.c src/usr.sbin/mtree/misc.c +--- src.old/usr.sbin/mtree/misc.c 2005-03-29 13:44:17.000000000 +0200 ++++ src/usr.sbin/mtree/misc.c 2006-02-09 19:27:56.000000000 +0100 +@@ -106,6 +106,7 @@ + return (strcmp(((const KEY *)a)->name, ((const KEY *)b)->name)); + } + ++#if defined(__FreeBSD__) + char * + flags_to_string(u_long fflags) + { +@@ -121,3 +122,4 @@ + + return string; + } ++#endif /* __FreeBSD__ */ +diff -ur src.old/usr.sbin/mtree/mtree.h src/usr.sbin/mtree/mtree.h +--- src.old/usr.sbin/mtree/mtree.h 2005-03-29 13:44:17.000000000 +0200 ++++ src/usr.sbin/mtree/mtree.h 2006-02-09 19:27:56.000000000 +0100 +@@ -42,7 +42,16 @@ + struct _node *parent, *child; /* up, down */ + struct _node *prev, *next; /* left, right */ + off_t st_size; /* size */ +- struct timespec st_mtimespec; /* last modification time */ ++#ifdef __GLIBC__ ++# ifdef _STATBUF_ST_NSEC ++# define ST_MTIM st_mtim ++# endif ++#else ++# define ST_MTIM st_mtimespec ++#endif ++#ifdef ST_MTIM ++ struct timespec ST_MTIM; /* last modification time */ ++#endif + u_long cksum; /* check sum */ + char *md5digest; /* MD5 digest */ + char *sha1digest; /* SHA-1 digest */ +@@ -51,6 +60,9 @@ + char *slink; /* symbolic link reference */ + uid_t st_uid; /* uid */ + gid_t st_gid; /* gid */ ++#ifndef S_ISTXT ++#define S_ISTXT S_ISVTX ++#endif + #define MBITS (S_ISUID|S_ISGID|S_ISTXT|S_IRWXU|S_IRWXG|S_IRWXO) + mode_t st_mode; /* mode */ + u_long st_flags; /* flags */ +diff -ur src.old/usr.sbin/mtree/spec.c src/usr.sbin/mtree/spec.c +--- src.old/usr.sbin/mtree/spec.c 2005-03-29 13:44:17.000000000 +0200 ++++ src/usr.sbin/mtree/spec.c 2006-02-09 19:27:56.000000000 +0100 +@@ -169,7 +169,9 @@ + char *kw, *val = NULL; + struct group *gr; + struct passwd *pw; ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + mode_t *m; ++#endif + int value; + char *ep; + +@@ -204,12 +206,14 @@ + if(!ip->rmd160digest) + errx(1, "strdup"); + break; ++#if defined(__FreeBSD__) + case F_FLAGS: + if (strcmp("none", val) == 0) + ip->st_flags = 0; + else if (strtofflags(&val, &ip->st_flags, NULL) != 0) + errx(1, "line %d: invalid flag %s",lineno, val); + break; ++#endif + case F_GID: + ip->st_gid = strtoul(val, &ep, 10); + if (*ep) +@@ -249,17 +253,19 @@ + if (strunvis(ip->slink, val) == -1) + errx(1, "symlink %s is ill-encoded", val); + break; ++#ifdef ST_MTIM + case F_TIME: +- ip->st_mtimespec.tv_sec = strtoul(val, &ep, 10); ++ ip->ST_MTIM.tv_sec = strtoul(val, &ep, 10); + if (*ep != '.') + errx(1, "line %d: invalid time %s", + lineno, val); + val = ep + 1; +- ip->st_mtimespec.tv_nsec = strtoul(val, &ep, 10); ++ ip->ST_MTIM.tv_nsec = strtoul(val, &ep, 10); + if (*ep) + errx(1, "line %d: invalid time %s", + lineno, val); + break; ++#endif + case F_TYPE: + switch(*val) { + case 'b': +diff -ur src.old/usr.sbin/mtree/specspec.c src/usr.sbin/mtree/specspec.c +--- src.old/usr.sbin/mtree/specspec.c 2005-03-29 13:44:17.000000000 +0200 ++++ src/usr.sbin/mtree/specspec.c 2006-02-09 19:27:56.000000000 +0100 +@@ -150,8 +150,10 @@ + differs |= F_SIZE; + if (FS(n1, n2, F_SLINK, slink)) + differs |= F_SLINK; +- if (FM(n1, n2, F_TIME, st_mtimespec)) ++#ifdef ST_MTIM ++ if (FM(n1, n2, F_TIME, ST_MTIM)) + differs |= F_TIME; ++#endif + if (FF(n1, n2, F_UID, st_uid)) + differs |= F_UID; + if (FF(n1, n2, F_UNAME, st_uid)) +diff -ur src.old/usr.sbin/mtree/verify.c src/usr.sbin/mtree/verify.c +--- src.old/usr.sbin/mtree/verify.c 2005-12-17 12:47:12.000000000 +0100 ++++ src/usr.sbin/mtree/verify.c 2006-02-09 19:27:56.000000000 +0100 +@@ -243,9 +243,11 @@ + if (chmod(path, p->st_mode)) + (void)printf("%s: permissions not set: %s\n", + path, strerror(errno)); ++#if defined(__FreeBSD__) + if ((p->flags & F_FLAGS) && p->st_flags && + chflags(path, p->st_flags)) + (void)printf("%s: file flags not set: %s\n", + path, strerror(errno)); ++#endif + } + } --- freebsd-buildutils-7.1.orig/debian/patches/01_make_fixes.diff +++ freebsd-buildutils-7.1/debian/patches/01_make_fixes.diff @@ -0,0 +1,191 @@ +diff -ur ../foo.old/src/share/mk/bsd.incs.mk ./src/share/mk/bsd.incs.mk +--- ../foo.old/src/share/mk/bsd.incs.mk 2005-12-17 12:45:38.000000000 +0100 ++++ ./src/share/mk/bsd.incs.mk 2005-12-17 12:49:33.000000000 +0100 +@@ -39,7 +39,7 @@ + .endif + installincludes: _${group}INS_${header:T} + _${group}INS_${header:T}: ${header} +- ${INSTALL} -C -o ${${group}OWN_${.ALLSRC:T}} \ ++ ${INSTALL} -o ${${group}OWN_${.ALLSRC:T}} \ + -g ${${group}GRP_${.ALLSRC:T}} -m ${${group}MODE_${.ALLSRC:T}} \ + ${.ALLSRC} \ + ${DESTDIR}${${group}DIR_${.ALLSRC:T}}/${${group}NAME_${.ALLSRC:T}} +@@ -51,10 +51,10 @@ + installincludes: _${group}INS + _${group}INS: ${_${group}INCS} + .if defined(${group}NAME) +- ${INSTALL} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ ++ ${INSTALL} -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ + ${.ALLSRC} ${DESTDIR}${${group}DIR}/${${group}NAME} + .else +- ${INSTALL} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ ++ ${INSTALL} -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ + ${.ALLSRC} ${DESTDIR}${${group}DIR} + .endif + .endif +diff -ur ../foo.old/src/share/mk/bsd.info.mk ./src/share/mk/bsd.info.mk +--- ../foo.old/src/share/mk/bsd.info.mk 2005-12-17 12:45:38.000000000 +0100 ++++ ./src/share/mk/bsd.info.mk 2005-12-17 12:50:33.000000000 +0100 +@@ -75,7 +75,7 @@ + MAKEINFOFLAGS+= --no-split # simplify some things, e.g., compression + SRCDIR?= ${.CURDIR} + INFODIRFILE?= dir +-INSTALLINFO?= install-info ++INSTALLINFO?= `which ginstall-info || which install-info` + INSTALLINFOFLAGS+=--quiet + INFOSECTION?= Miscellaneous + ICOMPRESS_CMD?= ${COMPRESS_CMD} +@@ -145,18 +145,8 @@ + .for x in ${INFO} + INSTALLINFODIRS+= ${x:S/$/-install/} + ${x:S/$/-install/}: +-.if !empty(.MAKEFLAGS:M-j) +- lockf -k ${DESTDIR}${INFODIR}/${INFODIRFILE} \ +- ${INSTALLINFO} ${INSTALLINFOFLAGS} \ +- --defsection=${INFOSECTION} \ +- --defentry=${INFOENTRY_${x}} \ +- ${x}.info ${DESTDIR}${INFODIR}/${INFODIRFILE} +-.else +- ${INSTALLINFO} ${INSTALLINFOFLAGS} \ +- --defsection=${INFOSECTION} \ +- --defentry=${INFOENTRY_${x}} \ +- ${x}.info ${DESTDIR}${INFODIR}/${INFODIRFILE} +-.endif ++ mkdir -p ${DESTDIR}${INFODIR} ++ install -m 644 ${x}.info ${DESTDIR}${INFODIR}/ + .endfor + + .PHONY: ${INSTALLINFODIRS} +diff -ur ../foo.old/src/share/mk/bsd.lib.mk ./src/share/mk/bsd.lib.mk +--- ../foo.old/src/share/mk/bsd.lib.mk 2005-12-17 12:45:38.000000000 +0100 ++++ ./src/share/mk/bsd.lib.mk 2005-12-17 12:49:11.000000000 +0100 +@@ -124,9 +124,9 @@ + @${ECHO} building static ${LIB} library + @rm -f ${.TARGET} + .if !defined(NM) +- @${AR} cq ${.TARGET} `lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD} ++ @${AR} cq ${.TARGET} `lorder ${OBJS} ${STATICOBJS} | tsort` ${ARADD} + .else +- @${AR} cq ${.TARGET} `NM='${NM}' lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD} ++ @${AR} cq ${.TARGET} `NM='${NM}' lorder ${OBJS} ${STATICOBJS} | tsort` ${ARADD} + .endif + ${RANLIB} ${.TARGET} + .endif +@@ -141,9 +141,9 @@ + @${ECHO} building profiled ${LIB} library + @rm -f ${.TARGET} + .if !defined(NM) +- @${AR} cq ${.TARGET} `lorder ${POBJS} | tsort -q` ${ARADD} ++ @${AR} cq ${.TARGET} `lorder ${POBJS} | tsort` ${ARADD} + .else +- @${AR} cq ${.TARGET} `NM='${NM}' lorder ${POBJS} | tsort -q` ${ARADD} ++ @${AR} cq ${.TARGET} `NM='${NM}' lorder ${POBJS} | tsort` ${ARADD} + .endif + ${RANLIB} ${.TARGET} + .endif +@@ -160,16 +160,16 @@ + @${ECHO} building shared library ${SHLIB_NAME} + @rm -f ${.TARGET} ${SHLIB_LINK} + .if defined(SHLIB_LINK) +- @ln -fs ${.TARGET} ${SHLIB_LINK} ++ @ln -fs ${SHLIBDIR}${.TARGET} ${SHLIB_LINK} + .endif + .if !defined(NM) + @${CC} ${LDFLAGS} -shared -Wl,-x \ + -o ${.TARGET} -Wl,-soname,${SONAME} \ +- `lorder ${SOBJS} | tsort -q` ${LDADD} ++ `lorder ${SOBJS} | tsort` ${LDADD} + .else + @${CC} ${LDFLAGS} -shared -Wl,-x \ + -o ${.TARGET} -Wl,-soname,${SONAME} \ +- `NM='${NM}' lorder ${SOBJS} | tsort -q` ${LDADD} ++ `NM='${NM}' lorder ${SOBJS} | tsort` ${LDADD} + .endif + .endif + +@@ -236,11 +236,11 @@ + .ORDER: beforeinstall _libinstall + _libinstall: + .if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no" +- ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ++ ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${_INSTALLFLAGS} lib${LIB}.a ${DESTDIR}${LIBDIR} + .endif + .if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) +- ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ++ ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${_INSTALLFLAGS} lib${LIB}_p.a ${DESTDIR}${LIBDIR} + .endif + .if defined(SHLIB_NAME) +diff -ur ../foo.old/src/share/mk/bsd.man.mk ./src/share/mk/bsd.man.mk +--- ../foo.old/src/share/mk/bsd.man.mk 2005-01-06 12:12:43.000000000 +0100 ++++ ./src/share/mk/bsd.man.mk 2005-12-17 12:49:11.000000000 +0100 +@@ -211,12 +211,12 @@ + [123]) echo "warn: empty MLINK: $$1 $$2 $$3"; break;; \ + esac; \ + name=$$1; shift; sect=$$1; shift; \ +- l=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}/$$name; \ ++ l=${MANDIR}$${sect}${MANSUBDIR}/$$name; \ + name=$$1; shift; sect=$$1; shift; \ + t=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}/$$name; \ + ${ECHO} $${t}${ZEXT} -\> $${l}${ZEXT}; \ + rm -f $${t} $${t}${MCOMPRESS_EXT}; \ +- ln $${l}${ZEXT} $${t}${ZEXT}; \ ++ ln -s $${l}${ZEXT} $${t}${ZEXT}; \ + done + .if defined(MANBUILDCAT) && !empty(MANBUILDCAT) + @set ${MLINKS:C/\.([^.]*)$/.\1 \1/}; \ +@@ -226,12 +226,12 @@ + [123]) echo "warn: empty MLINK: $$1 $$2 $$3"; break;; \ + esac; \ + name=$$1; shift; sect=$$1; shift; \ +- l=${DESTDIR}${CATDIR}$${sect}${MANSUBDIR}/$$name; \ ++ l=${CATDIR}$${sect}${MANSUBDIR}/$$name; \ + name=$$1; shift; sect=$$1; shift; \ + t=${DESTDIR}${CATDIR}$${sect}${MANSUBDIR}/$$name; \ + ${ECHO} $${t}${ZEXT} -\> $${l}${ZEXT}; \ + rm -f $${t} $${t}${MCOMPRESS_EXT}; \ +- ln $${l}${ZEXT} $${t}${ZEXT}; \ ++ ln -s $${l}${ZEXT} $${t}${ZEXT}; \ + done + .endif + .endif +diff -ur ../foo.old/src/share/mk/bsd.own.mk ./src/share/mk/bsd.own.mk +--- ../foo.old/src/share/mk/bsd.own.mk 2005-04-11 09:13:29.000000000 +0200 ++++ ./src/share/mk/bsd.own.mk 2005-12-17 12:49:11.000000000 +0100 +@@ -18,7 +18,7 @@ + # + # BINOWN Binary owner. [root] + # +-# BINGRP Binary group. [wheel] ++# BINGRP Binary group. [root] + # + # BINMODE Binary mode. [555] + # +@@ -56,7 +56,7 @@ + # + # SHAREOWN ASCII text file owner. [root] + # +-# SHAREGRP ASCII text file group. [wheel] ++# SHAREGRP ASCII text file group. [root] + # + # SHAREMODE ASCII text file mode. [${NOBINMODE}] + # +@@ -106,7 +106,7 @@ + + # Binaries + BINOWN?= root +-BINGRP?= wheel ++BINGRP?= root + BINMODE?= 555 + NOBINMODE?= 444 + +@@ -132,7 +132,7 @@ + # Share files + SHAREDIR?= /usr/share + SHAREOWN?= root +-SHAREGRP?= wheel ++SHAREGRP?= root + SHAREMODE?= ${NOBINMODE} + + MANDIR?= ${SHAREDIR}/man/man --- freebsd-buildutils-7.1.orig/debian/patches/12_unused.diff +++ freebsd-buildutils-7.1/debian/patches/12_unused.diff @@ -0,0 +1,28 @@ + + sed in debian/rules deletes "__unused" everywhere, + fix consequences now + +diff -ur src/usr.bin/yacc/skeleton.c src/usr.bin/yacc/skeleton.c +--- src/usr.bin/yacc/skeleton.c ++++ src/usr.bin/yacc/skeleton.c +@@ -60,9 +60,6 @@ + { + "#include ", + "#ifndef lint", +- "#ifdef ", +- " ", +- "#endif", + "static char const ", + "yyrcsid[] = \"$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.37 2003/02/12 18:03:55 davidc Exp $\";", + "#endif", +diff -ur src/usr.bin/lex/flex.skl src/usr.bin/lex/flex.skl +--- src/usr.bin/lex/flex.skl ++++ src/usr.bin/lex/flex.skl +@@ -8,7 +8,6 @@ + #if defined(__FreeBSD__) + #include + #else +-#define + #endif + + #define FLEX_SCANNER --- freebsd-buildutils-7.1.orig/debian/patches/05_disable_hardlinks.diff +++ freebsd-buildutils-7.1/debian/patches/05_disable_hardlinks.diff @@ -0,0 +1,40 @@ +diff -ur src.old/usr.bin/cksum/Makefile src/usr.bin/cksum/Makefile +--- src.old/usr.bin/cksum/Makefile 2002-02-08 23:31:36.000000000 +0100 ++++ src/usr.bin/cksum/Makefile 2004-03-11 23:28:08.000000000 +0100 +@@ -3,7 +3,7 @@ + + PROG= cksum + SRCS= cksum.c crc.c print.c sum1.c sum2.c crc32.c +-LINKS= ${BINDIR}/cksum ${BINDIR}/sum ++SIMLINKS= ${BINDIR}/cksum ${BINDIR}/sum + MLINKS= cksum.1 sum.1 + + .include +diff -ur src.old/usr.bin/lex/Makefile src/usr.bin/lex/Makefile +--- src.old/usr.bin/lex/Makefile 2002-05-12 18:00:44.000000000 +0200 ++++ src/usr.bin/lex/Makefile 2004-03-11 23:28:24.000000000 +0100 +@@ -10,9 +10,9 @@ + # + + PROG= lex +-LINKS+= ${BINDIR}/lex ${BINDIR}/lex++ +-LINKS+= ${BINDIR}/lex ${BINDIR}/flex +-LINKS+= ${BINDIR}/lex ${BINDIR}/flex++ ++SIMLINKS+= ${BINDIR}/lex ${BINDIR}/lex++ ++SIMLINKS+= ${BINDIR}/lex ${BINDIR}/flex ++SIMLINKS+= ${BINDIR}/lex ${BINDIR}/flex++ + + SRCS= scan.c ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.y \ + skel.c sym.c tblcmp.c yylex.c +diff -ur src.old/usr.bin/yacc/Makefile src/usr.bin/yacc/Makefile +--- src.old/usr.bin/yacc/Makefile 2002-02-09 00:07:36.000000000 +0100 ++++ src/usr.bin/yacc/Makefile 2004-03-11 23:27:28.000000000 +0100 +@@ -6,7 +6,7 @@ + skeleton.c symtab.c verbose.c warshall.c + SCRIPTS=yyfix.sh + MAN= yacc.1 yyfix.1 +-LINKS= ${BINDIR}/yacc ${BINDIR}/byacc ++SIMLINKS= ${BINDIR}/yacc ${BINDIR}/byacc + MLINKS= yacc.1 byacc.1 + + .include --- freebsd-buildutils-7.1.orig/debian/patches/14_config.diff +++ freebsd-buildutils-7.1/debian/patches/14_config.diff @@ -0,0 +1,71 @@ +diff -u src/sys/sys/sbuf.h src/sys/sys/sbuf.h +--- src/sys/sys/sbuf.h ++++ src/sys/sys/sbuf.h +@@ -31,7 +31,8 @@ + #ifndef _SYS_SBUF_H_ + #define _SYS_SBUF_H_ + +-#include ++#include ++#include + + /* + * Structure definition +@@ -63,8 +63,8 @@ + int sbuf_bcpy(struct sbuf *, const void *, size_t); + int sbuf_cat(struct sbuf *, const char *); + int sbuf_cpy(struct sbuf *, const char *); +-int sbuf_printf(struct sbuf *, const char *, ...) __printflike(2, 3); +-int sbuf_vprintf(struct sbuf *, const char *, __va_list) __printflike(2, 0); ++int sbuf_printf(struct sbuf *, const char *, ...); ++int sbuf_vprintf(struct sbuf *, const char *, va_list); + int sbuf_putc(struct sbuf *, int); + int sbuf_trim(struct sbuf *); + int sbuf_overflowed(struct sbuf *); +diff -u src/sys/kern/subr_sbuf.c src/sys/kern/subr_sbuf.c +--- src/sys/kern/subr_sbuf.c ++++ src/sys/kern/subr_sbuf.c +@@ -76,8 +76,8 @@ + #define SBUF_CLEARFLAG(s, f) do { (s)->s_flags &= ~(f); } while (0) + + #define SBUF_MINEXTENDSIZE 16 /* Should be power of 2. */ +-#define SBUF_MAXEXTENDSIZE PAGE_SIZE +-#define SBUF_MAXEXTENDINCR PAGE_SIZE ++#define SBUF_MAXEXTENDSIZE 4096 ++#define SBUF_MAXEXTENDINCR SBUF_MAXEXTENDSIZE + + /* + * Debugging support +diff -u src/usr.sbin/config/Makefile src/usr.sbin/config/Makefile +--- src/usr.sbin/config/Makefile ++++ src/usr.sbin/config/Makefile +@@ -4,7 +4,7 @@ + PROG= config + MAN= config.5 config.8 + SRCS= config.y main.c lang.l mkmakefile.c mkheaders.c \ +- mkoptions.c y.tab.h kernconf.c ++ mkoptions.c y.tab.h kernconf.c subr_sbuf.c + + kernconf.c: kernconf.tmpl + file2c 'char kernconfstr[] = {' ',0};' < ${.CURDIR}/kernconf.tmpl > kernconf.c +@@ -13,7 +13,7 @@ + CFLAGS+= -I. -I${.CURDIR} + + DPADD= ${LIBL} ${LIBSBUF} +-LDADD+= -ll -lsbuf ++LDADD+= -ll + + CLEANFILES+= kernconf.c + +diff -u src/usr.sbin/config/main.c src/usr.sbin/config/main.c +--- src/usr.sbin/config/main.c ++++ src/usr.sbin/config/main.c +@@ -43,6 +43,8 @@ + + #include + #include ++#include ++#include + #include + #include + #include --- freebsd-buildutils-7.1.orig/debian/patches/15_manpages_gzip.diff +++ freebsd-buildutils-7.1/debian/patches/15_manpages_gzip.diff @@ -0,0 +1,11 @@ +--- src/share/mk/bsd.own.mk.orig 2009-04-07 17:46:36.000000000 +0200 ++++ src/share/mk/bsd.own.mk 2009-04-07 17:46:43.000000000 +0200 +@@ -171,7 +171,7 @@ + STRIP?= -s + .endif + +-COMPRESS_CMD?= gzip -cn ++COMPRESS_CMD?= gzip -cn -9 + COMPRESS_EXT?= .gz + + .if !defined(_WITHOUT_SRCCONF) --- freebsd-buildutils-7.1.orig/debian/patches/13_bsd_sys.diff +++ freebsd-buildutils-7.1/debian/patches/13_bsd_sys.diff @@ -0,0 +1,14 @@ + do not add -Wno-pointer-sign, + kfreebsd-6 still uses gcc-3.4 + +--- src/share/mk/bsd.sys.mk ++++ src/share/mk/bsd.sys.mk +@@ -55,7 +55,7 @@ + CWARNFLAGS += -Wno-uninitialized + . endif + . if !defined(WITH_GCC3) +-CWARNFLAGS += -Wno-pointer-sign ++#CWARNFLAGS += -Wno-pointer-sign + . endif + . endif + --- freebsd-buildutils-7.1.orig/debian/patches/07_brandelf.diff +++ freebsd-buildutils-7.1/debian/patches/07_brandelf.diff @@ -0,0 +1,315 @@ +diff -Nur src/usr.bin/brandelf.old/brandelf.c src/usr.bin/brandelf/brandelf.c +--- src/usr.bin/brandelf.old/brandelf.c 2004-12-27 22:19:41.000000000 +0100 ++++ src/usr.bin/brandelf/brandelf.c 2004-12-27 22:24:22.000000000 +0100 +@@ -30,7 +30,7 @@ + #include + + #include +-#include ++#include "elf_common.h" + #include + #include + #include +diff -Nur src/usr.bin/brandelf.old/elf_common.h src/usr.bin/brandelf/elf_common.h +--- src/usr.bin/brandelf.old/elf_common.h 1970-01-01 01:00:00.000000000 +0100 ++++ src/usr.bin/brandelf/elf_common.h 2004-12-27 22:24:12.000000000 +0100 +@@ -0,0 +1,299 @@ ++/*- ++ * Copyright (c) 1998 John D. Polstra. ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ * ++ * $FreeBSD: src/sys/sys/elf_common.h,v 1.15 2004/05/05 02:38:54 marcel Exp $ ++ */ ++ ++#ifndef _SYS_ELF_COMMON_H_ ++#define _SYS_ELF_COMMON_H_ 1 ++ ++/* ++ * ELF definitions that are independent of architecture or word size. ++ */ ++ ++/* ++ * Note header. The ".note" section contains an array of notes. Each ++ * begins with this header, aligned to a word boundary. Immediately ++ * following the note header is n_namesz bytes of name, padded to the ++ * next word boundary. Then comes n_descsz bytes of descriptor, again ++ * padded to a word boundary. The values of n_namesz and n_descsz do ++ * not include the padding. ++ */ ++ ++typedef struct { ++ u_int32_t n_namesz; /* Length of name. */ ++ u_int32_t n_descsz; /* Length of descriptor. */ ++ u_int32_t n_type; /* Type of this note. */ ++} Elf_Note; ++ ++/* Indexes into the e_ident array. Keep synced with ++ http://www.sco.com/developer/gabi/ch4.eheader.html */ ++#define EI_MAG0 0 /* Magic number, byte 0. */ ++#define EI_MAG1 1 /* Magic number, byte 1. */ ++#define EI_MAG2 2 /* Magic number, byte 2. */ ++#define EI_MAG3 3 /* Magic number, byte 3. */ ++#define EI_CLASS 4 /* Class of machine. */ ++#define EI_DATA 5 /* Data format. */ ++#define EI_VERSION 6 /* ELF format version. */ ++#define EI_OSABI 7 /* Operating system / ABI identification */ ++#define EI_ABIVERSION 8 /* ABI version */ ++#define OLD_EI_BRAND 8 /* Start of architecture identification. */ ++#define EI_PAD 9 /* Start of padding (per SVR4 ABI). */ ++#define EI_NIDENT 16 /* Size of e_ident array. */ ++ ++/* Values for the magic number bytes. */ ++#define ELFMAG0 0x7f ++#define ELFMAG1 'E' ++#define ELFMAG2 'L' ++#define ELFMAG3 'F' ++#define ELFMAG "\177ELF" /* magic string */ ++#define SELFMAG 4 /* magic string size */ ++ ++/* Values for e_ident[EI_VERSION] and e_version. */ ++#define EV_NONE 0 ++#define EV_CURRENT 1 ++ ++/* Values for e_ident[EI_CLASS]. */ ++#define ELFCLASSNONE 0 /* Unknown class. */ ++#define ELFCLASS32 1 /* 32-bit architecture. */ ++#define ELFCLASS64 2 /* 64-bit architecture. */ ++ ++/* Values for e_ident[EI_DATA]. */ ++#define ELFDATANONE 0 /* Unknown data format. */ ++#define ELFDATA2LSB 1 /* 2's complement little-endian. */ ++#define ELFDATA2MSB 2 /* 2's complement big-endian. */ ++ ++/* Values for e_ident[EI_OSABI]. */ ++#define ELFOSABI_SYSV 0 /* UNIX System V ABI */ ++#define ELFOSABI_NONE ELFOSABI_SYSV /* symbol used in old spec */ ++#define ELFOSABI_HPUX 1 /* HP-UX operating system */ ++#define ELFOSABI_NETBSD 2 /* NetBSD */ ++#define ELFOSABI_LINUX 3 /* GNU/Linux */ ++#define ELFOSABI_HURD 4 /* GNU/Hurd */ ++#define ELFOSABI_86OPEN 5 /* 86Open common IA32 ABI */ ++#define ELFOSABI_SOLARIS 6 /* Solaris */ ++#define ELFOSABI_MONTEREY 7 /* Monterey */ ++#define ELFOSABI_IRIX 8 /* IRIX */ ++#define ELFOSABI_FREEBSD 9 /* FreeBSD */ ++#define ELFOSABI_TRU64 10 /* TRU64 UNIX */ ++#define ELFOSABI_MODESTO 11 /* Novell Modesto */ ++#define ELFOSABI_OPENBSD 12 /* OpenBSD */ ++#define ELFOSABI_ARM 97 /* ARM */ ++#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ ++ ++/* e_ident */ ++#define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \ ++ (ehdr).e_ident[EI_MAG1] == ELFMAG1 && \ ++ (ehdr).e_ident[EI_MAG2] == ELFMAG2 && \ ++ (ehdr).e_ident[EI_MAG3] == ELFMAG3) ++ ++/* Values for e_type. */ ++#define ET_NONE 0 /* Unknown type. */ ++#define ET_REL 1 /* Relocatable. */ ++#define ET_EXEC 2 /* Executable. */ ++#define ET_DYN 3 /* Shared object. */ ++#define ET_CORE 4 /* Core file. */ ++ ++/* Values for e_machine. */ ++#define EM_NONE 0 /* Unknown machine. */ ++#define EM_M32 1 /* AT&T WE32100. */ ++#define EM_SPARC 2 /* Sun SPARC. */ ++#define EM_386 3 /* Intel i386. */ ++#define EM_68K 4 /* Motorola 68000. */ ++#define EM_88K 5 /* Motorola 88000. */ ++#define EM_486 6 /* Intel i486. */ ++#define EM_860 7 /* Intel i860. */ ++#define EM_MIPS 8 /* MIPS R3000 Big-Endian only */ ++ ++/* Extensions. This list is not complete. */ ++#define EM_S370 9 /* IBM System/370 */ ++#define EM_MIPS_RS4_BE 10 /* MIPS R4000 Big-Endian */ /* Depreciated */ ++#define EM_PARISC 15 /* HPPA */ ++#define EM_SPARC32PLUS 18 /* SPARC v8plus */ ++#define EM_PPC 20 /* PowerPC 32-bit */ ++#define EM_PPC64 21 /* PowerPC 64-bit */ ++#define EM_ARM 40 /* ARM */ ++#define EM_SPARCV9 43 /* SPARC v9 64-bit */ ++#define EM_IA_64 50 /* Intel IA-64 Processor */ ++#define EM_X86_64 62 /* Advanced Micro Devices x86-64 */ ++#define EM_ALPHA 0x9026 /* Alpha (written in the absence of an ABI */ ++ ++/* Special section indexes. */ ++#define SHN_UNDEF 0 /* Undefined, missing, irrelevant. */ ++#define SHN_LORESERVE 0xff00 /* First of reserved range. */ ++#define SHN_LOPROC 0xff00 /* First processor-specific. */ ++#define SHN_HIPROC 0xff1f /* Last processor-specific. */ ++#define SHN_ABS 0xfff1 /* Absolute values. */ ++#define SHN_COMMON 0xfff2 /* Common data. */ ++#define SHN_HIRESERVE 0xffff /* Last of reserved range. */ ++ ++/* sh_type */ ++#define SHT_NULL 0 /* inactive */ ++#define SHT_PROGBITS 1 /* program defined information */ ++#define SHT_SYMTAB 2 /* symbol table section */ ++#define SHT_STRTAB 3 /* string table section */ ++#define SHT_RELA 4 /* relocation section with addends */ ++#define SHT_HASH 5 /* symbol hash table section */ ++#define SHT_DYNAMIC 6 /* dynamic section */ ++#define SHT_NOTE 7 /* note section */ ++#define SHT_NOBITS 8 /* no space section */ ++#define SHT_REL 9 /* relocation section - no addends */ ++#define SHT_SHLIB 10 /* reserved - purpose unknown */ ++#define SHT_DYNSYM 11 /* dynamic symbol table section */ ++#define SHT_NUM 12 /* number of section types */ ++#define SHT_LOOS 0x60000000 /* First of OS specific semantics */ ++#define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */ ++#define SHT_LOPROC 0x70000000 /* reserved range for processor */ ++#define SHT_HIPROC 0x7fffffff /* specific section header types */ ++#define SHT_LOUSER 0x80000000 /* reserved range for application */ ++#define SHT_HIUSER 0xffffffff /* specific indexes */ ++ ++/* Flags for sh_flags. */ ++#define SHF_WRITE 0x1 /* Section contains writable data. */ ++#define SHF_ALLOC 0x2 /* Section occupies memory. */ ++#define SHF_EXECINSTR 0x4 /* Section contains instructions. */ ++#define SHF_TLS 0x400 /* Section contains TLS data. */ ++#define SHF_MASKPROC 0xf0000000 /* Reserved for processor-specific. */ ++ ++/* Values for p_type. */ ++#define PT_NULL 0 /* Unused entry. */ ++#define PT_LOAD 1 /* Loadable segment. */ ++#define PT_DYNAMIC 2 /* Dynamic linking information segment. */ ++#define PT_INTERP 3 /* Pathname of interpreter. */ ++#define PT_NOTE 4 /* Auxiliary information. */ ++#define PT_SHLIB 5 /* Reserved (not used). */ ++#define PT_PHDR 6 /* Location of program header itself. */ ++#define PT_TLS 7 /* Thread local storage segment */ ++ ++#define PT_COUNT 8 /* Number of defined p_type values. */ ++ ++#define PT_LOOS 0x60000000 /* OS-specific */ ++#define PT_HIOS 0x6fffffff /* OS-specific */ ++#define PT_LOPROC 0x70000000 /* First processor-specific type. */ ++#define PT_HIPROC 0x7fffffff /* Last processor-specific type. */ ++ ++/* Values for p_flags. */ ++#define PF_X 0x1 /* Executable. */ ++#define PF_W 0x2 /* Writable. */ ++#define PF_R 0x4 /* Readable. */ ++ ++/* Values for d_tag. */ ++#define DT_NULL 0 /* Terminating entry. */ ++#define DT_NEEDED 1 /* String table offset of a needed shared ++ library. */ ++#define DT_PLTRELSZ 2 /* Total size in bytes of PLT relocations. */ ++#define DT_PLTGOT 3 /* Processor-dependent address. */ ++#define DT_HASH 4 /* Address of symbol hash table. */ ++#define DT_STRTAB 5 /* Address of string table. */ ++#define DT_SYMTAB 6 /* Address of symbol table. */ ++#define DT_RELA 7 /* Address of ElfNN_Rela relocations. */ ++#define DT_RELASZ 8 /* Total size of ElfNN_Rela relocations. */ ++#define DT_RELAENT 9 /* Size of each ElfNN_Rela relocation entry. */ ++#define DT_STRSZ 10 /* Size of string table. */ ++#define DT_SYMENT 11 /* Size of each symbol table entry. */ ++#define DT_INIT 12 /* Address of initialization function. */ ++#define DT_FINI 13 /* Address of finalization function. */ ++#define DT_SONAME 14 /* String table offset of shared object ++ name. */ ++#define DT_RPATH 15 /* String table offset of library path. [sup] */ ++#define DT_SYMBOLIC 16 /* Indicates "symbolic" linking. [sup] */ ++#define DT_REL 17 /* Address of ElfNN_Rel relocations. */ ++#define DT_RELSZ 18 /* Total size of ElfNN_Rel relocations. */ ++#define DT_RELENT 19 /* Size of each ElfNN_Rel relocation. */ ++#define DT_PLTREL 20 /* Type of relocation used for PLT. */ ++#define DT_DEBUG 21 /* Reserved (not used). */ ++#define DT_TEXTREL 22 /* Indicates there may be relocations in ++ non-writable segments. [sup] */ ++#define DT_JMPREL 23 /* Address of PLT relocations. */ ++#define DT_BIND_NOW 24 /* [sup] */ ++#define DT_INIT_ARRAY 25 /* Address of the array of pointers to ++ initialization functions */ ++#define DT_FINI_ARRAY 26 /* Address of the array of pointers to ++ termination functions */ ++#define DT_INIT_ARRAYSZ 27 /* Size in bytes of the array of ++ initialization functions. */ ++#define DT_FINI_ARRAYSZ 28 /* Size in bytes of the array of ++ terminationfunctions. */ ++#define DT_RUNPATH 29 /* String table offset of a null-terminated ++ library search path string. */ ++#define DT_FLAGS 30 /* Object specific flag values. */ ++#define DT_ENCODING 32 /* Values greater than or equal to DT_ENCODING ++ and less than DT_LOOS follow the rules for ++ the interpretation of the d_un union ++ as follows: even == 'd_ptr', even == 'd_val' ++ or none */ ++#define DT_PREINIT_ARRAY 32 /* Address of the array of pointers to ++ pre-initialization functions. */ ++#define DT_PREINIT_ARRAYSZ 33 /* Size in bytes of the array of ++ pre-initialization functions. */ ++ ++#define DT_COUNT 33 /* Number of defined d_tag values. */ ++ ++#define DT_LOOS 0x6000000d /* First OS-specific */ ++#define DT_HIOS 0x6fff0000 /* Last OS-specific */ ++#define DT_LOPROC 0x70000000 /* First processor-specific type. */ ++#define DT_HIPROC 0x7fffffff /* Last processor-specific type. */ ++ ++/* Values for DT_FLAGS */ ++#define DF_ORIGIN 0x0001 /* Indicates that the object being loaded may ++ make reference to the $ORIGIN substitution ++ string */ ++#define DF_SYMBOLIC 0x0002 /* Indicates "symbolic" linking. */ ++#define DF_TEXTREL 0x0004 /* Indicates there may be relocations in ++ non-writable segments. */ ++#define DF_BIND_NOW 0x0008 /* Indicates that the dynamic linker should ++ process all relocations for the object ++ containing this entry before transferring ++ control to the program. */ ++#define DF_STATIC_TLS 0x0010 /* Indicates that the shared object or ++ executable contains code using a static ++ thread-local storage scheme. */ ++ ++/* Values for n_type. Used in core files. */ ++#define NT_PRSTATUS 1 /* Process status. */ ++#define NT_FPREGSET 2 /* Floating point registers. */ ++#define NT_PRPSINFO 3 /* Process state info. */ ++ ++/* Symbol Binding - ELFNN_ST_BIND - st_info */ ++#define STB_LOCAL 0 /* Local symbol */ ++#define STB_GLOBAL 1 /* Global symbol */ ++#define STB_WEAK 2 /* like global - lower precedence */ ++#define STB_LOPROC 13 /* reserved range for processor */ ++#define STB_HIPROC 15 /* specific symbol bindings */ ++ ++/* Symbol type - ELFNN_ST_TYPE - st_info */ ++#define STT_NOTYPE 0 /* Unspecified type. */ ++#define STT_OBJECT 1 /* Data object. */ ++#define STT_FUNC 2 /* Function. */ ++#define STT_SECTION 3 /* Section. */ ++#define STT_FILE 4 /* Source file. */ ++#define STT_TLS 6 /* TLS object. */ ++#define STT_LOPROC 13 /* reserved range for processor */ ++#define STT_HIPROC 15 /* specific symbol types */ ++ ++/* Special symbol table indexes. */ ++#define STN_UNDEF 0 /* Undefined symbol index. */ ++ ++#endif /* !_SYS_ELF_COMMON_H_ */ --- freebsd-buildutils-7.1.orig/debian/patches/04_sys_endian.diff +++ freebsd-buildutils-7.1/debian/patches/04_sys_endian.diff @@ -0,0 +1,44 @@ +diff -ur src.old/usr.sbin/btxld/btxld.c src/usr.sbin/btxld/btxld.c +--- src.old/usr.sbin/btxld/btxld.c 2004-06-22 19:05:37.000000000 +0200 ++++ src/usr.sbin/btxld/btxld.c 2004-10-28 23:38:43.000000000 +0200 +@@ -30,7 +30,6 @@ + #endif /* not lint */ + + #include +-#include + #include + #include + +diff -ur src.old/usr.sbin/btxld/elfh.c src/usr.sbin/btxld/elfh.c +--- src.old/usr.sbin/btxld/elfh.c 2004-10-28 23:36:25.000000000 +0200 ++++ src/usr.sbin/btxld/elfh.c 2004-10-28 23:38:56.000000000 +0200 +@@ -27,7 +27,6 @@ + */ + + #include +-#include + + #include + #include +diff -ur src.old/usr.sbin/kgzip/elfhdr.c src/usr.sbin/kgzip/elfhdr.c +--- src.old/usr.sbin/kgzip/elfhdr.c 2004-06-22 19:05:39.000000000 +0200 ++++ src/usr.sbin/kgzip/elfhdr.c 2004-10-28 23:39:06.000000000 +0200 +@@ -26,7 +26,6 @@ + * $FreeBSD: src/usr.sbin/kgzip/elfhdr.c,v 1.4 2004/06/22 17:05:39 obrien Exp $ + */ + +-#include + #include + #include "elfhdr.h" + +diff -ur src.old/usr.sbin/kgzip/kgzld.c src/usr.sbin/kgzip/kgzld.c +--- src.old/usr.sbin/kgzip/kgzld.c 2004-06-22 19:05:39.000000000 +0200 ++++ src/usr.sbin/kgzip/kgzld.c 2004-10-28 23:39:15.000000000 +0200 +@@ -27,7 +27,6 @@ + */ + + #include +-#include + #include + + #include --- freebsd-buildutils-7.1.orig/debian/patches/03_glibc.diff +++ freebsd-buildutils-7.1/debian/patches/03_glibc.diff @@ -0,0 +1,179 @@ + + FIXME: use libbsd instead (strlcpy, strvis, strunvis ...) + +diff -ur ../foo.old/src/usr.sbin/btxld/btx.h ./src/usr.sbin/btxld/btx.h +--- ../foo.old/src/usr.sbin/btxld/btx.h 1999-08-28 03:15:41.000000000 +0200 ++++ ./src/usr.sbin/btxld/btx.h 2005-12-16 23:52:43.000000000 +0100 +@@ -30,6 +30,7 @@ + #define _BTX_H_ + + #include ++#include + + #define BTX_PGSIZE 0x1000 /* Page size */ + #define BTX_PGBASE 0x5000 /* Start of page tables */ +diff -ur ../foo.old/src/usr.sbin/btxld/elfh.c ./src/usr.sbin/btxld/elfh.c +--- ../foo.old/src/usr.sbin/btxld/elfh.c 2004-06-22 19:05:37.000000000 +0200 ++++ ./src/usr.sbin/btxld/elfh.c 2005-12-16 23:52:43.000000000 +0100 +@@ -30,6 +30,7 @@ + #include + + #include ++#include + #include "elfh.h" + + #define SET_ME 0xeeeeeeee /* filled in by btxld */ +diff -ur ../foo.old/src/usr.sbin/btxld/elfh.h ./src/usr.sbin/btxld/elfh.h +--- ../foo.old/src/usr.sbin/btxld/elfh.h 2000-01-04 15:10:36.000000000 +0100 ++++ ./src/usr.sbin/btxld/elfh.h 2005-12-16 23:52:43.000000000 +0100 +@@ -26,7 +26,7 @@ + * $FreeBSD: ./src/usr.sbin/btxld/elfh.h,v 1.3 2000/01/04 14:10:36 marcel Exp $ + */ + +-#include ++#include "elf32.h" + + struct elfh { + Elf32_Ehdr e; /* ELF header */ +diff -ur ../foo.old/src/usr.sbin/mtree/Makefile ./src/usr.sbin/mtree/Makefile +--- ../foo.old/src/usr.sbin/mtree/Makefile 2005-03-29 13:44:17.000000000 +0200 ++++ ./src/usr.sbin/mtree/Makefile 2005-12-16 23:53:50.000000000 +0100 +@@ -10,8 +10,4 @@ + + WARNS?= 4 + +-CFLAGS+= -DMD5 -DSHA1 -DRMD160 -DSHA256 +-DPADD= ${LIBMD} +-LDADD+= -lmd +- + .include +diff -ur ../foo.old/src/usr.sbin/mtree/compare.c ./src/usr.sbin/mtree/compare.c +--- ../foo.old/src/usr.sbin/mtree/compare.c 2005-12-16 23:52:51.000000000 +0100 ++++ ./src/usr.sbin/mtree/compare.c 2005-12-16 23:52:43.000000000 +0100 +@@ -59,7 +59,9 @@ + #include + #include + #include ++#ifdef __FreeBSD__ + #include ++#endif + + #include "mtree.h" + #include "extern.h" +@@ -387,6 +389,21 @@ + if ((len = readlink(name, tbuf, sizeof(tbuf) - 1)) == -1) + err(1, "line %d: %s", lineno, name); + tbuf[len] = '\0'; ++ ++#ifdef __FreeBSD__ + strvis(lbuf, tbuf, VIS_WHITE | VIS_OCTAL); ++#else ++ int i = 0, j = 0; ++ /* borrowed from src/lib/libc/gen/vis.c [rmh] */ ++ while (tbuf[j] != 0) ++ { ++ lbuf[i++] = '\\'; ++ lbuf[i++] = ((u_char) tbuf[j] >> 6 & 07) + '0'; ++ lbuf[i++] = ((u_char) tbuf[j] >> 3 & 07) + '0'; ++ lbuf[i++] = ((u_char) tbuf[j] & 07) + '0'; ++ j++; ++ } ++ lbuf[i++] = '\0'; ++#endif + return (lbuf); + } +diff -ur ../foo.old/src/usr.sbin/mtree/create.c ./src/usr.sbin/mtree/create.c +--- ../foo.old/src/usr.sbin/mtree/create.c 2005-12-16 23:52:51.000000000 +0100 ++++ ./src/usr.sbin/mtree/create.c 2005-12-16 23:52:43.000000000 +0100 +@@ -60,7 +60,6 @@ + #include + #include + #include +-#include + #include "mtree.h" + #include "extern.h" + +@@ -160,7 +159,23 @@ + escaped_name = calloc(1, p->fts_namelen * 4 + 1); + if (escaped_name == NULL) + errx(1, "statf(): calloc() failed"); +- strvis(escaped_name, p->fts_name, VIS_WHITE | VIS_OCTAL | VIS_GLOB); ++#ifdef __FreeBSD__ ++ strvis(escaped_name, p->fts_name, VIS_WHITE | VIS_OCTAL | VIS_GLOB); ++#else ++ /* borrowed from src/lib/libc/gen/vis.c ++ FIXME: this replacement was meant for VIS_WHITE | VIS_OCTAL, but ++ not VIS_GLOB. I'll have to review that. */ ++ int i = 0, j = 0; ++ while (p->fts_name[j] != 0) ++ { ++ escaped_name[i++] = '\\'; ++ escaped_name[i++] = ((u_char) p->fts_name[j] >> 6 & 07) + '0'; ++ escaped_name[i++] = ((u_char) p->fts_name[j] >> 3 & 07) + '0'; ++ escaped_name[i++] = ((u_char) p->fts_name[j] & 07) + '0'; ++ j++; ++ } ++ escaped_name[i++] = '\0'; ++#endif + + if (iflag || S_ISDIR(p->fts_statp->st_mode)) + offset = printf("%*s%s", indent, "", escaped_name); +diff -ur ../foo.old/src/usr.sbin/mtree/spec.c ./src/usr.sbin/mtree/spec.c +--- ../foo.old/src/usr.sbin/mtree/spec.c 2005-12-16 23:52:51.000000000 +0100 ++++ ./src/usr.sbin/mtree/spec.c 2005-12-16 23:52:43.000000000 +0100 +@@ -45,7 +45,6 @@ + #include + #include + #include +-#include + #include "mtree.h" + #include "extern.h" + +@@ -143,8 +142,10 @@ + #define MAGIC "?*[" + if (strpbrk(p, MAGIC)) + centry->flags |= F_MAGIC; ++#ifdef __FreeBSD__ /* this is just to detect invalid scape sequences */ + if (strunvis(centry->name, p) == -1) + errx(1, "filename %s is ill-encoded", p); ++#endif + set(NULL, centry); + + if (!root) { +@@ -228,11 +229,7 @@ + /* just set flag bit */ + break; + case F_MODE: +- if ((m = setmode(val)) == NULL) +- errx(1, "line %d: invalid file mode %s", +- lineno, val); +- ip->st_mode = getmode(m, 0); +- free(m); ++ sscanf (val, "%o", &(ip->st_mode)); + break; + case F_NLINK: + ip->st_nlink = strtoul(val, &ep, 10); +@@ -250,8 +247,10 @@ + ip->slink = malloc(strlen(val) + 1); + if (ip->slink == NULL) + errx(1, "malloc"); +- if (strunvis(ip->slink, val) == -1) +- errx(1, "symlink %s is ill-encoded", val); ++#ifdef __FreeBSD__ /* this is just to detect invalid scape sequences */ ++ if (strunvis(ip->slink, val) == -1) ++ errx(1, "symlink %s is ill-encoded", val); ++#endif + break; + #ifdef ST_MTIM + case F_TIME: +--- src/usr.sbin/mtree/specspec.c~ 2005-12-17 11:59:50.000000000 +0100 ++++ src/usr.sbin/mtree/specspec.c 2005-12-17 12:04:11.000000000 +0100 +@@ -83,8 +83,6 @@ + printf(" rmd160digest=%s", n->rmd160digest); + if (f & F_SHA256) + printf(" sha256digest=%s", n->sha256digest); +- if (f & F_FLAGS) +- printf(" flags=%s", flags_to_string(n->st_flags)); + printf("\n"); + } +