Can you please try again with 2.4.4. This includes multiples changes in example script packaging and should fix your issue.
ok boostrap recipie below (this pretty much represents what I did but with some screwups edited out). Note that the instructions below assume starting in an empty directory

wget ftp://193.224.143.39/pub/fpc/dist/2.4.4/i386-freebsd/fpc-2.4.4.i386-freebsd8.tar
tar -xf fpc-2.4.4.i386-freebsd8.tar
tar -xf binary.i386-freebsd.tar
tar -zxf base.i386-freebsd.tar.gz
tar -zxf utils.i386-freebsd.tar.gz
export PATH=$PATH:$PWD/bin
export PATH=$PATH:$PWD/lib/fpc/2.4.4
apt-get source -b fpc

-------------At this point install any missing build-dependencies -------------EXCEPT fp-compiler fp-units-base fp-units-fcl and fp-utils
cd fpc-2.4.4
-------------Apply the patch attatched to this mail to debian/rules and 
debian/moveexamples
dpkg-buildpackage -B -d
dpkg -i ../*.deb
apt-get -f install

Unfortunately it seems while the build was sucessful the binary packages are incomplete and unusable. Further research is needed into why things are breaking.
but my guess is further discrepancies in upstream install locations between
linux builds and freebsd builds.

Some notes on the patch
1: I changed the use of DEB_*_ARCH to DEB_*_ARCH_CPU, this makes it do the 
right thing for
  kfreebsd and also eliminates the need to special case armel.
2: I added a new variable $(OS_TARGET) derived from DEB_HOST_ARCH_OS. This is now used for setting FPCTARGET (which afaict is only used for generating package descriptions)
  and for the conditional below
3: to deal with some different upstream makefile behaviour on freebsd regarding
  examples I had to modify debian/moveexamples and the code that supplies it's 
parameters
  (including adding an extra parameter)
4: I noticed that the new versioned packages were restricted to a very limited 
set of arches
(not including the one I was building on) while the "compatability" packages that depend on them were arch any. This didn't make any sense to me and prevented the building of
  usable packages on kfreebsd so I changed the versioned packages to be arch 
any.

I have not yet tried a boostrap on kfreebsd-amd64. I'll try that if and when I 
get the
kfreebsd-i386 builds working.


Only in fpc-2.4.4.new/debian: README-2.4.4.Debian
diff -ur fpc-2.4.4/debian//control fpc-2.4.4.new/debian/control
--- fpc-2.4.4/debian//control	2011-05-23 10:00:39.000000000 +0100
+++ fpc-2.4.4.new/debian/control	2011-05-27 05:45:09.000000000 +0100
@@ -53,7 +53,7 @@
  the Lazarus IDE.
 
 Package: fp-compiler-2.4.4
-Architecture: i386 powerpc sparc amd64 armel
+Architecture: any
 Depends: ${misc:Depends}, fp-units-rtl-2.4.4 (= ${binary:Version}), binutils
 Recommends: fp-utils-2.4.4 (>= ${binary:Version})
 Suggests: fp-docs-2.4.4 (>= ${source:Upstream-Version})
@@ -76,7 +76,7 @@
  This package contains the command line compiler.
 
 Package: fp-ide-2.4.4
-Architecture: i386 powerpc sparc amd64 armel
+Architecture: any
 Depends: ${misc:Depends}, fp-units-rtl-2.4.4 (= ${binary:Version}), ${shlibs:Depends}
 Recommends: fp-utils-2.4.4 (>= ${binary:Version})
 Suggests: fp-docs-2.4.4 (>= ${source:Upstream-Version})
@@ -99,7 +99,7 @@
  has an internal compiler.
 
 Package: fp-utils-2.4.4
-Architecture: i386 powerpc sparc amd64 armel
+Architecture: any
 Depends: ${misc:Depends}
 Recommends: fp-compiler-2.4.4 (= ${binary:Version})
 Provides: fp-utils
@@ -144,7 +144,7 @@
  format.
 
 Package: fp-units-rtl-2.4.4
-Architecture: i386 powerpc sparc amd64 armel
+Architecture: any
 Depends: ${misc:Depends}
 Recommends: fp-compiler-2.4.4 (= ${binary:Version})
 Provides: fp-units-rtl, fpc-abi-${source:Upstream-Version}
@@ -161,7 +161,7 @@
  This package contains the Runtime Libraries for the Free Pascal Compiler.
 
 Package: fp-units-base-2.4.4
-Architecture: i386 powerpc sparc amd64 armel
+Architecture: any
 Depends: ${misc:Depends}, fp-units-rtl-2.4.4 (= ${binary:Version})
 Provides: fp-units-base
 Breaks: fp-units-base (<= 2.4.0-3)
@@ -181,7 +181,7 @@
   - ZLib
 
 Package: fp-units-fcl-2.4.4
-Architecture: i386 powerpc sparc amd64 armel
+Architecture: any
 Depends: ${misc:Depends}, fp-units-rtl-2.4.4 (= ${binary:Version}), fp-units-base-2.4.4 (= ${binary:Version})
 Provides: fp-units-fcl
 Breaks: fp-units-fcl (<= 2.4.0-3)
@@ -197,7 +197,7 @@
  This package contains the Free Component Library for the Free Pascal Compiler.
 
 Package: fp-units-fv-2.4.4
-Architecture: i386 powerpc sparc amd64 armel
+Architecture: any
 Depends: ${misc:Depends}, fp-units-rtl-2.4.4 (= ${binary:Version})
 Provides: fp-units-fv
 Breaks: fp-units-fv (<= 2.4.0-3)
@@ -213,7 +213,7 @@
  This package contains the Free Vision units for the Free Pascal Compiler.
 
 Package: fp-units-gtk-2.4.4
-Architecture: i386 powerpc sparc amd64 armel
+Architecture: any
 Depends: ${misc:Depends}, fp-units-rtl-2.4.4 (= ${binary:Version}), fp-units-fcl-2.4.4 (= ${binary:Version}), libgtk2.0-dev
 Provides: fp-units-gtk
 Breaks: fp-units-gtk (<= 2.4.0-3)
@@ -230,7 +230,7 @@
  programs with GTK+ 1.2.
 
 Package: fp-units-gtk2-2.4.4
-Architecture: i386 powerpc sparc amd64 armel
+Architecture: any
 Depends: ${misc:Depends}, fp-units-rtl-2.4.4 (= ${binary:Version}), fp-units-fcl-2.4.4 (= ${binary:Version})
 Provides: fp-units-gtk2
 Breaks: fp-units-gtk2 (<= 2.4.0-3)
@@ -247,7 +247,7 @@
  programs with GTK+ 2.x.
 
 Package: fp-units-gnome1-2.4.4
-Architecture: i386 powerpc sparc amd64 armel
+Architecture: any
 Depends: ${misc:Depends}, fp-units-rtl-2.4.4 (= ${binary:Version}), fp-units-gtk-2.4.4 (= ${binary:Version})
 Provides: fp-units-gnome1
 Breaks: fp-units-gnome1 (<= 2.4.0-3)
@@ -264,7 +264,7 @@
  programs for GNOME 1.
 
 Package: fp-units-db-2.4.4
-Architecture: i386 powerpc sparc amd64 armel
+Architecture: any
 Depends: ${misc:Depends}, fp-units-rtl-2.4.4 (= ${binary:Version})
 Provides: fp-units-db
 Breaks: fp-units-db (<= 2.4.0-3)
@@ -287,7 +287,7 @@
   - SQLite
 
 Package: fp-units-gfx-2.4.4
-Architecture: i386 powerpc sparc amd64 armel
+Architecture: any
 Depends: ${misc:Depends}, fp-units-rtl-2.4.4 (= ${binary:Version}), fp-units-base-2.4.4 (= ${binary:Version}), libsvga1-dev [i386 amd64 armel]
 Provides: fp-units-gfx
 Breaks: fp-units-gfx (<= 2.4.0-3)
@@ -312,7 +312,7 @@
   - cairo
 
 Package: fp-units-net-2.4.4
-Architecture: i386 powerpc sparc amd64 armel
+Architecture: any
 Depends: ${misc:Depends}, fp-units-rtl-2.4.4 (= ${binary:Version})
 Provides: fp-units-net
 Breaks: fp-units-net (<= 2.4.0-3)
@@ -338,7 +338,7 @@
   - pcap
 
 Package: fp-units-math-2.4.4
-Architecture: i386 powerpc sparc amd64 armel
+Architecture: any
 Depends: ${misc:Depends}, fp-units-rtl-2.4.4 (= ${binary:Version})
 Provides: fp-units-math
 Breaks: fp-units-math (<= 2.4.0-3)
@@ -358,7 +358,7 @@
   - symbolic : symbolic computing
 
 Package: fp-units-misc-2.4.4
-Architecture: i386 powerpc sparc amd64 armel
+Architecture: any
 Depends: ${misc:Depends}, fp-units-rtl-2.4.4 (= ${binary:Version})
 Provides: fp-units-misc
 Breaks: fp-units-misc (<= 2.4.0-3)
@@ -377,7 +377,7 @@
   - PasZLib (Pascal-only zlib implementation)
 
 Package: fp-units-multimedia-2.4.4
-Architecture: i386 powerpc sparc amd64 armel
+Architecture: any
 Depends: ${misc:Depends}, fp-units-rtl-2.4.4 (= ${binary:Version}), libogg-dev, libvorbis-dev, a52dec-dev, libdts-dev, libmad0-dev, libmodplug-dev
 Provides: fp-units-multimedia
 Breaks: fp-units-multimedia (<= 2.4.0-3)
Only in fpc-2.4.4.new/debian: copyright
Only in fpc-2.4.4.new/debian: files
Only in fpc-2.4.4.new/debian: fp-compiler
Only in fpc-2.4.4.new/debian: fp-compiler-2.4.4
Only in fpc-2.4.4.new/debian: fp-compiler-2.4.4.config
Only in fpc-2.4.4.new/debian: fp-compiler-2.4.4.debhelper.log
Only in fpc-2.4.4.new/debian: fp-compiler-2.4.4.doc-base
Only in fpc-2.4.4.new/debian: fp-compiler-2.4.4.install
Only in fpc-2.4.4.new/debian: fp-compiler-2.4.4.links
Only in fpc-2.4.4.new/debian: fp-compiler-2.4.4.manpages
Only in fpc-2.4.4.new/debian: fp-compiler-2.4.4.postinst
Only in fpc-2.4.4.new/debian: fp-compiler-2.4.4.postrm
Only in fpc-2.4.4.new/debian: fp-compiler-2.4.4.postrm.debhelper
Only in fpc-2.4.4.new/debian: fp-compiler-2.4.4.preinst
Only in fpc-2.4.4.new/debian: fp-compiler-2.4.4.prerm
Only in fpc-2.4.4.new/debian: fp-compiler-2.4.4.substvars
Only in fpc-2.4.4.new/debian: fp-compiler-2.4.4.templates
Only in fpc-2.4.4.new/debian: fp-compiler.debhelper.log
Only in fpc-2.4.4.new/debian: fp-compiler.substvars
Only in fpc-2.4.4.new/debian: fp-docs
Only in fpc-2.4.4.new/debian: fp-docs-2.4.4
Only in fpc-2.4.4.new/debian: fp-docs-2.4.4.debhelper.log
Only in fpc-2.4.4.new/debian: fp-docs-2.4.4.doc-base
Only in fpc-2.4.4.new/debian: fp-docs-2.4.4.install
Only in fpc-2.4.4.new/debian: fp-docs.debhelper.log
Only in fpc-2.4.4.new/debian: fp-ide
Only in fpc-2.4.4.new/debian: fp-ide-2.4.4
Only in fpc-2.4.4.new/debian: fp-ide-2.4.4.debhelper.log
Only in fpc-2.4.4.new/debian: fp-ide-2.4.4.install
Only in fpc-2.4.4.new/debian: fp-ide-2.4.4.manpages
Only in fpc-2.4.4.new/debian: fp-ide-2.4.4.substvars
Only in fpc-2.4.4.new/debian: fp-ide.debhelper.log
Only in fpc-2.4.4.new/debian: fp-ide.substvars
Only in fpc-2.4.4.new/debian: fp-units-base
Only in fpc-2.4.4.new/debian: fp-units-base-2.4.4
Only in fpc-2.4.4.new/debian: fp-units-base-2.4.4.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-base-2.4.4.install
Only in fpc-2.4.4.new/debian: fp-units-base-2.4.4.substvars
Only in fpc-2.4.4.new/debian: fp-units-base.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-base.substvars
Only in fpc-2.4.4.new/debian: fp-units-db
Only in fpc-2.4.4.new/debian: fp-units-db-2.4.4
Only in fpc-2.4.4.new/debian: fp-units-db-2.4.4.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-db-2.4.4.install
Only in fpc-2.4.4.new/debian: fp-units-db-2.4.4.substvars
Only in fpc-2.4.4.new/debian: fp-units-db.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-db.substvars
Only in fpc-2.4.4.new/debian: fp-units-fcl
Only in fpc-2.4.4.new/debian: fp-units-fcl-2.4.4
Only in fpc-2.4.4.new/debian: fp-units-fcl-2.4.4.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-fcl-2.4.4.install
Only in fpc-2.4.4.new/debian: fp-units-fcl-2.4.4.substvars
Only in fpc-2.4.4.new/debian: fp-units-fcl.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-fcl.substvars
Only in fpc-2.4.4.new/debian: fp-units-fv
Only in fpc-2.4.4.new/debian: fp-units-fv-2.4.4
Only in fpc-2.4.4.new/debian: fp-units-fv-2.4.4.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-fv-2.4.4.install
Only in fpc-2.4.4.new/debian: fp-units-fv-2.4.4.substvars
Only in fpc-2.4.4.new/debian: fp-units-fv.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-fv.substvars
Only in fpc-2.4.4.new/debian: fp-units-gfx
Only in fpc-2.4.4.new/debian: fp-units-gfx-2.4.4
Only in fpc-2.4.4.new/debian: fp-units-gfx-2.4.4.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-gfx-2.4.4.install
Only in fpc-2.4.4.new/debian: fp-units-gfx-2.4.4.substvars
Only in fpc-2.4.4.new/debian: fp-units-gfx.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-gfx.substvars
Only in fpc-2.4.4.new/debian: fp-units-gnome1
Only in fpc-2.4.4.new/debian: fp-units-gnome1-2.4.4
Only in fpc-2.4.4.new/debian: fp-units-gnome1-2.4.4.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-gnome1-2.4.4.install
Only in fpc-2.4.4.new/debian: fp-units-gnome1-2.4.4.substvars
Only in fpc-2.4.4.new/debian: fp-units-gnome1.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-gnome1.substvars
Only in fpc-2.4.4.new/debian: fp-units-gtk
Only in fpc-2.4.4.new/debian: fp-units-gtk-2.4.4
Only in fpc-2.4.4.new/debian: fp-units-gtk-2.4.4.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-gtk-2.4.4.install
Only in fpc-2.4.4.new/debian: fp-units-gtk-2.4.4.substvars
Only in fpc-2.4.4.new/debian: fp-units-gtk.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-gtk.substvars
Only in fpc-2.4.4.new/debian: fp-units-gtk2
Only in fpc-2.4.4.new/debian: fp-units-gtk2-2.4.4
Only in fpc-2.4.4.new/debian: fp-units-gtk2-2.4.4.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-gtk2-2.4.4.install
Only in fpc-2.4.4.new/debian: fp-units-gtk2-2.4.4.substvars
Only in fpc-2.4.4.new/debian: fp-units-gtk2.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-gtk2.substvars
Only in fpc-2.4.4.new/debian: fp-units-i386-2.4.4.install
Only in fpc-2.4.4.new/debian: fp-units-math
Only in fpc-2.4.4.new/debian: fp-units-math-2.4.4
Only in fpc-2.4.4.new/debian: fp-units-math-2.4.4.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-math-2.4.4.install
Only in fpc-2.4.4.new/debian: fp-units-math-2.4.4.substvars
Only in fpc-2.4.4.new/debian: fp-units-math.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-math.substvars
Only in fpc-2.4.4.new/debian: fp-units-misc
Only in fpc-2.4.4.new/debian: fp-units-misc-2.4.4
Only in fpc-2.4.4.new/debian: fp-units-misc-2.4.4.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-misc-2.4.4.install
Only in fpc-2.4.4.new/debian: fp-units-misc-2.4.4.substvars
Only in fpc-2.4.4.new/debian: fp-units-misc.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-misc.substvars
Only in fpc-2.4.4.new/debian: fp-units-multimedia
Only in fpc-2.4.4.new/debian: fp-units-multimedia-2.4.4
Only in fpc-2.4.4.new/debian: fp-units-multimedia-2.4.4.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-multimedia-2.4.4.install
Only in fpc-2.4.4.new/debian: fp-units-multimedia-2.4.4.substvars
Only in fpc-2.4.4.new/debian: fp-units-multimedia.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-multimedia.substvars
Only in fpc-2.4.4.new/debian: fp-units-net
Only in fpc-2.4.4.new/debian: fp-units-net-2.4.4
Only in fpc-2.4.4.new/debian: fp-units-net-2.4.4.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-net-2.4.4.install
Only in fpc-2.4.4.new/debian: fp-units-net-2.4.4.substvars
Only in fpc-2.4.4.new/debian: fp-units-net.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-net.substvars
Only in fpc-2.4.4.new/debian: fp-units-rtl
Only in fpc-2.4.4.new/debian: fp-units-rtl-2.4.4
Only in fpc-2.4.4.new/debian: fp-units-rtl-2.4.4.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-rtl-2.4.4.install
Only in fpc-2.4.4.new/debian: fp-units-rtl-2.4.4.substvars
Only in fpc-2.4.4.new/debian: fp-units-rtl.debhelper.log
Only in fpc-2.4.4.new/debian: fp-units-rtl.substvars
Only in fpc-2.4.4.new/debian: fp-utils
Only in fpc-2.4.4.new/debian: fp-utils-2.4.4
Only in fpc-2.4.4.new/debian: fp-utils-2.4.4.debhelper.log
Only in fpc-2.4.4.new/debian: fp-utils-2.4.4.install
Only in fpc-2.4.4.new/debian: fp-utils-2.4.4.manpages
Only in fpc-2.4.4.new/debian: fp-utils-2.4.4.postinst
Only in fpc-2.4.4.new/debian: fp-utils-2.4.4.postrm
Only in fpc-2.4.4.new/debian: fp-utils-2.4.4.substvars
Only in fpc-2.4.4.new/debian: fp-utils.debhelper.log
Only in fpc-2.4.4.new/debian: fp-utils.substvars
Only in fpc-2.4.4.new/debian: fpc
Only in fpc-2.4.4.new/debian: fpc-2.4.4
Only in fpc-2.4.4.new/debian: fpc-2.4.4.debhelper.log
Only in fpc-2.4.4.new/debian: fpc-depends
Only in fpc-2.4.4.new/debian: fpc-depends-2.4.4.1
Only in fpc-2.4.4.new/debian: fpc-source
Only in fpc-2.4.4.new/debian: fpc-source-2.4.4
Only in fpc-2.4.4.new/debian: fpc-source-2.4.4.debhelper.log
Only in fpc-2.4.4.new/debian: fpc-source-2.4.4.install
Only in fpc-2.4.4.new/debian: fpc-source.debhelper.log
Only in fpc-2.4.4.new/debian: fpc.debhelper.log
diff -ur fpc-2.4.4/debian//moveexamples fpc-2.4.4.new/debian/moveexamples
--- fpc-2.4.4/debian//moveexamples	2010-11-15 21:50:06.000000000 +0000
+++ fpc-2.4.4.new/debian/moveexamples	2011-05-27 04:41:41.000000000 +0100
@@ -5,6 +5,7 @@
 EXAMPLE_TEMP=$1
 DOC_DIR=$2
 VERSION=$3
+EXAMPLE_TEMP_SUFFIX=$4
 
 function move_examples()
 {
@@ -13,9 +14,9 @@
 
     for package in $2
     do
-        if [ -d $EXAMPLE_TEMP/$package/examples ]; then
+        if [ -d $EXAMPLE_TEMP/$package$EXAMPLE_TEMP_SUFFIX ]; then
             echo "Moving examples of $package"
-            EXAMPLE_TEMP_DIR="$EXAMPLE_TEMP/$package/examples"
+            EXAMPLE_TEMP_DIR="$EXAMPLE_TEMP/$package$EXAMPLE_TEMP_SUFFIX"
             EXAMPLE_INSTALL_DIR="$DOC_DIR/$1/${VERSION}/examples/$package"
             # Move dir renaming it
             if [ -e "${EXAMPLE_INSTALL_DIR}" ]
@@ -24,10 +25,17 @@
                 exit 255
             else
                 mv -v -f "${EXAMPLE_TEMP_DIR}" "${EXAMPLE_INSTALL_DIR}"
-                rmdir $EXAMPLE_TEMP/$package
+                #on kfreebsd $EXAMPLE_TEMP_SUFFIX is an empty string so
+                #$EXAMPLE_TEMP/$package will already be gone at this point
+                if [ -e "$EXAMPLE_TEMP/$package" ]
+                then 
+                    rmdir $EXAMPLE_TEMP/$package
+                fi
                 # Remove empty directories:
                 rmdir --ignore-fail-on-non-empty "${EXAMPLE_INSTALL_DIR}"
             fi
+        else
+            echo $EXAMPLE_TEMP/$package/examples$EXAMPLE_TEMP/$package$EXAMPLE_TEMP_SUFFIX does not exist
         fi
     done
 
diff -ur fpc-2.4.4/debian//rules fpc-2.4.4.new/debian/rules
--- fpc-2.4.4/debian//rules	2011-05-23 22:03:37.000000000 +0100
+++ fpc-2.4.4.new/debian/rules	2011-05-27 04:22:16.000000000 +0100
@@ -19,12 +19,8 @@
 unexport FPC
 
 # Detect name of new compiler, take care that debian uses amd64 instead of x86_64
-CPU_SOURCE := $(subst amd64,x86_64,$(shell dpkg-architecture -qDEB_BUILD_ARCH))
-CPU_TARGET := $(subst amd64,x86_64,$(shell dpkg-architecture -qDEB_HOST_ARCH))
-
-# Fixup armel, too
-CPU_SOURCE := $(subst armel,arm,$(CPU_SOURCE))
-CPU_TARGET := $(subst armel,arm,$(CPU_TARGET))
+CPU_SOURCE := $(subst amd64,x86_64,$(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU))
+CPU_TARGET := $(subst amd64,x86_64,$(shell dpkg-architecture -qDEB_HOST_ARCH_CPU))
 
 ifeq ($(CPU_TARGET),m68k)
 PPSUF=68k
@@ -56,7 +52,9 @@
 
 PPNEW=$(PPPRE)$(PPSUF)
 
-FPCTARGET=$(CPU_TARGET)-linux
+OS_TARGET=$(subst kfreebsd,freebsd,$(shell dpkg-architecture -qDEB_HOST_ARCH_OS))
+
+FPCTARGET=$(CPU_TARGET)-$(OS_TARGET)
 # Get version information from changelog file
 DEB_VERSION:=$(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
 DEB_UPSTREAM_VERSION:=$(shell echo $(DEB_VERSION) | cut -f 1 -d -)
@@ -73,7 +71,16 @@
 LIB_DIR=${INSTALL_DIR}/usr/lib/${DEB_PACKAGE_NAME}/${DEB_UPSTREAM_MAIN_VERSION}
 DOC_DIR=${INSTALL_DIR}/usr/share/doc
 SRC_DIR=${INSTALL_DIR}/usr/share/fpcsrc/${DEB_UPSTREAM_MAIN_VERSION}
+
+#the upstream makefiles seem to install the examples in a different place on freebsd
+ifeq ($(OS_TARGET),freebsd)
+EXAMPLE_TEMP=${INSTALL_DIR}/usr/share/examples/fpc-${DEB_UPSTREAM_MAIN_VERSION}
+EXAMPLE_TEMP_SUFFIX=
+else
 EXAMPLE_TEMP=${INSTALL_DIR}/usr/share/doc/fpc-${DEB_UPSTREAM_MAIN_VERSION}
+EXAMPLE_TEMP_SUFFIX=/examples
+endif
+
 # Get utils
 ifndef MKDIR
 MKDIR=mkdir -p
@@ -198,7 +205,7 @@
 	${MV} -t ${LIB_DIR} ${INSTALL_DIR}/usr/lib/fpc/lexyacc
 	${CP} -t  ${BIN_DIR} debian/fpc-depends
 	# Copy examples to the correct doc dir
-	/bin/bash debian/moveexamples ${EXAMPLE_TEMP} ${DOC_DIR} ${DEB_UPSTREAM_MAIN_VERSION}
+	/bin/bash debian/moveexamples ${EXAMPLE_TEMP} ${DOC_DIR} ${DEB_UPSTREAM_MAIN_VERSION} ${EXAMPLE_TEMP_SUFFIX}
 	# Rename executables
 	for f in  ${BIN_DIR}/* ; do ${MV} $$f $${f}-${DEB_UPSTREAM_MAIN_VERSION} ; done
 	# Install configuration files
Only in fpc-2.4.4.new/debian: tmp

Reply via email to