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-sbin
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-sbin')
-rw-r--r--sys-freebsd/freebsd-sbin/Manifest16
-rw-r--r--sys-freebsd/freebsd-sbin/files/adjkerntz-crontab4
-rw-r--r--sys-freebsd/freebsd-sbin/files/devd.conf153
-rw-r--r--sys-freebsd/freebsd-sbin/files/devd.initd47
-rw-r--r--sys-freebsd/freebsd-sbin/files/devd_queue50
-rw-r--r--sys-freebsd/freebsd-sbin/files/freebsd-sbin-10.0-zlib.patch22
-rw-r--r--sys-freebsd/freebsd-sbin/files/freebsd-sbin-6.1-pr102701.patch17
-rw-r--r--sys-freebsd/freebsd-sbin/files/freebsd-sbin-6.2-ldconfig.patch13
-rw-r--r--sys-freebsd/freebsd-sbin/files/freebsd-sbin-7.1-zlib.patch21
-rw-r--r--sys-freebsd/freebsd-sbin/files/freebsd-sbin-bsdxml2expat.patch13
-rw-r--r--sys-freebsd/freebsd-sbin/files/freebsd-sbin-setXid.patch20
-rwxr-xr-xsys-freebsd/freebsd-sbin/files/idmapd.initd20
-rw-r--r--sys-freebsd/freebsd-sbin/files/ipfw.confd10
-rw-r--r--sys-freebsd/freebsd-sbin/files/ipfw.initd110
-rw-r--r--sys-freebsd/freebsd-sbin/files/sysctl.initd28
-rw-r--r--sys-freebsd/freebsd-sbin/freebsd-sbin-10.1-r1.ebuild104
-rw-r--r--sys-freebsd/freebsd-sbin/freebsd-sbin-8.2-r1.ebuild94
-rw-r--r--sys-freebsd/freebsd-sbin/freebsd-sbin-9.1.ebuild95
-rw-r--r--sys-freebsd/freebsd-sbin/metadata.xml17
19 files changed, 854 insertions, 0 deletions
diff --git a/sys-freebsd/freebsd-sbin/Manifest b/sys-freebsd/freebsd-sbin/Manifest
new file mode 100644
index 00000000000..0a0a39e55e2
--- /dev/null
+++ b/sys-freebsd/freebsd-sbin/Manifest
@@ -0,0 +1,16 @@
+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-etc-8.2.tar.bz2 188629 SHA256 6bc745fa259f9fa2b65df865d45443a7b23c24445195e33a4ac50bf1040ae238 SHA512 3e5c106754a6a1ac806bd46b711fba7ee9cb31a4eab5262c995a5d59dbeb02f756dd8b495640dda94189d204a5d2c5218de2bd23467172d6a4ebe1048986e89c WHIRLPOOL 23b658a214f1a64c43420351020e32b1182e9aac3ed5253f49ee86f9cee9166ce32bd556cd2a2b3c0e60a165462a8700f37dea19e57ad5716415e17f61da912e
+DIST freebsd-etc-9.1.tar.bz2 207776 SHA256 a317bf85532d6192f5506e8d7bd5d5c201fe24017700e3a974a7712c2c69cdb8 SHA512 4fbe56fde519cf2f44e39a8869efa26c34f703cf540f4a83389da8d170873d7c6fb18e4010e643b8d793cfc5c55d15eeb198057a5b2a8da9d9e8f791801bf314 WHIRLPOOL 0c27019fe140fe96f870697acbaa89ac2f281f55b892c5791b08abf1cfa4da94d9d42a1df1c2091317573ed7234253857aecb797065f911a0a5d57bbf64349a5
+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-libexec-8.2.tar.bz2 289147 SHA256 10b996d1d8cd044ee2e7a877e5e6ad2bf050cce9b3bd402a5e0dea7d290b595d SHA512 abe6cf5a268675d7dcb1c214c46fef47a3fb09b31947f5d8a0b938d352295efe0249beb5007649c52187bf4c221b6ebf074d18dfe9bafd168cae09ee02ab608d WHIRLPOOL 27e854fe465eb933dd8e27c5a09b063e4d3798b54e0914c79a9120dcdc34cc5d525a0c92da7b645ff7ab2ab4f34c7f7b2783012dfa5004407acd11150062b7ad
+DIST freebsd-libexec-9.1.tar.bz2 304592 SHA256 71e6e9e41328c2148c54b81ad9b59f912a1d5f0d52e17ac07f223aa7a94b82be SHA512 7baa4160dda2610250dd52f445e24478e0f1ea10bce21fcd0e5d1b856f399b896adc334114de0c7f61a5637e4349bb1688fdbe5c72798d8568ae791114710b92 WHIRLPOOL d800f477ac5c9ad6dae3e0091c83e107609b5a1e3aa79e9533fcd10a8dd34ff7733ab9523eae7c292310fe94f6a529209cae6b9e8bac6b47244e59834593e74b
+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-sbin-SA-1519-routed.patch 554 SHA256 e4f90b10ddb18f046ff340ec1bf1d5fdf0c330fe4966bd9e47fb0cb0a1fbe842 SHA512 6d09c517bd10f9f19b220ae11100d7cdd41e7943a48632c77c254dbc86e4b4a72f8d34925ee65e0a192c37fc49ef0718ad16556de8ca508c118060e286087192 WHIRLPOOL a9ad3c2bdc968e71b7c21e0897d5ab10b9f1e178116f71a77c6c389a25c256165908ae0862f975c2c491e9bf0d509f6c4fd75452853234e96e69f55fabc14e8e
+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-usbin-8.2.tar.bz2 2443024 SHA256 aa7cabf10f5c3a9daabea32e4de24d04ec312247842981476da666eff5054603 SHA512 bcb8ff3df54848b9107bbb52e5ced7a91e24bb181f06769b6997221729b8064ec17652eaf7500de3268cbcb63ff5760beb54d15fc78c27b02687b5b1067c74a6 WHIRLPOOL 20f5278e2a1dd387a75b44f10507958d6c0e84a2faa1bddbf808c14ab86d8dd14a956192911bbc1880f5f5f7bd05972dcbb4aec85d241f0dcf91bf4246883f0a
+DIST freebsd-usbin-9.1.tar.bz2 2670916 SHA256 b938c20b8c09aa9a610e13b69b9afeea72f561ab3636a59fba2bdac290f4db75 SHA512 21c234312f70eb35cd2926519efc1f61592892f5d0940786dbeb959c3c5ec7819a51ae95c6e8a1a06aa01f669350fe0fd3dd7c4ec8a84dd6b90f24cb192356ca WHIRLPOOL 7f6ad2eb5410cc5e685881654a788807848af026b1277a974682755ab7c9db28f576bfd1576441ea10c5f1e9edb7d30a4a23fb8eccd6d69d86ecc9ce4c9adc7e
diff --git a/sys-freebsd/freebsd-sbin/files/adjkerntz-crontab b/sys-freebsd/freebsd-sbin/files/adjkerntz-crontab
new file mode 100644
index 00000000000..5fc46f5bf48
--- /dev/null
+++ b/sys-freebsd/freebsd-sbin/files/adjkerntz-crontab
@@ -0,0 +1,4 @@
+# Adjust the time zone if the CMOS clock keeps local time, as opposed to
+# UTC time. See adjkerntz(8) for details.
+1,31 0-5 * * * root /sbin/adjkerntz -a
+
diff --git a/sys-freebsd/freebsd-sbin/files/devd.conf b/sys-freebsd/freebsd-sbin/files/devd.conf
new file mode 100644
index 00000000000..fd1e0352e5b
--- /dev/null
+++ b/sys-freebsd/freebsd-sbin/files/devd.conf
@@ -0,0 +1,153 @@
+# Refer to devd.conf(5) and devd(8) man pages for the details on how to
+# run and configure devd.
+#
+
+# NB: All regular expressions have an implicit ^$ around them.
+# NB: device-name is shorthand for 'match device-name'
+
+options {
+ # Each directory directive adds a directory the list of directories
+ # that we scan for files. Files are read-in in the order that they
+ # are returned from readdir(3). The rule-sets are combined to
+ # create a DFA that's used to match events to actions.
+ directory "/etc/devd";
+ directory "/usr/local/etc/devd";
+ pid-file "/var/run/devd.pid";
+
+ # Setup some shorthand for regex that we use later in the file.
+ #XXX Yes, these are gross -- imp
+ set scsi-controller-regex
+ "(aac|adv|adw|aha|ahb|ahc|ahd|aic|amd|amr|asr|bt|ciss|ct|dpt|\
+ esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm|wds)\
+ [0-9]+";
+};
+
+# Note that the attach/detach with the highest value wins, so that one can
+# override these general rules.
+
+#
+# For ethernet like devices start configuring the interface. Due to
+# a historical accident, this script is called pccard_ether.
+#
+attach 0 {
+ media-type "ethernet";
+ action "/etc/devd_queue add env IN_HOTPLUG=1 /etc/init.d/net.$device-name start";
+};
+
+detach 0 {
+ media-type "ethernet";
+ action "/etc/devd_queue add env IN_HOTPLUG=1 /etc/init.d/net.$device-name stop";
+};
+
+#
+# Try to start dhclient on Ethernet like interfaces when the link comes
+# up. Only devices that are configured to support DHCP will actually
+# run it. No link down rule exists because dhclient automaticly exits
+# when the link goes down.
+#
+notify 0 {
+ match "system" "IFNET";
+ match "type" "LINK_UP";
+ media-type "ethernet";
+ action "/etc/devd_queue add /etc/init.d/net.$subsystem start";
+};
+notify 0 {
+ match "system" "IFNET";
+ match "type" "LINK_DOWN";
+ media-type "ethernet";
+ action "/etc/devd_queue add /etc/init.d/net.$subsystem stop";
+};
+
+#
+# Like Ethernet devices, but separate because
+# they have a different media type. We may want
+# to exploit this later.
+#
+#detach 0 {
+# media-type "802.11";
+# action "env IN_HOTPLUG=1 /etc/init.d/net.$device-name stop";
+#};
+#attach 0 {
+# media-type "802.11";
+# action "env IN_HOTPLUG=1 /etc/init.d/net.$device-name start";
+#};
+
+# Not sure how to handle this in Gentoo yet
+# When a USB Bluetooth dongle appears activate it
+#attach 100 {
+# device-name "ubt[0-9]+";
+# action "/etc/rc.d/bluetooth start $device-name";
+#};
+#detach 100 {
+# device-name "ubt[0-9]+";
+# action "/etc/rc.d/bluetooth stop $device-name";
+#};
+
+# When a USB keyboard arrives, attach it as the console keyboard.
+attach 100 {
+ device-name "ukbd0";
+ action "kbdcontrol -k /dev/ukbd0 < /dev/console";
+};
+detach 100 {
+ device-name "ukbd0";
+ action "kbdcontrol -k /dev/kbd0 < /dev/console";
+};
+
+# The entry below starts and stops moused when a mouse is plugged in.
+attach 100 {
+ device-name "psm[0-9]+";
+ action "/etc/devd_queue add env IN_HOTPLUG=1 /etc/init.d/moused.$device-name start";
+};
+detach 100 {
+ device-name "psm[0-9]+";
+ action "/etc/devd_queue add env IN_HOTPLUG=1 /etc/init.d/moused.$device-name stop";
+};
+attach 100 {
+ device-name "ums[0-9]+";
+ action "/etc/devd_queue add env IN_HOTPLUG=1 /etc/init.d/moused.$device-name start";
+};
+detach 100 {
+ device-name "ums[0-9]+";
+ action "/etc/devd_queue add env IN_HOTPLUG=1 /etc/init.d/moused.$device-name stop";
+};
+
+# Notify all users before beginning emergency shutdown when we get
+# a _CRT or _HOT thermal event and we're going to power down the system
+# very soon.
+notify 10 {
+ match "system" "ACPI";
+ match "subsystem" "Thermal";
+ match "notify" "0xcc";
+ action "logger -p kern.emerg 'WARNING: system temperature too high, shutting down soon!'";
+};
+
+/* EXAMPLES TO END OF FILE
+
+
+# Examples of notify hooks. A notify is a generic way for a kernel
+# subsystem to send event notification to userland.
+#
+# Here are some examples of ACPI notify handlers. ACPI subsystems that
+# generate notifies include the AC adapter, power/sleep buttons,
+# control method batteries, lid switch, and thermal zones.
+#
+# Information returned is not always the same as the ACPI notify
+# events. See the ACPI specification for more information about
+# notifies. Here is the information returned for each subsystem:
+#
+# ACAD: AC line state (0 is offline, 1 is online)
+# Button: Button pressed (0 for power, 1 for sleep)
+# CMBAT: ACPI battery events
+# Lid: Lid state (0 is closed, 1 is open)
+# Thermal: ACPI thermal zone events
+#
+# This example calls a script when the AC state changes, passing the
+# notify value as the first argument. If the state is 0x00, it might
+# call some sysctls to implement economy mode. If 0x01, it might set
+# the mode to performance.
+notify 10 {
+ match "system" "ACPI";
+ match "subsystem" "ACAD";
+ action "/etc/acpi_ac $notify";
+};
+*/
diff --git a/sys-freebsd/freebsd-sbin/files/devd.initd b/sys-freebsd/freebsd-sbin/files/devd.initd
new file mode 100644
index 00000000000..2b70320f4bb
--- /dev/null
+++ b/sys-freebsd/freebsd-sbin/files/devd.initd
@@ -0,0 +1,47 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need localmount
+ after bootmisc hostname
+ before net
+}
+
+start() {
+ # Services may depend on us, so mark us as inactive
+ mark_service_inactive "${SVCNAME}"
+
+ # Create a queue so that if things went UP DOWN UP DOWN UP DOWN UP
+ # We just do an UP
+ # This is used by /etc/devd_queue
+ mkdir -p /var/run/devd
+
+ ebegin "Starting the Device State Change Daemon"
+ sysctl hw.bus.devctl_disable=0 >/dev/null
+ start-stop-daemon --start --exec /sbin/devd \
+ --pidfile /var/run/devd.pid
+ eend $? "Failed to start devd" \
+ || return $?
+
+ ebegin "Waiting for Device State Change Daemon to settle"
+ LC_ALL=C sleep "${DEVD_WAIT:-2}"
+ eend $?
+
+ # Now flush the queue
+ einfo "Flushing Device State Change Daemon queue"
+ /etc/devd_queue flush
+
+ mark_service_started "${SVCNAME}"
+ return 0
+}
+
+stop() {
+ ebegin "Stopping the Device State Change Daemon"
+ sysctl hw.bus.devctl_disable=1 >/dev/null
+ start-stop-daemon --stop --exec /sbin/devd \
+ --pidfile /var/run/devd.pid
+ eend $? "Failed to stop devd"
+}
+
+# vim: ts=4 :
diff --git a/sys-freebsd/freebsd-sbin/files/devd_queue b/sys-freebsd/freebsd-sbin/files/devd_queue
new file mode 100644
index 00000000000..d42cb830c96
--- /dev/null
+++ b/sys-freebsd/freebsd-sbin/files/devd_queue
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+# Notify the rc system that we're in the background
+export IN_BACKGROUND=true
+
+arg1="$1"
+if [ -z "$arg1" ] ; then
+ echo "Command required" > /dev/stderr
+ exit 1
+fi
+shift
+
+case "$arg1" in
+ add)
+ if [ -z "$1" ] ; then
+ echo "Command missing!" > /dev/stderr
+ exit 1
+ fi
+
+ # If we don't have a queue then just run
+ if [ ! -d /var/run/devd ] ; then
+ "$@"
+ exit $?
+ fi
+
+ cmd="$1"
+ args="$*"
+ if [ "$cmd" = "env" ] ; then
+ shift
+ while echo "$1" | grep -q "="; do
+ shift
+ [ "$1" = "--" ] && shift && break
+ done
+ cmd="$1"
+ fi
+ echo "$args" > /var/run/devd/$(basename "$cmd")
+ ;;
+ flush)
+ while ! rmdir /var/run/devd 2>/dev/null ; do
+ for cmd in $(cd /var/run/devd; ls) ; do
+ args=$(cat /var/run/devd/$cmd)
+ rm -f /var/run/devd/$cmd
+ $args
+ done
+ done
+ ;;
+ *)
+ echo "Unknown command $arg1"
+ ;;
+esac
diff --git a/sys-freebsd/freebsd-sbin/files/freebsd-sbin-10.0-zlib.patch b/sys-freebsd/freebsd-sbin/files/freebsd-sbin-10.0-zlib.patch
new file mode 100644
index 00000000000..c0a2bf923c2
--- /dev/null
+++ b/sys-freebsd/freebsd-sbin/files/freebsd-sbin-10.0-zlib.patch
@@ -0,0 +1,22 @@
+diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c
+index bdbf7e3..a4c67ec 100644
+--- a/sbin/savecore/savecore.c
++++ b/sbin/savecore/savecore.c
+@@ -92,7 +92,7 @@ static int checkfor, compress, clear, force, keep, verbose; /* flags */
+ static int nfound, nsaved, nerr; /* statistics */
+ static int maxdumps;
+
+-extern FILE *zopen(const char *, const char *);
++extern FILE *gzopen(const char *, const char *);
+
+ static sig_atomic_t got_siginfo;
+ static void infohandler(int);
+@@ -626,7 +626,7 @@ DoFile(const char *savedir, const char *device)
+ if (compress) {
+ snprintf(corename, sizeof(corename), "%s.%d.gz",
+ istextdump ? "textdump.tar" : "vmcore", bounds);
+- fp = zopen(corename, "w");
++ fp = gzopen(corename, "w");
+ } else {
+ snprintf(corename, sizeof(corename), "%s.%d",
+ istextdump ? "textdump.tar" : "vmcore", bounds);
diff --git a/sys-freebsd/freebsd-sbin/files/freebsd-sbin-6.1-pr102701.patch b/sys-freebsd/freebsd-sbin/files/freebsd-sbin-6.1-pr102701.patch
new file mode 100644
index 00000000000..7b9578c40c8
--- /dev/null
+++ b/sys-freebsd/freebsd-sbin/files/freebsd-sbin-6.1-pr102701.patch
@@ -0,0 +1,17 @@
+Solves the issue reported in Problem Report bin/102701.
+
+Can't delete an inet6 alias address from an interface.
+
+Index: fbsd-6.1/sbin/ifconfig/af_inet6.c
+===================================================================
+--- fbsd-6.1.orig/sbin/ifconfig/af_inet6.c
++++ fbsd-6.1/sbin/ifconfig/af_inet6.c
+@@ -515,7 +515,7 @@ static struct afswtch af_inet6 = {
+ .af_settunnel = in6_set_tunnel,
+ .af_difaddr = SIOCDIFADDR_IN6,
+ .af_aifaddr = SIOCAIFADDR_IN6,
+- .af_ridreq = &in6_addreq,
++ .af_ridreq = &in6_ridreq,
+ .af_addreq = &in6_addreq,
+ };
+
diff --git a/sys-freebsd/freebsd-sbin/files/freebsd-sbin-6.2-ldconfig.patch b/sys-freebsd/freebsd-sbin/files/freebsd-sbin-6.2-ldconfig.patch
new file mode 100644
index 00000000000..81ad0246168
--- /dev/null
+++ b/sys-freebsd/freebsd-sbin/files/freebsd-sbin-6.2-ldconfig.patch
@@ -0,0 +1,13 @@
+diff -ur sbin.orig/ldconfig/elfhints.c sbin/ldconfig/elfhints.c
+--- sbin.orig/ldconfig/elfhints.c 2001-05-03 00:56:18 +0100
++++ sbin/ldconfig/elfhints.c 2007-08-06 10:16:24 +0100
+@@ -245,6 +245,9 @@
+ else
+ add_dir(hintsfile, argv[i], 0);
+ }
++ /* Always add our system dirs */
++ add_dir (hintsfile, "/lib", 1);
++ add_dir (hintsfile, "/usr/lib", 1);
+ write_elf_hints(hintsfile);
+ }
+
diff --git a/sys-freebsd/freebsd-sbin/files/freebsd-sbin-7.1-zlib.patch b/sys-freebsd/freebsd-sbin/files/freebsd-sbin-7.1-zlib.patch
new file mode 100644
index 00000000000..22fb2ec62d4
--- /dev/null
+++ b/sys-freebsd/freebsd-sbin/files/freebsd-sbin-7.1-zlib.patch
@@ -0,0 +1,21 @@
+diff -ur sbin/savecore/savecore.c sbin-zlib/savecore/savecore.c
+--- sbin/savecore/savecore.c 2005-02-26 01:21:50 +0000
++++ sbin-zlib/savecore/savecore.c 2005-05-06 12:00:06 +0000
+@@ -95,7 +95,7 @@
+ static int checkfor, compress, clear, force, keep, verbose; /* flags */
+ static int nfound, nsaved, nerr; /* statistics */
+
+-extern FILE *zopen(const char *, const char *);
++extern FILE *gzopen(const char *, const char *);
+
+ static void
+ printheader(FILE *f, const struct kerneldumpheader *h, const char *device,
+@@ -553,7 +553,7 @@
+ if (compress) {
+ sprintf(filename, "%s.%d.gz", istextdump ? "textdump.tar" :
+ "vmcore", bounds);
+- fp = zopen(filename, "w");
++ fp = gzopen(filename, "w");
+ } else {
+ sprintf(filename, "%s.%d", istextdump ? "textdump.tar" :
+ "vmcore", bounds);
diff --git a/sys-freebsd/freebsd-sbin/files/freebsd-sbin-bsdxml2expat.patch b/sys-freebsd/freebsd-sbin/files/freebsd-sbin-bsdxml2expat.patch
new file mode 100644
index 00000000000..bdda99b8c0d
--- /dev/null
+++ b/sys-freebsd/freebsd-sbin/files/freebsd-sbin-bsdxml2expat.patch
@@ -0,0 +1,13 @@
+diff -uNr sbin/ifconfig.old/regdomain.c sbin/ifconfig/regdomain.c
+--- sbin/ifconfig.old/regdomain.c 2010-12-21 17:09:25.000000000 +0000
++++ sbin/ifconfig/regdomain.c 2011-07-10 15:56:27.000000000 +0000
+@@ -39,7 +39,7 @@
+ #include <err.h>
+ #include <unistd.h>
+
+-#include <bsdxml.h>
++#include <expat.h>
+
+ #include "regdomain.h"
+
+Los ficheros binarios sbin/ifconfig.old/regdomain.o y sbin/ifconfig/regdomain.o son distintos
diff --git a/sys-freebsd/freebsd-sbin/files/freebsd-sbin-setXid.patch b/sys-freebsd/freebsd-sbin/files/freebsd-sbin-setXid.patch
new file mode 100644
index 00000000000..c8cbebc68c2
--- /dev/null
+++ b/sys-freebsd/freebsd-sbin/files/freebsd-sbin-setXid.patch
@@ -0,0 +1,20 @@
+diff -ur sbin.orig/ping/Makefile sbin.setXid/ping/Makefile
+--- sbin.orig/ping/Makefile Thu Apr 7 20:27:57 2005
++++ sbin.setXid/ping/Makefile Thu Apr 7 20:42:02 2005
+@@ -18,4 +18,6 @@
+ LDADD+= -lipsec
+ .endif
+
++LDFLAGS+= -Wl,-z,now
++
+ .include <bsd.prog.mk>
+diff -ur sbin.orig/shutdown/Makefile sbin.setXid/shutdown/Makefile
+--- sbin.orig/shutdown/Makefile Thu Apr 7 20:27:57 2005
++++ sbin.setXid/shutdown/Makefile Thu Apr 7 20:42:17 2005
+@@ -7,4 +7,6 @@
+ BINGRP= operator
+ BINMODE=4550
+
++LDFLAGS+= -Wl,-z,now
++
+ .include <bsd.prog.mk>
diff --git a/sys-freebsd/freebsd-sbin/files/idmapd.initd b/sys-freebsd/freebsd-sbin/files/idmapd.initd
new file mode 100755
index 00000000000..407b0e87f85
--- /dev/null
+++ b/sys-freebsd/freebsd-sbin/files/idmapd.initd
@@ -0,0 +1,20 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need rpcbind
+}
+
+start() {
+ ebegin "Starting NFS idmapd"
+ start-stop-daemon --start --quiet --exec \
+ /sbin/idmapd -- $idmapdopts
+ eend $? "Error starting NFS idmapd"
+}
+
+stop() {
+ ebegin "Stopping NFS idmapd"
+ start-stop-daemon --stop --quiet --exec /sbin/idmapd
+ eend $? "Error stopping NFS idmapd"
+}
diff --git a/sys-freebsd/freebsd-sbin/files/ipfw.confd b/sys-freebsd/freebsd-sbin/files/ipfw.confd
new file mode 100644
index 00000000000..687f92da922
--- /dev/null
+++ b/sys-freebsd/freebsd-sbin/files/ipfw.confd
@@ -0,0 +1,10 @@
+# ipfw provides a stateful firewall.
+# This means we allow everything out, and if we have a connection we allow it
+# back in. This is very flexable and quite secure.
+
+# For ease of use, we allow auth and ssh ports through as well.
+# To override the list of allowed ports
+#PORTS_IN="auth ssh"
+
+# You may want to enable logging of denied connections
+#LOG_DENY="yes"
diff --git a/sys-freebsd/freebsd-sbin/files/ipfw.initd b/sys-freebsd/freebsd-sbin/files/ipfw.initd
new file mode 100644
index 00000000000..013400bfcf8
--- /dev/null
+++ b/sys-freebsd/freebsd-sbin/files/ipfw.initd
@@ -0,0 +1,110 @@
+#!/sbin/runscript
+# Copyright 2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# This is a nice client firewall script which should suit most desktop users.
+# We allow auth and ssh in by default.
+
+PORTS_IN=${PORTS_IN-auth ssh}
+
+opts="panic showstatus"
+
+depend() {
+ before net
+ provide firewall
+}
+
+ipfw() {
+ /sbin/ipfw -f -q "$@"
+}
+
+init() {
+ # Load the kernel module
+ if ! sysctl net.inet.ip.fw.enable=1 >/dev/null 2>/dev/null ; then
+ if ! kldload ipfw ; then
+ eend 1 "Unable to load firewall module"
+ return 1
+ fi
+ fi
+
+ ipfw flush
+
+ ipfw add allow all from any to any via lo0
+ ipfw add allow all from any to 127.0.0.0/8
+ ipfw add deny ip from 127.0.0.0/8 to any
+
+ ipfw add allow ipv6-icmp from :: to ff02::/16
+ ipfw add allow ipv6-icmp from fe80::/10 to fe80::/10
+ ipfw add allow ipv6-icmp from fe80::/10 to ff02::/16
+}
+
+start() {
+ local x= log=
+ ebegin "Starting firewall rules"
+ if ! init ; then
+ eend 1 "Failed to flush firewall ruleset"
+ return 1
+ fi
+
+ [ "${LOG_DENY}" = "yes" ] && log="log"
+
+ # Use a statefull firewall
+ ipfw add check-state
+
+ # Open our configured ports
+ if [ -n "${PORTS_IN}" ] ; then
+ local pin=
+ for x in ${PORTS_IN} ; do
+ pin="${pin}${pin:+,}${x}"
+ done
+ ipfw add allow tcp from any to me ${pin} established keep-state
+ ipfw add allow tcp from any to me6 ${pin} established keep-state
+ ipfw add allow tcp from any to me ${pin} setup keep-state
+ ipfw add allow tcp from any to me6 ${pin} setup keep-state
+ ipfw add allow udp from any to me ${pin} established
+ ipfw add allow udp from any to me ${pin} keep-state
+ ipfw add allow udp from any to me6 ${pin} established
+ ipfw add allow udp from any to me6 ${pin} keep-state
+ fi
+
+ # Nice flexable rules that disallow incoming except for stuff we
+ # have asked for, and allow all outgoing.
+ ipfw add allow tcp from me to any established keep-state
+ ipfw add allow tcp from me to any setup keep-state
+ ipfw add allow tcp from me6 to any established keep-state
+ ipfw add allow tcp from me6 to any setup keep-state
+ ipfw add deny ${log} tcp from any to any
+ ipfw add allow udp from me to any established
+ ipfw add allow udp from me to any keep-state
+ ipfw add allow udp from me6 to any established
+ ipfw add allow udp from me6 to any keep-state
+ ipfw add deny ${log} udp from any to any
+
+ # Be a good firewall and allow some ICMP traffic.
+ # Remove 8 if you really want to disallow ping.
+ ipfw add allow icmp from any to any icmptypes 0,3,8,11,12
+ ipfw add allow ip6 from any to any proto ipv6-icmp
+
+ eend 0
+}
+
+stop() {
+ ebegin "Stopping firewall rules"
+ # We don't unload the kernel module as that action
+ # can cause memory leaks as of FreeBSD 6.x
+ sysctl net.inet.ip.fw.enable=0 >/dev/null
+ eend $?
+}
+
+panic() {
+ ebegin "Stopping firewall rules - hard"
+ if ! init ; then
+ eend 1 "Failed to flush firewall ruleset"
+ return 1
+ fi
+ eend 0
+}
+
+showstatus() {
+ ipfw show
+}
diff --git a/sys-freebsd/freebsd-sbin/files/sysctl.initd b/sys-freebsd/freebsd-sbin/files/sysctl.initd
new file mode 100644
index 00000000000..f8a2469ae4d
--- /dev/null
+++ b/sys-freebsd/freebsd-sbin/files/sysctl.initd
@@ -0,0 +1,28 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ after checkroot root
+}
+
+start() {
+ ebegin "Configuring kernel parameters"
+
+ if [ ! -f /etc/sysctl.conf ]; then
+ eend 1 "/etc/sysctl.conf" "not found"
+ return 1
+ fi
+
+ local retval=0 var= comments=
+ while read var comments ; do
+ case "${var}" in
+ ""|"#"*) continue;;
+ esac
+ sysctl "${var}" >/dev/null || retval=1
+ done < /etc/sysctl.conf
+ eend ${retval} "Some errors were encountered"
+}
+
+# vim: set ts=4 :
diff --git a/sys-freebsd/freebsd-sbin/freebsd-sbin-10.1-r1.ebuild b/sys-freebsd/freebsd-sbin/freebsd-sbin-10.1-r1.ebuild
new file mode 100644
index 00000000000..490bd63bf3e
--- /dev/null
+++ b/sys-freebsd/freebsd-sbin/freebsd-sbin-10.1-r1.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit bsdmk freebsd multilib
+
+DESCRIPTION="FreeBSD sbin utils"
+SLOT="0"
+
+# Security Advisory and Errata patches.
+UPSTREAM_PATCHES=( "SA-15:19/routed.patch" )
+
+if [[ ${PV} != *9999* ]]; then
+ KEYWORDS="~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+ SRC_URI="${SRC_URI}
+ $(freebsd_upstream_patches)"
+fi
+
+EXTRACTONLY="
+ sbin/
+ contrib/
+ lib/
+ libexec/
+ usr.sbin/
+ etc/
+"
+use build && EXTRACTONLY+="sys/"
+
+RDEPEND="=sys-freebsd/freebsd-lib-${RV}*[ipv6?,atm?,netware?]
+ =sys-freebsd/freebsd-libexec-${RV}*
+ >=dev-libs/expat-2.0.1
+ ssl? ( dev-libs/openssl )
+ >=dev-libs/libedit-20120311.3.0-r1
+ sys-libs/readline
+ || (
+ sys-process/cronie
+ sys-process/vixie-cron
+ )
+ atm? ( net-analyzer/bsnmp )"
+DEPEND="${RDEPEND}
+ !build? ( =sys-freebsd/freebsd-sources-${RV}* )
+ =sys-freebsd/freebsd-mk-defs-${RV}*"
+
+S="${WORKDIR}/sbin"
+
+IUSE="atm ipfilter +pf ipv6 build ssl +cxx netware"
+
+pkg_setup() {
+ use atm || mymakeopts="${mymakeopts} WITHOUT_ATM= "
+ use cxx || mymakeopts="${mymakeopts} WITHOUT_CXX="
+ use ipfilter || mymakeopts="${mymakeopts} WITHOUT_IPFILTER= "
+ use ipv6 || mymakeopts="${mymakeopts} WITHOUT_INET6= WITHOUT_INET6_SUPPORT="
+ use netware || mymakeopts="${mymakeopts} WITHOUT_IPX= WITHOUT_IPX_SUPPORT= WITHOUT_NCP= "
+ use pf || mymakeopts="${mymakeopts} WITHOUT_PF= "
+ use ssl || mymakeopts="${mymakeopts} WITHOUT_OPENSSL="
+}
+
+REMOVE_SUBDIRS="dhclient pfctl pflogd rcorder resolvconf"
+
+PATCHES=( "${FILESDIR}/${PN}-setXid.patch"
+ "${FILESDIR}/${PN}-10.0-zlib.patch"
+ "${FILESDIR}/${PN}-6.2-ldconfig.patch"
+ "${FILESDIR}/${PN}-6.1-pr102701.patch"
+ "${FILESDIR}/${PN}-bsdxml2expat.patch" )
+
+src_prepare() {
+ if [[ ! -e "${WORKDIR}/sys" ]]; then
+ use build || ln -s "/usr/src/sys" "${WORKDIR}/sys"
+ fi
+}
+
+src_install() {
+ mymakeopts="${mymakeopts} GEOM_CLASS_DIR=/$(get_libdir)/geom "
+ freebsd_src_install
+ keepdir /var/log
+ # Needed by ldconfig:
+ keepdir /var/run
+
+ # Maybe ship our own sysctl.conf so things like radvd work out of the box.
+ # New wireless config method requires regdomain.xml in /etc
+ cd "${WORKDIR}/etc/"
+ insinto /etc
+ doins minfree sysctl.conf regdomain.xml || die
+
+ # Install a crontab for adjkerntz
+ insinto /etc/cron.d
+ newins "${FILESDIR}/adjkerntz-crontab" adjkerntz
+
+ # Install the periodic stuff (needs probably to be ported in a more
+ # gentooish way)
+ cd "${WORKDIR}/etc/periodic"
+
+ doperiodic security \
+ security/*.ipfwlimit \
+ security/*.ipfwdenied || die
+
+ use ipfilter && { doperiodic security \
+ security/*.ipfdenied || die ; }
+
+ use pf && { doperiodic security \
+ security/*.pfdenied || die ; }
+}
diff --git a/sys-freebsd/freebsd-sbin/freebsd-sbin-8.2-r1.ebuild b/sys-freebsd/freebsd-sbin/freebsd-sbin-8.2-r1.ebuild
new file mode 100644
index 00000000000..656a04eb3f6
--- /dev/null
+++ b/sys-freebsd/freebsd-sbin/freebsd-sbin-8.2-r1.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit bsdmk freebsd
+
+DESCRIPTION="FreeBSD sbin utils"
+KEYWORDS="~sparc-fbsd ~x86-fbsd"
+SLOT="0"
+
+SRC_URI="mirror://gentoo/${SBIN}.tar.bz2
+ mirror://gentoo/${CONTRIB}.tar.bz2
+ mirror://gentoo/${LIB}.tar.bz2
+ mirror://gentoo/${LIBEXEC}.tar.bz2
+ mirror://gentoo/${USBIN}.tar.bz2
+ mirror://gentoo/${ETC}.tar.bz2
+ build? ( mirror://gentoo/${SYS}.tar.bz2 )"
+
+RDEPEND="=sys-freebsd/freebsd-lib-${RV}*[ipv6?,atm?,netware?]
+ =sys-freebsd/freebsd-libexec-${RV}*
+ >=dev-libs/expat-2.0.1
+ ssl? ( dev-libs/openssl )
+ dev-libs/libedit
+ sys-libs/readline
+ || (
+ sys-process/cronie
+ sys-process/vixie-cron
+ )
+ atm? ( net-analyzer/bsnmp )"
+DEPEND="${RDEPEND}
+ !build? ( =sys-freebsd/freebsd-sources-${RV}* )
+ =sys-freebsd/freebsd-mk-defs-${RV}*"
+
+S="${WORKDIR}/sbin"
+
+IUSE="atm ipfilter +pf ipv6 build ssl +cxx netware"
+
+pkg_setup() {
+ use atm || mymakeopts="${mymakeopts} WITHOUT_ATM= "
+ use cxx || mymakeopts="${mymakeopts} WITHOUT_CXX="
+ use ipfilter || mymakeopts="${mymakeopts} WITHOUT_IPFILTER= "
+ use ipv6 || mymakeopts="${mymakeopts} WITHOUT_INET6= WITHOUT_INET6_SUPPORT="
+ use netware || mymakeopts="${mymakeopts} WITHOUT_IPX= WITHOUT_IPX_SUPPORT= WITHOUT_NCP= "
+ use pf || mymakeopts="${mymakeopts} WITHOUT_PF= "
+ use ssl || mymakeopts="${mymakeopts} WITHOUT_OPENSSL="
+}
+
+REMOVE_SUBDIRS="dhclient pfctl pflogd rcorder"
+
+PATCHES=( "${FILESDIR}/${PN}-setXid.patch"
+ "${FILESDIR}/${PN}-7.1-zlib.patch"
+ "${FILESDIR}/${PN}-6.2-ldconfig.patch"
+ "${FILESDIR}/${PN}-6.1-pr102701.patch"
+ "${FILESDIR}/${PN}-bsdxml2expat.patch" )
+
+src_prepare() {
+ use build || ln -s "/usr/src/sys-${RV}" "${WORKDIR}/sys"
+}
+
+src_install() {
+ freebsd_src_install
+ keepdir /var/log
+ # Needed by ldconfig:
+ keepdir /var/run
+
+ # Maybe ship our own sysctl.conf so things like radvd work out of the box.
+ # New wireless config method requires regdomain.xml in /etc
+ cd "${WORKDIR}/etc/"
+ insinto /etc
+ doins minfree sysctl.conf regdomain.xml || die
+
+ # initd script for idmapd
+ newinitd "${FILESDIR}/idmapd.initd" idmapd
+
+ # Install a crontab for adjkerntz
+ insinto /etc/cron.d
+ newins "${FILESDIR}/adjkerntz-crontab" adjkerntz
+
+ # Install the periodic stuff (needs probably to be ported in a more
+ # gentooish way)
+ cd "${WORKDIR}/etc/periodic"
+
+ doperiodic security \
+ security/*.ipfwlimit \
+ security/*.ipfwdenied || die
+
+ use ipfilter && { doperiodic security \
+ security/*.ipfdenied || die ; }
+
+ use pf && { doperiodic security \
+ security/*.pfdenied || die ; }
+}
diff --git a/sys-freebsd/freebsd-sbin/freebsd-sbin-9.1.ebuild b/sys-freebsd/freebsd-sbin/freebsd-sbin-9.1.ebuild
new file mode 100644
index 00000000000..8f84f357489
--- /dev/null
+++ b/sys-freebsd/freebsd-sbin/freebsd-sbin-9.1.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit bsdmk freebsd multilib
+
+DESCRIPTION="FreeBSD sbin utils"
+KEYWORDS="~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+SLOT="0"
+
+SRC_URI="mirror://gentoo/${SBIN}.tar.bz2
+ mirror://gentoo/${CONTRIB}.tar.bz2
+ mirror://gentoo/${LIB}.tar.bz2
+ mirror://gentoo/${LIBEXEC}.tar.bz2
+ mirror://gentoo/${USBIN}.tar.bz2
+ mirror://gentoo/${ETC}.tar.bz2
+ build? ( mirror://gentoo/${SYS}.tar.bz2 )"
+
+RDEPEND="=sys-freebsd/freebsd-lib-${RV}*[ipv6?,atm?,netware?]
+ =sys-freebsd/freebsd-libexec-${RV}*
+ >=dev-libs/expat-2.0.1
+ ssl? ( dev-libs/openssl )
+ >=dev-libs/libedit-20120311.3.0-r1
+ sys-libs/readline
+ || (
+ sys-process/cronie
+ sys-process/vixie-cron
+ )
+ atm? ( net-analyzer/bsnmp )"
+DEPEND="${RDEPEND}
+ !build? ( =sys-freebsd/freebsd-sources-${RV}* )
+ =sys-freebsd/freebsd-mk-defs-${RV}*"
+
+S="${WORKDIR}/sbin"
+
+IUSE="atm ipfilter +pf ipv6 build ssl +cxx netware"
+
+pkg_setup() {
+ use atm || mymakeopts="${mymakeopts} WITHOUT_ATM= "
+ use cxx || mymakeopts="${mymakeopts} WITHOUT_CXX="
+ use ipfilter || mymakeopts="${mymakeopts} WITHOUT_IPFILTER= "
+ use ipv6 || mymakeopts="${mymakeopts} WITHOUT_INET6= WITHOUT_INET6_SUPPORT="
+ use netware || mymakeopts="${mymakeopts} WITHOUT_IPX= WITHOUT_IPX_SUPPORT= WITHOUT_NCP= "
+ use pf || mymakeopts="${mymakeopts} WITHOUT_PF= "
+ use ssl || mymakeopts="${mymakeopts} WITHOUT_OPENSSL="
+}
+
+REMOVE_SUBDIRS="dhclient pfctl pflogd rcorder resolvconf"
+
+PATCHES=( "${FILESDIR}/${PN}-setXid.patch"
+ "${FILESDIR}/${PN}-7.1-zlib.patch"
+ "${FILESDIR}/${PN}-6.2-ldconfig.patch"
+ "${FILESDIR}/${PN}-6.1-pr102701.patch"
+ "${FILESDIR}/${PN}-bsdxml2expat.patch" )
+
+src_prepare() {
+ use build || ln -s "/usr/src/sys-${RV}" "${WORKDIR}/sys"
+}
+
+src_install() {
+ mymakeopts="${mymakeopts} GEOM_CLASS_DIR=/$(get_libdir)/geom "
+ freebsd_src_install
+ keepdir /var/log
+ # Needed by ldconfig:
+ keepdir /var/run
+
+ # Maybe ship our own sysctl.conf so things like radvd work out of the box.
+ # New wireless config method requires regdomain.xml in /etc
+ cd "${WORKDIR}/etc/"
+ insinto /etc
+ doins minfree sysctl.conf regdomain.xml || die
+
+ # initd script for idmapd
+ newinitd "${FILESDIR}/idmapd.initd" idmapd
+
+ # Install a crontab for adjkerntz
+ insinto /etc/cron.d
+ newins "${FILESDIR}/adjkerntz-crontab" adjkerntz
+
+ # Install the periodic stuff (needs probably to be ported in a more
+ # gentooish way)
+ cd "${WORKDIR}/etc/periodic"
+
+ doperiodic security \
+ security/*.ipfwlimit \
+ security/*.ipfwdenied || die
+
+ use ipfilter && { doperiodic security \
+ security/*.ipfdenied || die ; }
+
+ use pf && { doperiodic security \
+ security/*.pfdenied || die ; }
+}
diff --git a/sys-freebsd/freebsd-sbin/metadata.xml b/sys-freebsd/freebsd-sbin/metadata.xml
new file mode 100644
index 00000000000..f0b8ec2a77b
--- /dev/null
+++ b/sys-freebsd/freebsd-sbin/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>bsd</herd>
+ <use>
+ <flag name='ipfilter'>
+ Build tools to administer the ipfilter firewall.
+ </flag>
+ <flag name='pf'>
+ Build tools to administer the PF firewall.
+ </flag>
+ <flag name='netware'>
+ Build libraries and tools to work with NetWare protocols (IPX
+ and NCP).
+ </flag>
+ </use>
+</pkgmetadata>