summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-freebsd/freebsd-cddl
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-freebsd/freebsd-cddl')
-rw-r--r--sys-freebsd/freebsd-cddl/Manifest15
-rw-r--r--sys-freebsd/freebsd-cddl/files/freebsd-cddl-10.1-underlink.patch27
-rw-r--r--sys-freebsd/freebsd-cddl/files/freebsd-cddl-8.0-libpaths.patch114
-rw-r--r--sys-freebsd/freebsd-cddl/files/freebsd-cddl-8.2-libpaths.patch22
-rw-r--r--sys-freebsd/freebsd-cddl/files/freebsd-cddl-9.0-bsdxml.patch28
-rw-r--r--sys-freebsd/freebsd-cddl/files/freebsd-cddl-9.0-libpaths.patch167
-rw-r--r--sys-freebsd/freebsd-cddl/files/freebsd-cddl-9.0-underlink.patch22
-rw-r--r--sys-freebsd/freebsd-cddl/files/freebsd-cddl-9.2-libpaths.patch220
-rw-r--r--sys-freebsd/freebsd-cddl/files/zfs.initd24
-rwxr-xr-xsys-freebsd/freebsd-cddl/files/zvol.initd47
-rwxr-xr-xsys-freebsd/freebsd-cddl/files/zvol.initd-9.045
-rw-r--r--sys-freebsd/freebsd-cddl/freebsd-cddl-10.1.ebuild66
-rw-r--r--sys-freebsd/freebsd-cddl/freebsd-cddl-8.2.ebuild48
-rw-r--r--sys-freebsd/freebsd-cddl/freebsd-cddl-9.1.ebuild61
-rw-r--r--sys-freebsd/freebsd-cddl/metadata.xml5
15 files changed, 911 insertions, 0 deletions
diff --git a/sys-freebsd/freebsd-cddl/Manifest b/sys-freebsd/freebsd-cddl/Manifest
new file mode 100644
index 000000000000..ec253b69ae3a
--- /dev/null
+++ b/sys-freebsd/freebsd-cddl/Manifest
@@ -0,0 +1,15 @@
+DIST freebsd-cddl-8.2.tar.bz2 823706 SHA256 6d2b2362ce60538bcba4afa47bd6baa98b05292babae4b20d6ba08592ce98698 SHA512 9f9728d9bf0f9fb320a0378186b29133e5e9276494f57ac3cffa9917ec94d3b886708406990107f2fbf742c255f9ac716f35ea14f6a6a835712eb55581421721 WHIRLPOOL 0150d972fc5200efcf22b5baded0bc7d826f03420a8328bc9ce1f53f39d1f3cd07dc367fcb3b0c8bdcc3b33bc9045f262928d76532c91820fd3c6bc8c9ee57c9
+DIST freebsd-cddl-9.1.tar.bz2 899348 SHA256 bcc79fb002052128e9e91b16beb3083ee152be0936494715c6c159bfc8d2ca3a SHA512 ae0a969e710785bbcf36a2ec22cc5b1dcdb25398be951e047a1237d0c977e38fc9e05504db51f8bf9ed83bc1f68b04fc88ce18fc48a93f785b8a3f8ef481bacd WHIRLPOOL 2c4a5baf162dbb698af45b9262f104e27c05e6a2630c3e7b1765e76c8987a330c315f741df69c8771d2509708d2934db2a07f2e0218aa59d0100dfc3f952bf72
+DIST freebsd-contrib-8.2.tar.bz2 40931651 SHA256 8b9cb688e81c2980b3fc66411d00ab277a24dadd50d5bdd5e0e6c63ac687b9b6 SHA512 4f7bf825b579fbb88f2aac531d07e531474179c63fa0b66c4e80821290a8c94bf611bb4dcaef51b762aacd25b11dfae798a4ec3bad3b9e3f6b3490ebfaa72476 WHIRLPOOL edd3d9e26e8d22d9028082e107ec1a44402e206dab8722f34b445676959305996c3f699152af42ace249b7f58498492787823b172fb6bcb273119c6bb50a35f0
+DIST freebsd-contrib-9.1.tar.bz2 54751432 SHA256 e7ffa056d4050ce03ee8e23e276e2a9a494326a98d60c43bee2afcc59576deb8 SHA512 71be13049258c6e6b5e4f63cc16da5d349a89d68f04d87446e4ad33ae8bf2a93ea67d9c256b7bec60b61e65db0487268070cfb77a484c3ac0f8ba368b48c2438 WHIRLPOOL a2a84423175499208d34809e802284d6ba649f317c3a9ad8b7312fa19efe142ebadab0048bac0db8e988e59f9a7468ac7c5d0d25e78b82bdb269a20d18153cee
+DIST freebsd-include-8.2.tar.bz2 138992 SHA256 fade90621a8e4880c9583c1ee49965400c88e53ac6c07cb5dcf320e4f069271d SHA512 6bc820dde866589ef75f9f0d1c469d815439bdd4c79f0e1a2482ec58f938b638cb9106969b321aa72492f933c95c76895ce489727a5e265798c93adc75dd64e3 WHIRLPOOL 64d3160c4ac46a62f5969058e07bd160c92284f08805ed917f2073ba1cb5907cfca16c5893daf30254d39b4fcdf641ab6afb9817607f65e7789d3049e8103947
+DIST freebsd-include-9.1.tar.bz2 146881 SHA256 861dce3f39e6806762b102361017cbe148f0e2b768b3fca152f8426f44a2942f SHA512 779c8315ce2b10b343bb62e331525d510b0d68ce5d665a1672bd6f4d1eff6445bc6b7a0f178b319828aa203c4e4c04c561ce793052703f4f936ce9711280a0c9 WHIRLPOOL e16ba45d380591ba007ca59579d45f61ffc1aa1a4c08fc11ed2794979b0a189a346c81b4f70a44ee199d50a72024930f28587ad62a9cd6854fc937eb466ec115
+DIST freebsd-lib-8.2.tar.bz2 3323878 SHA256 e3590c12794fcb5ba8eb7a1f58b497587cf19f9200b3254c194a793da3b5bfb0 SHA512 c059cfdd1099bb519b2a5c43fb7e7104c500ef8906229ed7eb9e420cb3a217cdaf8655e9e7a9f45cfadc5491f8115e0e738fd49251d9f0c3a83780845b09f007 WHIRLPOOL 95f98a372f44a89bc8ac3029ec065dbbfec338e6f889d057d75644bfcdfb9d27fdc0421d7e392cad5a823712b97f0857297ec3d321580254c63032c22b95792e
+DIST freebsd-lib-9.1.tar.bz2 3206685 SHA256 f31fa8107b4de711c548f6d0c1bb1f81d09f51bcc3b14a1e9e90bb0e7cc4a35d SHA512 40d0c36b6b889c404fa0e0afa38ba4e84a55bc88ffa2f98a70afbd7a32c4f32c158617ba770567d082a986d62c09b3ec8db3dc5ab853ee1c9bbe0b90bb82396e WHIRLPOOL 581878bf9c43184b043b4293409b85901c9ed1f9bd279e965414aca41ba50950848ebda3ee10a503a028135dfd2765e95a11acd4e62a11c528e104392bbbd8d0
+DIST freebsd-sbin-8.2.tar.bz2 1211665 SHA256 8b7e21a66b4696e8763d29b8b02b2d35f29fc51820a194d1e469e7cace84c527 SHA512 c6643c29ab62344c98d8991708798730ee1c17e6478071718beeaa79788300a1f4ed2e6aeb8e39e3c216877d4ed2ac85b2a9531d534f1ac5125a508927898959 WHIRLPOOL 2a21cd0f15f95d66718031680ac87f1fe73f1e1b03cb012e1db1dd1bd2fe2bb7897457a8ba2f5a28c8806775611dca542cbadec16566c47ab9efa673e2cb53f3
+DIST freebsd-sbin-9.1.tar.bz2 1273913 SHA256 45008b0733b232ef03707ef5fa3e5c889e3b3728393d736bd9a869ea83be6447 SHA512 9f186602b7de96f268c352ca386986652fddf5570e7eca1afa8c0d2bdc83b57df1198efe47f36dd5c7a6abf4f9c935f1c8207a4a12a6b2153bd6c3c6292719dc WHIRLPOOL 20920dfa9607a0ce854319cef29bbd77fb1b31f6f6cfd5ac60cbd678169e43929e215743fe636d0c224443f3e6149a8f07c292d647f7f901592795ac292699f9
+DIST freebsd-src-10.1.tar.xz 115049476 SHA256 f919287a5ef51d4f133f27c99c54f2e8054f408d3dd53bc60f4e233cc75ec03d SHA512 4ded32b451e2807e24a06305502f88ea633b2899a7ccd9cab3dc98fc865ef91324c93c512a08cf6e295313a8d7e79aa9d7af07da40e7276d986b06419b984152 WHIRLPOOL 1eff9419d89b8a70f064171883d92e160b250cd637972eb9107a19d7b3c904b554c4f51eaa9ff9642ef2c4234bde05cf9aef16d0c39280b55084f831700dea80
+DIST freebsd-sys-8.2.tar.bz2 25835329 SHA256 0c6c7b61aae94db2931f985d5899f3bca78fc8ffab6b598fbaa158142d676f16 SHA512 6ea4516a5c52e25c4f993f7acb875463a5caea93dbdf250c5d48eee95fff226956e9f030cab7e341b5e6a132325bc3dbf93dcb4b1185acb011918e50b1a22be3 WHIRLPOOL 870deeff877c6b9fc812a4260e4fdbb6715a5dc2065cab3bfbf2a42d876f6654703ccb124275a4e2c410cef48f3db02b63cc76059eccf9cf90244826f35b7a15
+DIST freebsd-sys-9.1.tar.bz2 32588103 SHA256 b93a7ac8334ac16cc9f60665048e5ef812c0a6c62f10d0b0a674aec3f56516a8 SHA512 7dc9d9e00dde8f592bb171f4386d02b655b73cb4f153fe5ec063d010a148ef0639eae0dcdb3eeb09ecd1e3653c69e49a2d261329fa6d0381d2ddabe258ddde6d WHIRLPOOL c8348344dfb14bad64bd3a78ee615ddd29203175b292233254f8ba175e7a3fb7218af6f95f7b4dbf394c0354bafe9d8bb0c21cdf0ceaeb697214964b280469b3
+DIST freebsd-ubin-8.2.tar.bz2 1808012 SHA256 6b99554f3ad6ee052069b347eb6e6219b71598d7b222acb90a24cbfc805c7b68 SHA512 48d0103323e820c431aa4f62d3be40cb3b200fb62e3de01f36c88760395bf2ba3367c51f3fa72da4dbccc2812176a051a12ca5cb7e84125c3e0fc78d4cab2c29 WHIRLPOOL ea8f3a29a37b42c2b5bcc0f2c343fa1538522157ef075363c94606a4620a590e9a03f856ce2494e3e727935b62431991d0aa9fde71de699e78b4fe225bdf1c2c
+DIST freebsd-ubin-9.1.tar.bz2 1910472 SHA256 ff6e586f213534b6ec2e65002c0dee64063d76ddad515c12221b1a80a1815e48 SHA512 74ae0aceec8597aa66c3f1ab313f0685a3c63d7273c36ae7baf8794275ad9bca241c60c3f6281cccf6d531d250d7611099977d3b1a27279cef3586401b6af05e WHIRLPOOL c85a3c9cf2bceff2c60ff03556bcc81d3aca22b0bce3c9538990071ac0a907236eee5ae7743ad22c5fd309b047ebf392aaaf2fe177ef5790ea869aff3da7e2fe
diff --git a/sys-freebsd/freebsd-cddl/files/freebsd-cddl-10.1-underlink.patch b/sys-freebsd/freebsd-cddl/files/freebsd-cddl-10.1-underlink.patch
new file mode 100644
index 000000000000..62d53267acdc
--- /dev/null
+++ b/sys-freebsd/freebsd-cddl/files/freebsd-cddl-10.1-underlink.patch
@@ -0,0 +1,27 @@
+diff --git a/cddl/lib/libzfs/Makefile b/cddl/lib/libzfs/Makefile
+index cc0f363..065281f 100644
+--- a/cddl/lib/libzfs/Makefile
++++ b/cddl/lib/libzfs/Makefile
+@@ -8,7 +8,8 @@
+ LIB= zfs
+ DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBUMEM} ${LIBUTIL} ${LIBM} ${LIBNVPAIR} \
+ ${LIBAVL} ${LIBZFS_CORE}
+-LDADD= -lmd -lpthread -lumem -lutil -lm -lnvpair -lavl -lzfs_core
++LDADD= -lmd -lpthread -lumem -lutil -lm -lnvpair -lavl -lzfs_core -lgeom -luutil
++LDFLAGS+= -L${.CURDIR}/../../lib/libavl
+
+ SRCS= deviceid.c \
+ fsshare.c \
+diff --git a/cddl/lib/libzpool/Makefile b/cddl/lib/libzpool/Makefile
+index 61c4788..4888cc7 100644
+--- a/cddl/lib/libzpool/Makefile
++++ b/cddl/lib/libzpool/Makefile
+@@ -61,7 +61,7 @@ LDFLAGS+= -L${.CURDIR}/../../lib/libnvpair
+ LDFLAGS+= -L${.CURDIR}/../../lib/libumem
+
+ DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBZ}
+-LDADD= -lmd -lpthread -lz
++LDADD= -lmd -lpthread -lz -lumem -lavl
+
+ # atomic.S doesn't like profiling.
+ NO_PROFILE=
diff --git a/sys-freebsd/freebsd-cddl/files/freebsd-cddl-8.0-libpaths.patch b/sys-freebsd/freebsd-cddl/files/freebsd-cddl-8.0-libpaths.patch
new file mode 100644
index 000000000000..ad5c83eca3de
--- /dev/null
+++ b/sys-freebsd/freebsd-cddl/files/freebsd-cddl-8.0-libpaths.patch
@@ -0,0 +1,114 @@
+diff -ru cddl.orig/lib/libctf/Makefile cddl/lib/libctf/Makefile
+--- cddl.orig/lib/libctf/Makefile 2009-01-24 03:36:33 -0200
++++ cddl/lib/libctf/Makefile 2009-01-24 03:55:10 -0200
+@@ -4,6 +4,7 @@
+
+ LIB= ctf
+ SHLIB_MAJOR= 2
++LDADD+=-lz
+
+ SRCS= ctf_create.c \
+ ctf_decl.c \
+diff -ru cddl.orig/lib/libdtrace/Makefile cddl/lib/libdtrace/Makefile
+--- cddl.orig/lib/libdtrace/Makefile 2009-01-24 00:18:47 -0200
++++ cddl/lib/libdtrace/Makefile 2009-01-24 03:31:06 -0200
+@@ -74,7 +74,7 @@
+ .endif
+
+ LFLAGS+=-l
+-
++LDADD+=-lz -lproc
+ YFLAGS+=-d
+
+ CLEANFILES= dt_errtags.c dt_names.c
+diff -ru cddl.orig/lib/libzfs/Makefile cddl/lib/libzfs/Makefile
+--- cddl.orig/lib/libzfs/Makefile 2008-06-22 10:26:18 -0300
++++ cddl/lib/libzfs/Makefile 2008-06-22 10:26:26 -0300
+@@ -7,7 +7,8 @@
+
+ LIB= zfs
+ DPADD= ${LIBUTIL}
+-LDADD= -lutil
++LDADD= -lutil -lgeom -lm -luutil -lumem
++LDFLAGS+= -L${.CURDIR}/../libuutil -L${.CURDIR}/../libumem
+
+ SRCS= deviceid.c \
+ mnttab.c \
+diff -ru cddl.orig/lib/libzpool/Makefile cddl/lib/libzpool/Makefile
+--- cddl.orig/lib/libzpool/Makefile 2008-06-22 10:35:15 -0300
++++ cddl/lib/libzpool/Makefile 2008-06-22 10:37:06 -0300
+@@ -42,7 +42,8 @@
+ CFLAGS+= -I${.CURDIR}/../../../contrib/opensolaris/lib/libnvpair
+
+ DPADD= ${LIBPTHREAD} ${LIBZ}
+-LDADD= -lpthread -lz
++LDADD= -lpthread -lz -lavl -lumem
++LDFLAGS+= -L${.CURDIR}/../libavl -L${.CURDIR}/../libumem
+
+ # atomic.S doesn't like profiling.
+ NO_PROFILE=
+diff -ru cddl.orig/sbin/zfs/Makefile cddl/sbin/zfs/Makefile
+--- cddl.orig/sbin/zfs/Makefile 2008-06-22 10:02:30 -0300
++++ cddl/sbin/zfs/Makefile 2008-06-22 10:14:23 -0300
+@@ -23,5 +23,7 @@
+ ${LIBM} ${LIBNVPAIR} ${LIBUUTIL} ${LIBUTIL}
+ LDADD= -lzfs -lgeom -lbsdxml -lsbuf \
+ -lm -lnvpair -luutil -lutil
++LDFLAGS+=-L${.CURDIR}/../../lib/libzfs -L${.CURDIR}/../../lib/libnvpair \
++ -L${.CURDIR}/../../lib/libuutil -L/lib -L/usr/lib
+
+ .include <bsd.prog.mk>
+diff -ru cddl.orig/sbin/zpool/Makefile cddl/sbin/zpool/Makefile
+--- cddl.orig/sbin/zpool/Makefile 2008-06-22 10:02:30 -0300
++++ cddl/sbin/zpool/Makefile 2008-06-22 10:14:47 -0300
+@@ -23,5 +23,7 @@
+ ${LIBM} ${LIBNVPAIR} ${LIBUUTIL} ${LIBUTIL}
+ LDADD= -lavl -lzfs -lgeom -lbsdxml -lsbuf \
+ -lm -lnvpair -luutil -lutil
++LDFLAGS+=-L${.CURDIR}/../../lib/libzfs -L${.CURDIR}/../../lib/libavl -L/lib -L/usr/lib \
++ -L${.CURDIR}/../../lib/libnvpair -L${.CURDIR}/../../lib/libuutil
+
+ .include <bsd.prog.mk>
+diff -ru cddl.orig/usr.bin/ztest/Makefile cddl/usr.bin/ztest/Makefile
+--- cddl.orig/usr.bin/ztest/Makefile 2008-06-22 10:02:30 -0300
++++ cddl/usr.bin/ztest/Makefile 2008-06-22 10:12:40 -0300
+@@ -18,5 +18,7 @@
+ DPADD= ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBZPOOL} \
+ ${LIBPTHREAD} ${LIBZ} ${LIBAVL}
+ LDADD= -lm -lnvpair -lumem -lzpool -lpthread -lz -lavl
++LDFLAGS+=-L${.CURDIR}/../../lib/libnvpair -L${.CURDIR}/../../lib/libumem \
++ -L${.CURDIR}/../../lib/libzpool -L${.CURDIR}/../../lib/libavl -L/lib -L/usr/lib
+
+ .include <bsd.prog.mk>
+diff -ru cddl.orig/usr.bin/Makefile.inc cddl/usr.bin/Makefile.inc
+--- cddl.orig/usr.bin/Makefile.inc 2009-01-10 07:21:10 +0000
++++ cddl/usr.bin/Makefile.inc 2009-01-10 07:18:55 +0000
+@@ -1,5 +1,6 @@
+ # $FreeBSD: src/cddl/usr.bin/Makefile.inc,v 1.1.6.1 2008/11/25 02:59:29 kensmith Exp $
+
+ BINDIR?= /usr/bin
++LDFLAGS+= -L${.CURDIR}/../../lib/libctf
+
+ .include "../Makefile.inc"
+--- cddl.orig/usr.sbin/zdb/Makefile 2010-03-11 13:19:48 +0100
++++ cddl/usr.sbin/zdb/Makefile 2010-03-11 13:20:08 +0100
+@@ -22,6 +22,8 @@
+ DPADD= ${LIBAVL} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \
+ ${LIBUUTIL} ${LIBZ} ${LIBZFS} ${LIBZPOOL}
+ LDADD= -lavl -lgeom -lm -lnvpair -lpthread -lumem -luutil -lz -lzfs -lzpool
++LDFLAGS+=-L${.CURDIR}/../../lib/libnvpair -L${.CURDIR}/../../lib/libumem \
++ -L${.CURDIR}/../../lib/libzpool -L${.CURDIR}/../../lib/libavl -L${.CURDIR}/../../lib/libuutil -L${.CURDIR}/../../lib/libzfs
+
+ CSTD= c99
+
+--- cddl.orig/usr.bin/zinject/Makefile 2010-03-11 13:30:32 +0100
++++ cddl/usr.bin/zinject/Makefile 2010-03-11 13:33:27 +0100
+@@ -21,5 +21,8 @@
+ DPADD= ${LIBAVL} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBUUTIL} \
+ ${LIBZFS} ${LIBZPOOL} ${LIBUUTIL}
+ LDADD= -lavl -lgeom -lm -lnvpair -lumem -luutil -lzfs -lzpool
++LDFLAGS+= -L${.CURDIR}/../../lib/libavl -L${.CURDIR}/../../lib/libnvpair \
++ -L${.CURDIR}/../../lib/libumem -L${.CURDIR}/../../lib/libuutil \
++ -L${.CURDIR}/../../lib/libzfs -L${.CURDIR}/../../lib/libzpool
+
+ .include <bsd.prog.mk>
diff --git a/sys-freebsd/freebsd-cddl/files/freebsd-cddl-8.2-libpaths.patch b/sys-freebsd/freebsd-cddl/files/freebsd-cddl-8.2-libpaths.patch
new file mode 100644
index 000000000000..a0e567790473
--- /dev/null
+++ b/sys-freebsd/freebsd-cddl/files/freebsd-cddl-8.2-libpaths.patch
@@ -0,0 +1,22 @@
+--- cddl/usr.sbin/dtrace/Makefile.old 2011-07-06 00:09:01.000000000 +0000
++++ cddl/usr.sbin/dtrace/Makefile 2011-07-06 00:09:48.000000000 +0000
+@@ -24,6 +24,8 @@
+ #CFLAGS+= -DNEED_ERRLOC
+ #YFLAGS+= -d
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libdtrace -L${.CURDIR}/../../lib/libctf
++
+ DPADD= ${LIBPTHREAD} ${LIBDTRACE} ${LIBY} ${LIBL} ${LIBPROC} \
+ ${LIBCTF} ${LIBELF} ${LIBZ} ${LIBUTIL} ${LIBRTLD_DB}
+ LDADD= -lpthread -ldtrace -ly -lfl -lproc -lctf -lelf -lz -lutil \
+--- cddl/usr.sbin/lockstat/Makefile.old 2011-07-06 00:10:33.000000000 +0000
++++ cddl/usr.sbin/lockstat/Makefile 2011-07-06 00:10:57.000000000 +0000
+@@ -23,6 +23,8 @@
+
+ CFLAGS+= -DNEED_ERRLOC -g
+
++LDFLAGS+=-L${.CURDIR}/../../lib/libdtrace -L${.CURDIR}/../../lib/libctf
++
+ #YFLAGS+= -d
+
+ DPADD= ${LIBPTHREAD} ${LIBDTRACE} ${LIBY} ${LIBL} ${LIBPROC} \
diff --git a/sys-freebsd/freebsd-cddl/files/freebsd-cddl-9.0-bsdxml.patch b/sys-freebsd/freebsd-cddl/files/freebsd-cddl-9.0-bsdxml.patch
new file mode 100644
index 000000000000..b3d95bb7741e
--- /dev/null
+++ b/sys-freebsd/freebsd-cddl/files/freebsd-cddl-9.0-bsdxml.patch
@@ -0,0 +1,28 @@
+diff -ur cddl.old/sbin/zfs/Makefile cddl/sbin/zfs/Makefile
+--- cddl.old/sbin/zfs/Makefile 2011-11-04 10:01:46.000000000 +0000
++++ cddl/sbin/zfs/Makefile 2011-11-04 10:07:15.000000000 +0000
+@@ -21,8 +21,8 @@
+ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys
+ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs
+
+-DPADD= ${LIBBSDXML} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBSBUF} ${LIBUMEM} \
++DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBSBUF} ${LIBUMEM} \
+ ${LIBUTIL} ${LIBUUTIL} ${LIBZFS}
+-LDADD= -lbsdxml -lgeom -lm -lnvpair -lsbuf -lumem -lutil -luutil -lzfs
++LDADD= -lgeom -lm -lnvpair -lsbuf -lumem -lutil -luutil -lzfs
+
+ .include <bsd.prog.mk>
+diff -ur cddl.old/sbin/zpool/Makefile cddl/sbin/zpool/Makefile
+--- cddl.old/sbin/zpool/Makefile 2011-11-04 10:01:46.000000000 +0000
++++ cddl/sbin/zpool/Makefile 2011-11-04 10:06:38.000000000 +0000
+@@ -26,8 +26,8 @@
+ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common
+ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/stat/common
+
+-DPADD= ${LIBAVL} ${LIBBSDXML} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBSBUF} \
++DPADD= ${LIBAVL} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBSBUF} \
+ ${LIBUMEM} ${LIBUTIL} ${LIBUUTIL} ${LIBZFS}
+-LDADD= -lavl -lbsdxml -lgeom -lm -lnvpair -lsbuf -lumem -lutil -luutil -lzfs
++LDADD= -lavl -lgeom -lm -lnvpair -lsbuf -lumem -lutil -luutil -lzfs
+
+ .include <bsd.prog.mk>
diff --git a/sys-freebsd/freebsd-cddl/files/freebsd-cddl-9.0-libpaths.patch b/sys-freebsd/freebsd-cddl/files/freebsd-cddl-9.0-libpaths.patch
new file mode 100644
index 000000000000..c81a2c3a9cdf
--- /dev/null
+++ b/sys-freebsd/freebsd-cddl/files/freebsd-cddl-9.0-libpaths.patch
@@ -0,0 +1,167 @@
+diff -upNr a/cddl/lib/libzfs/Makefile b/cddl/lib/libzfs/Makefile
+--- a/cddl/lib/libzfs/Makefile 2012-03-30 18:58:53.174771000 +0000
++++ b/cddl/lib/libzfs/Makefile 2012-03-30 19:04:39.904906253 +0000
+@@ -54,4 +54,8 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/cont
+ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common
+ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libnvpair
++LDFLAGS+= -L${.CURDIR}/../../lib/libumem
++LDFLAGS+= -L${.CURDIR}/../../lib/libuutil
++
+ .include <bsd.lib.mk>
+diff -upNr a/cddl/lib/libzpool/Makefile b/cddl/lib/libzpool/Makefile
+--- a/cddl/lib/libzpool/Makefile 2012-03-30 18:58:53.174771000 +0000
++++ b/cddl/lib/libzpool/Makefile 2012-03-30 19:04:55.839233753 +0000
+@@ -56,6 +56,10 @@ CFLAGS+= -I${.CURDIR}/../../../lib/libpt
+ CFLAGS+= -I${.CURDIR}/../../../lib/libpthread/sys
+ CFLAGS+= -I${.CURDIR}/../../../lib/libthr/arch/${MACHINE_CPUARCH}/include
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libavl
++LDFLAGS+= -L${.CURDIR}/../../lib/libnvpair
++LDFLAGS+= -L${.CURDIR}/../../lib/libumem
++
+ DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBZ}
+ LDADD= -lmd -lpthread -lz -lumem -lnvpair -lavl
+
+diff -upNr a/cddl/sbin/zfs/Makefile b/cddl/sbin/zfs/Makefile
+--- a/cddl/sbin/zfs/Makefile 2012-03-30 18:58:53.174771000 +0000
++++ b/cddl/sbin/zfs/Makefile 2012-03-30 19:05:11.094859502 +0000
+@@ -21,6 +21,11 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/
+ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys
+ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libnvpair
++LDFLAGS+= -L${.CURDIR}/../../lib/libumem
++LDFLAGS+= -L${.CURDIR}/../../lib/libuutil
++LDFLAGS+= -L${.CURDIR}/../../lib/libzfs
++
+ DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBSBUF} ${LIBUMEM} \
+ ${LIBUTIL} ${LIBUUTIL} ${LIBZFS}
+ LDADD= -lgeom -lm -lnvpair -lsbuf -lumem -lutil -luutil -lzfs
+diff -upNr a/cddl/sbin/zpool/Makefile b/cddl/sbin/zpool/Makefile
+--- a/cddl/sbin/zpool/Makefile 2012-03-30 18:58:53.174771000 +0000
++++ b/cddl/sbin/zpool/Makefile 2012-03-30 19:05:24.830721002 +0000
+@@ -26,6 +26,12 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/
+ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common
+ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/stat/common
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libavl
++LDFLAGS+= -L${.CURDIR}/../../lib/libnvpair
++LDFLAGS+= -L${.CURDIR}/../../lib/libumem
++LDFLAGS+= -L${.CURDIR}/../../lib/libuutil
++LDFLAGS+= -L${.CURDIR}/../../lib/libzfs
++
+ DPADD= ${LIBAVL} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBSBUF} \
+ ${LIBUMEM} ${LIBUTIL} ${LIBUUTIL} ${LIBZFS}
+ LDADD= -lavl -lgeom -lm -lnvpair -lsbuf -lumem -lutil -luutil -lzfs
+diff -upNr a/cddl/usr.bin/ctfconvert/Makefile b/cddl/usr.bin/ctfconvert/Makefile
+--- a/cddl/usr.bin/ctfconvert/Makefile 2012-03-30 18:58:53.174771000 +0000
++++ b/cddl/usr.bin/ctfconvert/Makefile 2012-03-30 19:05:49.454897012 +0000
+@@ -36,6 +36,8 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/
+ -I${OPENSOLARIS_USR_DISTDIR}/tools/ctf/cvt \
+ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libctf
++
+ DPADD= ${LIBCTF} ${LIBDWARF} ${LIBELF} ${LIBZ} ${LIBPTHREAD}
+ LDADD= -lctf -ldwarf -lelf -lz -lpthread
+
+diff -upNr a/cddl/usr.bin/ctfmerge/Makefile b/cddl/usr.bin/ctfmerge/Makefile
+--- a/cddl/usr.bin/ctfmerge/Makefile 2012-03-30 18:58:53.174771000 +0000
++++ b/cddl/usr.bin/ctfmerge/Makefile 2012-03-30 19:06:08.084858412 +0000
+@@ -33,6 +33,8 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/
+ -I${OPENSOLARIS_USR_DISTDIR}/tools/ctf/cvt \
+ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libctf
++
+ DPADD= ${LIBCTF} ${LIBDWARF} ${LIBELF} ${LIBZ} ${LIBPTHREAD}
+ LDADD= -lctf -ldwarf -lelf -lz -lpthread
+
+diff -upNr a/cddl/usr.bin/zinject/Makefile b/cddl/usr.bin/zinject/Makefile
+--- a/cddl/usr.bin/zinject/Makefile 2012-03-30 18:58:53.174771000 +0000
++++ b/cddl/usr.bin/zinject/Makefile 2012-03-30 19:06:25.084865592 +0000
+@@ -19,6 +19,13 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/
+ CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head
+ CFLAGS+= -I${.CURDIR}/../../lib/libumem
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libavl
++LDFLAGS+= -L${.CURDIR}/../../lib/libnvpair
++LDFLAGS+= -L${.CURDIR}/../../lib/libumem
++LDFLAGS+= -L${.CURDIR}/../../lib/libuutil
++LDFLAGS+= -L${.CURDIR}/../../lib/libzfs
++LDFLAGS+= -L${.CURDIR}/../../lib/libzpool
++
+ DPADD= ${LIBAVL} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBUUTIL} \
+ ${LIBZFS} ${LIBZPOOL}
+ LDADD= -lavl -lgeom -lm -lnvpair -lumem -luutil -lzfs -lzpool
+diff -upNr a/cddl/usr.bin/zstreamdump/Makefile b/cddl/usr.bin/zstreamdump/Makefile
+--- a/cddl/usr.bin/zstreamdump/Makefile 2012-03-30 18:58:53.174771000 +0000
++++ b/cddl/usr.bin/zstreamdump/Makefile 2012-03-30 19:06:44.544860132 +0000
+@@ -18,6 +18,11 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/
+ CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head
+ CFLAGS+= -I${.CURDIR}/../../lib/libumem
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libavl
++LDFLAGS+= -L${.CURDIR}/../../lib/libnvpair
++LDFLAGS+= -L${.CURDIR}/../../lib/libumem
++LDFLAGS+= -L${.CURDIR}/../../lib/libzpool
++
+ DPADD= ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBZPOOL} \
+ ${LIBPTHREAD} ${LIBZ} ${LIBAVL}
+ LDADD= -lm -lnvpair -lumem -lzpool -lpthread -lz -lavl
+diff -upNr a/cddl/usr.bin/ztest/Makefile b/cddl/usr.bin/ztest/Makefile
+--- a/cddl/usr.bin/ztest/Makefile 2012-03-30 18:58:53.174771000 +0000
++++ b/cddl/usr.bin/ztest/Makefile 2012-03-30 19:06:58.344895642 +0000
+@@ -17,6 +17,11 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/
+ CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head
+ CFLAGS+= -I${.CURDIR}/../../lib/libumem
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libavl
++LDFLAGS+= -L${.CURDIR}/../../lib/libnvpair
++LDFLAGS+= -L${.CURDIR}/../../lib/libumem
++LDFLAGS+= -L${.CURDIR}/../../lib/libzpool
++
+ DPADD= ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBZPOOL} \
+ ${LIBPTHREAD} ${LIBZ} ${LIBAVL}
+ LDADD= -lm -lnvpair -lumem -lzpool -lpthread -lz -lavl
+diff -upNr a/cddl/usr.sbin/zdb/Makefile b/cddl/usr.sbin/zdb/Makefile
+--- a/cddl/usr.sbin/zdb/Makefile 2012-03-30 18:58:53.164736000 +0000
++++ b/cddl/usr.sbin/zdb/Makefile 2012-03-30 19:07:17.454861002 +0000
+@@ -23,6 +23,13 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/
+ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head
+ CFLAGS+= -I${.CURDIR}/../../lib/libumem
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libavl
++LDFLAGS+= -L${.CURDIR}/../../lib/libnvpair
++LDFLAGS+= -L${.CURDIR}/../../lib/libumem
++LDFLAGS+= -L${.CURDIR}/../../lib/libuutil
++LDFLAGS+= -L${.CURDIR}/../../lib/libzfs
++LDFLAGS+= -L${.CURDIR}/../../lib/libzpool
++
+ DPADD= ${LIBAVL} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \
+ ${LIBUUTIL} ${LIBZ} ${LIBZFS} ${LIBZPOOL}
+ LDADD= -lavl -lgeom -lm -lnvpair -lpthread -lumem -luutil -lz -lzfs -lzpool
+--- a/cddl/usr.sbin/dtrace/Makefile.old 2011-07-06 00:09:01.000000000 +0000
++++ b/cddl/usr.sbin/dtrace/Makefile 2011-07-06 00:09:48.000000000 +0000
+@@ -24,6 +24,8 @@
+ #CFLAGS+= -DNEED_ERRLOC
+ #YFLAGS+= -d
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libdtrace -L${.CURDIR}/../../lib/libctf
++
+ DPADD= ${LIBPTHREAD} ${LIBDTRACE} ${LIBY} ${LIBL} ${LIBPROC} \
+ ${LIBCTF} ${LIBELF} ${LIBZ} ${LIBUTIL} ${LIBRTLD_DB}
+ LDADD= -lpthread -ldtrace -ly -lfl -lproc -lctf -lelf -lz -lutil \
+--- a/cddl/usr.sbin/lockstat/Makefile.old 2011-07-06 00:10:33.000000000 +0000
++++ b/cddl/usr.sbin/lockstat/Makefile 2011-07-06 00:10:57.000000000 +0000
+@@ -23,6 +23,8 @@
+
+ CFLAGS+= -DNEED_ERRLOC -g
+
++LDFLAGS+=-L${.CURDIR}/../../lib/libdtrace -L${.CURDIR}/../../lib/libctf
++
+ #YFLAGS+= -d
+
+ DPADD= ${LIBPTHREAD} ${LIBDTRACE} ${LIBY} ${LIBL} ${LIBPROC} \
diff --git a/sys-freebsd/freebsd-cddl/files/freebsd-cddl-9.0-underlink.patch b/sys-freebsd/freebsd-cddl/files/freebsd-cddl-9.0-underlink.patch
new file mode 100644
index 000000000000..ff87d2c6ef9b
--- /dev/null
+++ b/sys-freebsd/freebsd-cddl/files/freebsd-cddl-9.0-underlink.patch
@@ -0,0 +1,22 @@
+--- cddl/lib/libzfs/Makefile.old 2011-11-04 10:27:30.000000000 +0000
++++ cddl/lib/libzfs/Makefile 2011-11-04 10:28:59.000000000 +0000
+@@ -7,7 +7,7 @@
+
+ LIB= zfs
+ DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBUMEM} ${LIBUTIL}
+-LDADD= -lmd -lpthread -lumem -lutil
++LDADD= -lmd -lpthread -lumem -lutil -luutil -lnvpair -lm -lgeom
+
+ SRCS= deviceid.c \
+ fsshare.c \
+--- cddl/lib/libzpool/Makefile.old 2011-11-04 18:22:28.000000000 +0000
++++ cddl/lib/libzpool/Makefile 2011-11-04 18:24:01.000000000 +0000
+@@ -57,7 +57,7 @@
+ CFLAGS+= -I${.CURDIR}/../../../lib/libthr/arch/${MACHINE_CPUARCH}/include
+
+ DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBZ}
+-LDADD= -lmd -lpthread -lz
++LDADD= -lmd -lpthread -lz -lumem -lnvpair -lavl
+
+ # atomic.S doesn't like profiling.
+ NO_PROFILE=
diff --git a/sys-freebsd/freebsd-cddl/files/freebsd-cddl-9.2-libpaths.patch b/sys-freebsd/freebsd-cddl/files/freebsd-cddl-9.2-libpaths.patch
new file mode 100644
index 000000000000..36eb570af722
--- /dev/null
+++ b/sys-freebsd/freebsd-cddl/files/freebsd-cddl-9.2-libpaths.patch
@@ -0,0 +1,220 @@
+diff --git a/lib/libzfs/Makefile b/lib/libzfs/Makefile
+index 5b6b47d..c8549b4 100644
+--- a/lib/libzfs/Makefile
++++ b/lib/libzfs/Makefile
+@@ -55,6 +55,11 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head
+ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common
+ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair
+ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common
++LDFLAGS+= -L${.CURDIR}/../../lib/libnvpair
++LDFLAGS+= -L${.CURDIR}/../../lib/libumem
++LDFLAGS+= -L${.CURDIR}/../../lib/libuutil
++LDFLAGS+= -L${.CURDIR}/../../lib/libzfs_core
++
+ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common
+ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common
+
+diff --git a/lib/libzfs_core/Makefile b/lib/libzfs_core/Makefile
+index a470fbc..ae8c649 100644
+--- a/lib/libzfs_core/Makefile
++++ b/lib/libzfs_core/Makefile
+@@ -34,4 +34,6 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common
+ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common
+ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libnvpair
++
+ .include <bsd.lib.mk>
+diff --git a/lib/libzpool/Makefile b/lib/libzpool/Makefile
+index 417c1cc..838cdb5 100644
+--- a/lib/libzpool/Makefile
++++ b/lib/libzpool/Makefile
+@@ -56,6 +56,10 @@ CFLAGS+= -I${.CURDIR}/../../../lib/libpthread/thread
+ CFLAGS+= -I${.CURDIR}/../../../lib/libpthread/sys
+ CFLAGS+= -I${.CURDIR}/../../../lib/libthr/arch/${MACHINE_CPUARCH}/include
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libavl
++LDFLAGS+= -L${.CURDIR}/../../lib/libnvpair
++LDFLAGS+= -L${.CURDIR}/../../lib/libumem
++
+ DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBZ}
+ LDADD= -lmd -lpthread -lz
+
+diff --git a/sbin/zfs/Makefile b/sbin/zfs/Makefile
+index a49d278..b22442e 100644
+--- a/sbin/zfs/Makefile
++++ b/sbin/zfs/Makefile
+@@ -22,6 +22,12 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs
+ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys
+ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libnvpair
++LDFLAGS+= -L${.CURDIR}/../../lib/libumem
++LDFLAGS+= -L${.CURDIR}/../../lib/libuutil
++LDFLAGS+= -L${.CURDIR}/../../lib/libzfs
++LDFLAGS+= -L${.CURDIR}/../../lib/libzfs_core
++
+ DPADD= ${LIBGEOM} ${LIBJAIL} ${LIBNVPAIR} ${LIBUMEM} \
+ ${LIBUTIL} ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS}
+ LDADD= -lgeom -ljail -lnvpair -lumem -lutil -luutil -lzfs_core -lzfs
+diff --git a/sbin/zpool/Makefile b/sbin/zpool/Makefile
+index 1884d24..5f06d5f 100644
+--- a/sbin/zpool/Makefile
++++ b/sbin/zpool/Makefile
+@@ -26,6 +26,13 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys
+ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common
+ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/stat/common
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libavl
++LDFLAGS+= -L${.CURDIR}/../../lib/libnvpair
++LDFLAGS+= -L${.CURDIR}/../../lib/libumem
++LDFLAGS+= -L${.CURDIR}/../../lib/libuutil
++LDFLAGS+= -L${.CURDIR}/../../lib/libzfs
++LDFLAGS+= -L${.CURDIR}/../../lib/libzfs_core
++
+ DPADD= ${LIBAVL} ${LIBGEOM} ${LIBNVPAIR} \
+ ${LIBUMEM} ${LIBUTIL} ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS}
+ LDADD= -lavl -lgeom -lnvpair -lumem -lutil -luutil -lzfs_core -lzfs
+diff --git a/usr.bin/ctfconvert/Makefile b/usr.bin/ctfconvert/Makefile
+index 7e4a05a..72327ad 100644
+--- a/usr.bin/ctfconvert/Makefile
++++ b/usr.bin/ctfconvert/Makefile
+@@ -36,6 +36,8 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
+ -I${OPENSOLARIS_USR_DISTDIR}/tools/ctf/cvt \
+ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libctf
++
+ DPADD= ${LIBCTF} ${LIBDWARF} ${LIBELF} ${LIBZ} ${LIBPTHREAD}
+ LDADD= -lctf -ldwarf -lelf -lz -lpthread
+
+diff --git a/usr.bin/ctfmerge/Makefile b/usr.bin/ctfmerge/Makefile
+index ba4840e..845d28c 100644
+--- a/usr.bin/ctfmerge/Makefile
++++ b/usr.bin/ctfmerge/Makefile
+@@ -33,6 +33,8 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
+ -I${OPENSOLARIS_USR_DISTDIR}/tools/ctf/cvt \
+ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libctf
++
+ DPADD= ${LIBCTF} ${LIBDWARF} ${LIBELF} ${LIBZ} ${LIBPTHREAD}
+ LDADD= -lctf -ldwarf -lelf -lz -lpthread
+
+diff --git a/usr.bin/zinject/Makefile b/usr.bin/zinject/Makefile
+index 8c5c141..3db2b29 100644
+--- a/usr.bin/zinject/Makefile
++++ b/usr.bin/zinject/Makefile
+@@ -19,6 +19,14 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common
+ CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head
+ CFLAGS+= -I${.CURDIR}/../../lib/libumem
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libavl
++LDFLAGS+= -L${.CURDIR}/../../lib/libnvpair
++LDFLAGS+= -L${.CURDIR}/../../lib/libumem
++LDFLAGS+= -L${.CURDIR}/../../lib/libuutil
++LDFLAGS+= -L${.CURDIR}/../../lib/libzfs
++LDFLAGS+= -L${.CURDIR}/../../lib/libzpool
++LDFLAGS+= -L${.CURDIR}/../../lib/libzfs_core
++
+ DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBUUTIL} \
+ ${LIBZFS_CORE} ${LIBZFS} ${LIBZPOOL}
+ LDADD= -lgeom -lm -lnvpair -lumem -luutil -lzfs_core -lzfs -lzpool
+diff --git a/usr.bin/zstreamdump/Makefile b/usr.bin/zstreamdump/Makefile
+index 304ff7c..5f0b00e 100644
+--- a/usr.bin/zstreamdump/Makefile
++++ b/usr.bin/zstreamdump/Makefile
+@@ -18,6 +18,11 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common
+ CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head
+ CFLAGS+= -I${.CURDIR}/../../lib/libumem
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libavl
++LDFLAGS+= -L${.CURDIR}/../../lib/libnvpair
++LDFLAGS+= -L${.CURDIR}/../../lib/libumem
++LDFLAGS+= -L${.CURDIR}/../../lib/libzpool
++
+ DPADD= ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBZPOOL} \
+ ${LIBPTHREAD} ${LIBZ} ${LIBAVL}
+ LDADD= -lm -lnvpair -lumem -lzpool -lpthread -lz -lavl
+diff --git a/usr.bin/ztest/Makefile b/usr.bin/ztest/Makefile
+index 965300e..ad40a92 100644
+--- a/usr.bin/ztest/Makefile
++++ b/usr.bin/ztest/Makefile
+@@ -18,6 +18,14 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common
+ CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head
+ CFLAGS+= -I${.CURDIR}/../../lib/libumem
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libavl
++LDFLAGS+= -L${.CURDIR}/../../lib/libnvpair
++LDFLAGS+= -L${.CURDIR}/../../lib/libumem
++LDFLAGS+= -L${.CURDIR}/../../lib/libuutil
++LDFLAGS+= -L${.CURDIR}/../../lib/libzfs
++LDFLAGS+= -L${.CURDIR}/../../lib/libzpool
++LDFLAGS+= -L${.CURDIR}/../../lib/libzfs_core
++
+ DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBZPOOL} \
+ ${LIBPTHREAD} ${LIBAVL} ${LIBZFS_CORE} ${LIBZFS} ${LIBUUTIL}
+ LDADD= -lgeom -lm -lnvpair -lumem -lzpool -lpthread -lavl -lzfs_core -lzfs \
+diff --git a/usr.sbin/dtrace/Makefile b/usr.sbin/dtrace/Makefile
+index 3930f01..4bdbd1a 100644
+--- a/usr.sbin/dtrace/Makefile
++++ b/usr.sbin/dtrace/Makefile
+@@ -25,4 +25,7 @@ DPADD= ${LIBPTHREAD} ${LIBDTRACE} ${LIBY} ${LIBL} ${LIBPROC} \
+ LDADD= -lpthread -ldtrace -ly -ll -lproc -lctf -lelf -lz -lutil \
+ -lrtld_db
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libdtrace
++LDFLAGS+= -L${.CURDIR}/../../lib/libctf
++
+ .include <bsd.prog.mk>
+diff --git a/usr.sbin/lockstat/Makefile b/usr.sbin/lockstat/Makefile
+index 70515ef..d65e4c3 100644
+--- a/usr.sbin/lockstat/Makefile
++++ b/usr.sbin/lockstat/Makefile
+@@ -20,6 +20,9 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
+
+ CFLAGS+= -DNEED_ERRLOC -g
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libdtrace
++LDFLAGS+= -L${.CURDIR}/../../lib/libctf
++
+ #YFLAGS+= -d
+
+ DPADD= ${LIBPTHREAD} ${LIBDTRACE} ${LIBY} ${LIBFL} ${LIBPROC} \
+diff --git a/usr.sbin/zdb/Makefile b/usr.sbin/zdb/Makefile
+index 8068385..337e324 100644
+--- a/usr.sbin/zdb/Makefile
++++ b/usr.sbin/zdb/Makefile
+@@ -23,6 +23,14 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs
+ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head
+ CFLAGS+= -I${.CURDIR}/../../lib/libumem
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libavl
++LDFLAGS+= -L${.CURDIR}/../../lib/libnvpair
++LDFLAGS+= -L${.CURDIR}/../../lib/libumem
++LDFLAGS+= -L${.CURDIR}/../../lib/libuutil
++LDFLAGS+= -L${.CURDIR}/../../lib/libzfs
++LDFLAGS+= -L${.CURDIR}/../../lib/libzpool
++LDFLAGS+= -L${.CURDIR}/../../lib/libzfs_core
++
+ DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \
+ ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS} ${LIBZPOOL}
+ LDADD= -lgeom -lm -lnvpair -lpthread -lumem -luutil -lzfs_core -lzfs -lzpool
+diff --git a/usr.sbin/zhack/Makefile b/usr.sbin/zhack/Makefile
+index f09d2d8..fc3d7a4 100644
+--- a/usr.sbin/zhack/Makefile
++++ b/usr.sbin/zhack/Makefile
+@@ -22,6 +22,13 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs
+ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head
+ CFLAGS+= -I${.CURDIR}/../../lib/libumem
+
++LDFLAGS+= -L${.CURDIR}/../../lib/libnvpair
++LDFLAGS+= -L${.CURDIR}/../../lib/libumem
++LDFLAGS+= -L${.CURDIR}/../../lib/libuutil
++LDFLAGS+= -L${.CURDIR}/../../lib/libzfs
++LDFLAGS+= -L${.CURDIR}/../../lib/libzpool
++LDFLAGS+= -L${.CURDIR}/../../lib/libzfs_core
++
+ DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \
+ ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS} ${LIBZPOOL}
+ LDADD= -lgeom -lm -lnvpair -lpthread -lumem -luutil -lzfs_core -lzfs -lzpool
diff --git a/sys-freebsd/freebsd-cddl/files/zfs.initd b/sys-freebsd/freebsd-cddl/files/zfs.initd
new file mode 100644
index 000000000000..f73bdf005584
--- /dev/null
+++ b/sys-freebsd/freebsd-cddl/files/zfs.initd
@@ -0,0 +1,24 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need hostid
+ before fsck
+}
+
+start() {
+ einfo "Starting zfs ..."
+ zfs mount -a
+ zfs share -a
+ if [ ! -r /etc/zfs/exports ]; then
+ touch /etc/zfs/exports
+ fi
+}
+
+stop() {
+ einfo "Stopping zfs ..."
+ zfs unshare -a
+ zfs unmount -a
+}
diff --git a/sys-freebsd/freebsd-cddl/files/zvol.initd b/sys-freebsd/freebsd-cddl/files/zvol.initd
new file mode 100755
index 000000000000..5a593faec699
--- /dev/null
+++ b/sys-freebsd/freebsd-cddl/files/zvol.initd
@@ -0,0 +1,47 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need hostid
+ before fsck
+}
+
+start() {
+ einfo "Starting zfs volumes..."
+ zfs volinit
+ eend $?
+ # Enable swap on ZVOLs that have org.freebsd:swap=on.
+ zfs list -H -o org.freebsd:swap,name -t volume | \
+ while read state name; do
+ case "${state}" in
+ [oO][nN])
+ einfo "Enabling swap on zvol ${name}"
+ swapon /dev/zvol/${name}
+ eend $?
+ ;;
+ esac
+ done
+}
+
+stop() {
+ # Disable what we had enabled before.
+ zfs list -H -o org.freebsd:swap,name -t volume | \
+ while read state name; do
+ case "${state}" in
+ [oO][nN])
+ einfo "Disabling swap on zvol ${name}"
+ swapoff /dev/zvol/${name}
+ eend $?
+ ;;
+ esac
+ done
+ einfo "Stopping zfs volumes..."
+ zfs volfini
+ eend $?
+}
+
+restart() {
+ :
+}
diff --git a/sys-freebsd/freebsd-cddl/files/zvol.initd-9.0 b/sys-freebsd/freebsd-cddl/files/zvol.initd-9.0
new file mode 100755
index 000000000000..e80f32437d6b
--- /dev/null
+++ b/sys-freebsd/freebsd-cddl/files/zvol.initd-9.0
@@ -0,0 +1,45 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need hostid
+ before fsck
+}
+
+start() {
+ einfo "Starting zfs volumes..."
+ eend $?
+ # Enable swap on ZVOLs that have org.freebsd:swap=on.
+ zfs list -H -o org.freebsd:swap,name -t volume | \
+ while read state name; do
+ case "${state}" in
+ [oO][nN])
+ einfo "Enabling swap on zvol ${name}"
+ swapon /dev/zvol/${name}
+ eend $?
+ ;;
+ esac
+ done
+}
+
+stop() {
+ # Disable what we had enabled before.
+ zfs list -H -o org.freebsd:swap,name -t volume | \
+ while read state name; do
+ case "${state}" in
+ [oO][nN])
+ einfo "Disabling swap on zvol ${name}"
+ swapoff /dev/zvol/${name}
+ eend $?
+ ;;
+ esac
+ done
+ einfo "Stopping zfs volumes..."
+ eend $?
+}
+
+restart() {
+ :
+}
diff --git a/sys-freebsd/freebsd-cddl/freebsd-cddl-10.1.ebuild b/sys-freebsd/freebsd-cddl/freebsd-cddl-10.1.ebuild
new file mode 100644
index 000000000000..785ef67e30bc
--- /dev/null
+++ b/sys-freebsd/freebsd-cddl/freebsd-cddl-10.1.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit bsdmk freebsd toolchain-funcs multilib
+
+DESCRIPTION="FreeBSD CDDL (opensolaris/zfs) extra software"
+SLOT="0"
+
+IUSE="build"
+LICENSE="CDDL GPL-2"
+
+if [[ ${PV} != *9999* ]]; then
+ KEYWORDS="~amd64-fbsd ~x86-fbsd"
+fi
+
+# sys is required.
+EXTRACTONLY="
+ cddl/
+ contrib/
+ usr.bin/
+ lib/
+ sbin/
+ sys/
+"
+use build && EXTRACTONLY+="include/"
+
+RDEPEND="=sys-freebsd/freebsd-lib-${RV}*
+ =sys-freebsd/freebsd-libexec-${RV}*
+ build? ( sys-apps/baselayout )"
+
+DEPEND="${RDEPEND}
+ =sys-freebsd/freebsd-mk-defs-${RV}*
+ !build? ( =sys-freebsd/freebsd-sources-${RV}* )"
+
+S="${WORKDIR}/cddl"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-9.2-libpaths.patch"
+ "${FILESDIR}/${PN}-10.1-underlink.patch"
+ )
+
+src_prepare() {
+ if [[ ! -e "${WORKDIR}/include" ]]; then
+ # Link in include headers.
+ ln -s "/usr/include" "${WORKDIR}/include" || die "Symlinking /usr/include.."
+ fi
+}
+
+src_install() {
+ # Install libraries proper place
+ local mylibdir=$(get_libdir)
+ mkinstall SHLIBDIR="/usr/${mylibdir}" LIBDIR="/usr/${mylibdir}" || die
+
+ gen_usr_ldscript -a avl nvpair umem uutil zfs zpool zfs_core
+
+ # Install zfs volinit script.
+ newinitd "${FILESDIR}"/zvol.initd-9.0 zvol
+
+ # Install zfs script
+ newinitd "${FILESDIR}"/zfs.initd zfs
+
+ keepdir /etc/zfs
+}
diff --git a/sys-freebsd/freebsd-cddl/freebsd-cddl-8.2.ebuild b/sys-freebsd/freebsd-cddl/freebsd-cddl-8.2.ebuild
new file mode 100644
index 000000000000..e9ce7485206b
--- /dev/null
+++ b/sys-freebsd/freebsd-cddl/freebsd-cddl-8.2.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit bsdmk freebsd flag-o-matic eutils
+
+DESCRIPTION="FreeBSD CDDL (opensolaris/zfs) extra software"
+SLOT="0"
+KEYWORDS="~x86-fbsd"
+
+IUSE="build"
+LICENSE="CDDL GPL-2"
+
+SRC_URI="mirror://gentoo/${P}.tar.bz2
+ mirror://gentoo/${CONTRIB}.tar.bz2
+ mirror://gentoo/${UBIN}.tar.bz2
+ mirror://gentoo/${LIB}.tar.bz2
+ mirror://gentoo/${SBIN}.tar.bz2
+ mirror://gentoo/${SYS}.tar.bz2
+ build? ( mirror://gentoo/${INCLUDE}.tar.bz2 )"
+
+# sys is required.
+
+RDEPEND="=sys-freebsd/freebsd-lib-${RV}*
+ =sys-freebsd/freebsd-libexec-${RV}*
+ build? ( sys-apps/baselayout )
+ dev-libs/libedit
+ dev-libs/libelf"
+
+DEPEND="${RDEPEND}
+ =sys-freebsd/freebsd-mk-defs-${RV}*
+ !build? ( =sys-freebsd/freebsd-sources-${RV}* )"
+
+S="${WORKDIR}/cddl"
+
+PATCHES=( "${FILESDIR}/${PN}-8.0-libpaths.patch" "${FILESDIR}/${PN}-8.2-libpaths.patch" )
+
+src_unpack() {
+ freebsd_src_unpack
+ # Link in include headers.
+ ln -s "/usr/include" "${WORKDIR}/include" || die "Symlinking /usr/include.."
+}
+
+src_install() {
+ freebsd_src_install
+ # Install zfs volinit script.
+ newinitd "${FILESDIR}"/zvol.initd zvol
+}
diff --git a/sys-freebsd/freebsd-cddl/freebsd-cddl-9.1.ebuild b/sys-freebsd/freebsd-cddl/freebsd-cddl-9.1.ebuild
new file mode 100644
index 000000000000..5a7acca8b884
--- /dev/null
+++ b/sys-freebsd/freebsd-cddl/freebsd-cddl-9.1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit bsdmk freebsd toolchain-funcs multilib
+
+DESCRIPTION="FreeBSD CDDL (opensolaris/zfs) extra software"
+SLOT="0"
+KEYWORDS="~amd64-fbsd ~x86-fbsd"
+
+IUSE="build"
+LICENSE="CDDL GPL-2"
+
+SRC_URI="mirror://gentoo/${P}.tar.bz2
+ mirror://gentoo/${CONTRIB}.tar.bz2
+ mirror://gentoo/${UBIN}.tar.bz2
+ mirror://gentoo/${LIB}.tar.bz2
+ mirror://gentoo/${SBIN}.tar.bz2
+ mirror://gentoo/${SYS}.tar.bz2
+ build? ( mirror://gentoo/${INCLUDE}.tar.bz2 )"
+
+# sys is required.
+
+RDEPEND="=sys-freebsd/freebsd-lib-${RV}*
+ =sys-freebsd/freebsd-libexec-${RV}*
+ build? ( sys-apps/baselayout )
+ dev-libs/libelf"
+
+DEPEND="${RDEPEND}
+ =sys-freebsd/freebsd-mk-defs-${RV}*
+ !build? ( =sys-freebsd/freebsd-sources-${RV}* )"
+
+S="${WORKDIR}/cddl"
+
+PATCHES=( "${FILESDIR}/${PN}-9.0-bsdxml.patch"
+ "${FILESDIR}/${PN}-9.0-underlink.patch"
+ "${FILESDIR}/${PN}-9.0-libpaths.patch" )
+
+src_unpack() {
+ freebsd_src_unpack
+ # Link in include headers.
+ ln -s "/usr/include" "${WORKDIR}/include" || die "Symlinking /usr/include.."
+}
+
+src_install() {
+ # Install libraries proper place
+ local mylibdir=$(get_libdir)
+ mkinstall SHLIBDIR="/usr/${mylibdir}" LIBDIR="/usr/${mylibdir}" || die
+
+ gen_usr_ldscript -a avl nvpair umem uutil zfs zpool
+
+ # Install zfs volinit script.
+ newinitd "${FILESDIR}"/zvol.initd-9.0 zvol
+
+ # Install zfs script
+ newinitd "${FILESDIR}"/zfs.initd zfs
+
+ keepdir /etc/zfs
+}
diff --git a/sys-freebsd/freebsd-cddl/metadata.xml b/sys-freebsd/freebsd-cddl/metadata.xml
new file mode 100644
index 000000000000..ecedda4aa2cc
--- /dev/null
+++ b/sys-freebsd/freebsd-cddl/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>bsd</herd>
+</pkgmetadata>