aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Stephen P. Bennett <spb@exherbo.org> 2006-02-16 17:56:15 +0000
committerAvatar Stephen P. Bennett <spb@exherbo.org> 2006-02-16 17:56:15 +0000
commitb5a8c3a890b9ad24d8c0aa5f8efb49c60f0c79a8 (patch)
tree70fa30a177bb46f7c1bb7b1bbcf2a8654b54eeef
parent5640dc6d426dcb3a354bc06cede6ea33f1e9cfc0 (diff)
downloadpaludis-b5a8c3a890b9ad24d8c0aa5f8efb49c60f0c79a8.tar.gz
paludis-b5a8c3a890b9ad24d8c0aa5f8efb49c60f0c79a8.tar.xz
Add ebuild helpers
-rw-r--r--ebuild/utils/dobin48
-rw-r--r--ebuild/utils/doconfd30
-rw-r--r--ebuild/utils/dodir34
-rw-r--r--ebuild/utils/dodoc55
-rw-r--r--ebuild/utils/doenvd30
-rw-r--r--ebuild/utils/doexe58
-rw-r--r--ebuild/utils/dohard34
-rw-r--r--ebuild/utils/dohtml26
-rw-r--r--ebuild/utils/doinfo55
-rw-r--r--ebuild/utils/doinitd30
-rw-r--r--ebuild/utils/doins87
-rw-r--r--ebuild/utils/dolib62
-rw-r--r--ebuild/utils/dolib.a24
-rw-r--r--ebuild/utils/dolib.so24
-rw-r--r--ebuild/utils/doman84
-rw-r--r--ebuild/utils/domo54
-rw-r--r--ebuild/utils/donewins36
-rw-r--r--ebuild/utils/dosbin45
-rw-r--r--ebuild/utils/dosed52
-rw-r--r--ebuild/utils/dosym34
-rw-r--r--ebuild/utils/fowners24
-rw-r--r--ebuild/utils/fperms24
-rw-r--r--ebuild/utils/newbin36
-rw-r--r--ebuild/utils/newconfd36
-rw-r--r--ebuild/utils/newdoc36
-rw-r--r--ebuild/utils/newenvd36
-rw-r--r--ebuild/utils/newexe36
-rw-r--r--ebuild/utils/newinitd36
-rw-r--r--ebuild/utils/newins36
-rw-r--r--ebuild/utils/newlib.a36
-rw-r--r--ebuild/utils/newlib.so36
-rw-r--r--ebuild/utils/newman36
-rw-r--r--ebuild/utils/newsbin36
33 files changed, 1346 insertions, 0 deletions
diff --git a/ebuild/utils/dobin b/ebuild/utils/dobin
new file mode 100644
index 0000000..506f50f
--- /dev/null
+++ b/ebuild/utils/dobin
@@ -0,0 +1,48 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dobin from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+if [[ ! -d "${D}${DESTTREE}/bin" ]]; then
+ install -d "${D}${DESTTREE}/bin" || exit 3
+fi
+
+ret=0
+for x in "$@" ; do
+ if [[ -x "${x}" ]]; then
+ install "${x}" "${D}${DESTTREE}/bin" || ret=2
+ else
+ echo ">>> ${0}: making ${x} executable..."
+ install -m0755 -o root -g 0 "${x}" "${D}${DESTTREE}/bin" || ret=2
+ fi
+done
+
+exit ${ret}
diff --git a/ebuild/utils/doconfd b/ebuild/utils/doconfd
new file mode 100644
index 0000000..902ef52
--- /dev/null
+++ b/ebuild/utils/doconfd
@@ -0,0 +1,30 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon doconfd from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [ ${#} -lt 1 ]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+INSDESTTREE=/etc/conf.d/
+doins "$@" || exit 2
diff --git a/ebuild/utils/dodir b/ebuild/utils/dodir
new file mode 100644
index 0000000..52b7c20
--- /dev/null
+++ b/ebuild/utils/dodir
@@ -0,0 +1,34 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dodir from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+ret=0
+for x in "$@"; do
+ install -d ${DIROPTIONS} "${D}${x}" || ret=2
+done
+
+exit ${ret}
diff --git a/ebuild/utils/dodoc b/ebuild/utils/dodoc
new file mode 100644
index 0000000..bfff299
--- /dev/null
+++ b/ebuild/utils/dodoc
@@ -0,0 +1,55 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dodoc from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ $# -lt 1 ]]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+if [[ -z ${PALUDIS_COMPRESS} ]]; then
+ PALUDIS_COMPRESS="gzip -f -9"
+fi
+
+dir="${D}usr/share/doc/${PF}/${DOCDESTTREE}"
+if [[ ! -d "${dir}" ]]; then
+ install -d "${dir}" || exit 3
+fi
+
+ret=0
+
+for x in "$@"; do
+ if [[ -s "${x}" ]]; then
+ install -m0644 "${x}" "${dir}"
+ ${PALUDIS_COMPRESS} "${dir}/${x##*/}"
+ elif [[ ! -e "${x}" ]]; then
+ echo "${0}: ${x} does not exist" >&2
+ ret=2
+ fi
+done
+
+exit ${ret}
diff --git a/ebuild/utils/doenvd b/ebuild/utils/doenvd
new file mode 100644
index 0000000..1fff4c6
--- /dev/null
+++ b/ebuild/utils/doenvd
@@ -0,0 +1,30 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon doenvd from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+INSTDESTTREE=/etc/env.d/
+doins "$@"
diff --git a/ebuild/utils/doexe b/ebuild/utils/doexe
new file mode 100644
index 0000000..a67166b
--- /dev/null
+++ b/ebuild/utils/doexe
@@ -0,0 +1,58 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon doexe from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed"
+ exit 1
+fi
+
+if [[ ! -d "${D}${EXEDESTTREE}" ]]; then
+ install -d "${D}${EXEDESTTREE}" || exit 3
+fi
+
+ret=0
+
+for x in "$@"; do
+ if [[ -L ${x} ]]; then
+ cp "${x}" "${T}"
+ mysrc="${T}/$(/usr/bin/basename "${x}")"
+ elif [[ -d ${x} ]]; then
+ echo "${0}: skipping directory ${x}" >&2
+ continue
+ else
+ mysrc="${x}"
+ fi
+ install ${EXEOPTIONS} "${mysrc}" "${D}${EXEDESTTREE}" || ret=2
+done
+
+exit ${ret}
diff --git a/ebuild/utils/dohard b/ebuild/utils/dohard
new file mode 100644
index 0000000..b0758e5
--- /dev/null
+++ b/ebuild/utils/dohard
@@ -0,0 +1,34 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dohard from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+ln -f "${D}${1}" "${D}${2}"
diff --git a/ebuild/utils/dohtml b/ebuild/utils/dohtml
new file mode 100644
index 0000000..ca38854
--- /dev/null
+++ b/ebuild/utils/dohtml
@@ -0,0 +1,26 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dohtml from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+echo "spb still needs to implement dohtml." >&2
+kill $PPID
+exit 1
diff --git a/ebuild/utils/doinfo b/ebuild/utils/doinfo
new file mode 100644
index 0000000..746812c
--- /dev/null
+++ b/ebuild/utils/doinfo
@@ -0,0 +1,55 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon doinfo from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 1
+fi
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+if [[ ! -d "${D}usr/share/info" ]]; then
+ install -d "${D}usr/share/info" || exit 3
+fi
+
+if [[ -z ${PALUDIS_COMPRESS} ]]; then
+ PALUDIS_COMPRESS="gzip -f -9"
+fi
+
+ret=0
+
+for x in "$@"; do
+ if [[ -e "${x}" ]]; then
+ install -m0644 "${x}" "${D}usr/share/info"
+ ${PALUDIS_COMPRESS} "${D}usr/share/info/$(basename "${x}")"
+ else
+ echo "${0}: ${x} does not exist"
+ ret=2
+ fi
+done
+
+exit ${ret}
+
diff --git a/ebuild/utils/doinitd b/ebuild/utils/doinitd
new file mode 100644
index 0000000..8a264f6
--- /dev/null
+++ b/ebuild/utils/doinitd
@@ -0,0 +1,30 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon doinitd from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+EXEDESTTREE=/etc/init.d
+doexe "$@"
diff --git a/ebuild/utils/doins b/ebuild/utils/doins
new file mode 100644
index 0000000..7f6ad11
--- /dev/null
+++ b/ebuild/utils/doins
@@ -0,0 +1,87 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon doins from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+if [[ ${1} == "-r" ]]; then
+ DOINSRECUR=y
+ shift
+else
+ DOINSRECUR=n
+fi
+
+if [[ -z "${INSDEPTH}" ]]; then
+ declare -i INSDEPTH=0
+fi
+
+if [[ ${INSDESTTREE} == ${D}* ]]; then
+ echo "-------------------------------------------------------" >&2
+ echo "You should not use \${D} with helpers." >&2
+ echo " --> ${INSDESTTREE}" >&2
+ echo "-------------------------------------------------------" >&2
+ exit 248
+fi
+
+if [[ ! -d "${D}${INSDESTTREE}" ]]; then
+ dodir "${INSDESTTREE}"
+fi
+
+ret=0
+
+for x in "$@"; do
+ if [[ -L ${x} ]]; then
+ cp "${x}" "${T}"
+ mysrc="${T}/$(basename "${x}")"
+ elif [[ -d ${x} ]]; then
+ if [[ ${DOINSRECUR} == "n" ]]; then
+ continue
+ fi
+
+ mydir="${INSDESTTREE}/$(basename "${x}")"
+ find "${x}" -mindepth 1 -maxdepth 1 -exec \
+ env \
+ INSDESTTREE="${mydir}" \
+ INSDEPTH=$((INSDEPTH+1)) \
+ doins -r {} \;
+ continue
+ else
+ mysrc="${x}"
+ fi
+
+ install ${INSOPTIONS} "${mysrc}" "${D}${INSDESTTREE}" || ret=2
+done
+
+exit ${ret}
diff --git a/ebuild/utils/dolib b/ebuild/utils/dolib
new file mode 100644
index 0000000..c35b202
--- /dev/null
+++ b/ebuild/utils/dolib
@@ -0,0 +1,62 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dolib from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ! -d ${PALUDIS_EBUILD_MODULES_DIR} ]]; then
+ echo "${0}: \${PALUDIS_EBUILD_MODULES_DIR} not valid; aborting" >&2
+ exit 1
+fi
+
+source "${PALUDIS_EBUILD_MODULES_DIR}/multilib_functions.bash"
+
+libdir="${D}${DESTTREE}/$(ebuild_get_libdir)"
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed"
+ exit 1
+fi
+
+if [[ ! -d ${libdir} ]]; then
+ install -d "${libdir}" || exit 3
+fi
+
+ret=0
+
+for x in "$@"; do
+ if [[ -e ${x} ]]; then
+ if [[ ! -L ${x} ]]; then
+ install ${LIBOPTIONS} "${x}" "${libdir}" || ret=2
+ else
+ ln -s "$(readlink "${x}")" "${libdir}/$(basename "${x}")" || ret=2
+ fi
+ else
+ echo "${0}: ${x} does not exist"
+ ret=2
+ fi
+done
+
+exit ${ret}
diff --git a/ebuild/utils/dolib.a b/ebuild/utils/dolib.a
new file mode 100644
index 0000000..51493db
--- /dev/null
+++ b/ebuild/utils/dolib.a
@@ -0,0 +1,24 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dolib.a from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+LIBOPTIONS="-m0644" dolib "$@"
diff --git a/ebuild/utils/dolib.so b/ebuild/utils/dolib.so
new file mode 100644
index 0000000..34ec8ed
--- /dev/null
+++ b/ebuild/utils/dolib.so
@@ -0,0 +1,24 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dolib.so from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+LIBOPTIONS="-m0755" dolib "$@"
diff --git a/ebuild/utils/doman b/ebuild/utils/doman
new file mode 100644
index 0000000..db13a18
--- /dev/null
+++ b/ebuild/utils/doman
@@ -0,0 +1,84 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon doman from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+if [[ -z ${PALUDIS_COMPRESS} ]]; then
+ PALUDIS_COMPRESS="gzip -f -9"
+fi
+
+BASE="/usr/share"
+i18n=""
+
+for x in "$@"; do
+ if [[ ${x:0:6} == "-i18n=" ]]; then
+ i18n="${x:6}/"
+ continue
+ fi
+ if [[ ${x} == .keep ]]; then
+ continue
+ fi
+
+ suffix=${x##*.}
+
+ if [[ ${suffix} == "gz" ]]; then
+ compressed="gz"
+ realname=${x%.*}
+ suffix=${realname##*.}
+ else
+ realname=${x}
+ compressed=""
+ fi
+
+ mandir="${i18n}man${suffix:0:1}"
+
+ if [[ ${mandir} =~ 'man[0-9n](|f|p|pm)$' ]]; then
+ if [[ -s ${x} ]]; then
+ if [[ ! -d "${D}${BASE}/man/${mandir}" ]]; then
+ install -d "${D}${BASE}/man/${mandir}"
+ fi
+
+ install -m0644 "${x}" "${D}${BASE}/man/${mandir}" || ret=2
+
+ if [[ -z ${compressed} ]]; then
+ ${PALUDIS_COMPRESS} "${D}${BASE}/man/${mandir}/$(basename "${x}")"
+ fi
+ else
+ echo "${0}: ${x} does not exist" >&2
+ ret=2
+ fi
+ else
+ echo "${0}: '${x}' is probably not a man page; skipping" >&2
+ ret=2
+ fi
+done
+
+exit ${ret}
diff --git a/ebuild/utils/domo b/ebuild/utils/domo
new file mode 100644
index 0000000..b7a0dd4
--- /dev/null
+++ b/ebuild/utils/domo
@@ -0,0 +1,54 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon domo from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+if [[ ! -d "${D}${DESTTREE}/share/locale" ]]; then
+ install -d "${D}${DESTTREE}/share/locale" || exit 3
+fi
+
+ret=0
+
+for x in "$@"; do
+ if [[ -e ${x} ]]; then
+ mytiny="$(basename "${x}")"
+ mydir="${D}${DESTTREE}/share/local/${mytiny%.*}/LC_MESSAGES"
+ if [[ ! -d ${mydir} ]]; then
+ install -d "${mydir}"
+ fi
+ install -m0644 "${x}" "${mydir}/${MOPREFIX}.mo" || ret=2
+ else
+ echo "${0}: ${x} does not exist" >&2
+ ret=2
+ fi
+done
+
+exit ${ret}
diff --git a/ebuild/utils/donewins b/ebuild/utils/donewins
new file mode 100644
index 0000000..d10ac1f
--- /dev/null
+++ b/ebuild/utils/donewins
@@ -0,0 +1,36 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon donewins from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed." >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+doins "${T}/${2}"
diff --git a/ebuild/utils/dosbin b/ebuild/utils/dosbin
new file mode 100644
index 0000000..25c6258
--- /dev/null
+++ b/ebuild/utils/dosbin
@@ -0,0 +1,45 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dosbin from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+if [[ ! -d "${D}${DESTTREE}/sbin" ]]; then
+ install -d "${D}${DESTTREE}/sbin" || exit 3
+fi
+
+for x in "$@"; do
+ if [[ -x ${x} ]]; then
+ install -m0755 "${x}" "${D}${DESTTREE}/sbin" || exit 2
+ else
+ echo ">>> dosbin: making ${x} executable..."
+ install -m0755 -o root -g 0 "${x}" "${D}${DESTTREE}/sbin" || exit 2
+ fi
+done
diff --git a/ebuild/utils/dosed b/ebuild/utils/dosed
new file mode 100644
index 0000000..ca9dc04
--- /dev/null
+++ b/ebuild/utils/dosed
@@ -0,0 +1,52 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dosed from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+mysed="s:${D}::g"
+
+ret=0
+
+for x in "$@"; do
+ y="${D}${x}"
+ if [[ -e ${y} ]]; then
+ if [[ -f "${y}" ]]; then
+ sed -i -e "${mysed}" "${y}" || ret=2
+ else
+ echo "${0}: ${y} is not a regular file"
+ ret=2
+ fi
+ else
+ mysed="${x}"
+ fi
+done
+
+exit ${ret}
diff --git a/ebuild/utils/dosym b/ebuild/utils/dosym
new file mode 100644
index 0000000..dffc44a
--- /dev/null
+++ b/ebuild/utils/dosym
@@ -0,0 +1,34 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dosym from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+ln -snf "${1}" "${D}${2}"
diff --git a/ebuild/utils/fowners b/ebuild/utils/fowners
new file mode 100644
index 0000000..b6ddd1a
--- /dev/null
+++ b/ebuild/utils/fowners
@@ -0,0 +1,24 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon fowners from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+chown "${@/#\//${D}\/}"
diff --git a/ebuild/utils/fperms b/ebuild/utils/fperms
new file mode 100644
index 0000000..6623dcb
--- /dev/null
+++ b/ebuild/utils/fperms
@@ -0,0 +1,24 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon fperms from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+chmod "${@/#\//${D}\/}"
diff --git a/ebuild/utils/newbin b/ebuild/utils/newbin
new file mode 100644
index 0000000..7a5b02c
--- /dev/null
+++ b/ebuild/utils/newbin
@@ -0,0 +1,36 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newbin from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+dobin "${T}/${2}"
diff --git a/ebuild/utils/newconfd b/ebuild/utils/newconfd
new file mode 100644
index 0000000..1fc7317
--- /dev/null
+++ b/ebuild/utils/newconfd
@@ -0,0 +1,36 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newconfd from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+doconfd "${T}/${2}"
diff --git a/ebuild/utils/newdoc b/ebuild/utils/newdoc
new file mode 100644
index 0000000..569e811
--- /dev/null
+++ b/ebuild/utils/newdoc
@@ -0,0 +1,36 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newdoc from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+dodoc "${T}/${2}"
diff --git a/ebuild/utils/newenvd b/ebuild/utils/newenvd
new file mode 100644
index 0000000..792f8e9
--- /dev/null
+++ b/ebuild/utils/newenvd
@@ -0,0 +1,36 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newenvd from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+doenvd "${T}/${2}"
diff --git a/ebuild/utils/newexe b/ebuild/utils/newexe
new file mode 100644
index 0000000..50814ea
--- /dev/null
+++ b/ebuild/utils/newexe
@@ -0,0 +1,36 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newexe from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+doexe "${T}/${2}"
diff --git a/ebuild/utils/newinitd b/ebuild/utils/newinitd
new file mode 100644
index 0000000..5e7e015
--- /dev/null
+++ b/ebuild/utils/newinitd
@@ -0,0 +1,36 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newinitd from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+doinitd "${T}/${2}"
diff --git a/ebuild/utils/newins b/ebuild/utils/newins
new file mode 100644
index 0000000..fa58890
--- /dev/null
+++ b/ebuild/utils/newins
@@ -0,0 +1,36 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newins from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+doins "${T}/${2}"
diff --git a/ebuild/utils/newlib.a b/ebuild/utils/newlib.a
new file mode 100644
index 0000000..3f8639b
--- /dev/null
+++ b/ebuild/utils/newlib.a
@@ -0,0 +1,36 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newlib.a from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+dolib.a "${T}/${2}"
diff --git a/ebuild/utils/newlib.so b/ebuild/utils/newlib.so
new file mode 100644
index 0000000..45ad691
--- /dev/null
+++ b/ebuild/utils/newlib.so
@@ -0,0 +1,36 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newlib.so from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+dolib.so "${T}/${2}"
diff --git a/ebuild/utils/newman b/ebuild/utils/newman
new file mode 100644
index 0000000..85bb8a1
--- /dev/null
+++ b/ebuild/utils/newman
@@ -0,0 +1,36 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newman from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+doman "${T}/${2}"
diff --git a/ebuild/utils/newsbin b/ebuild/utils/newsbin
new file mode 100644
index 0000000..ccecac2
--- /dev/null
+++ b/ebuild/utils/newsbin
@@ -0,0 +1,36 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newsbin from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+dosbin "${T}/${2}"