Skip to content

Commit

Permalink
New directory structure, based on official svn
Browse files Browse the repository at this point in the history
  • Loading branch information
William Grzybowski committed Jul 5, 2012
1 parent 75211e4 commit 043b677
Show file tree
Hide file tree
Showing 48 changed files with 487 additions and 13 deletions.
199 changes: 199 additions & 0 deletions nanobsd/plugins/bacula
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
#
# bacula - nanobsd build script for bacula
#

#
# NanoBSD stuff
#
CONF_BUILD=""
CONF_INSTALL="${CONF_BUILD}"

. ${NANO_CFG_BASE}/common

#
# PBI chroot build flags
#
PBI_BUILDFLAGS="-j ${MAKE_JOBS}"
export PBI_BUILDFLAGS

#
# Name of this plugin
#
PLUGIN="bacula"

#
# Path to pbi_makeport
#
PBIMAKEPORT=$(which pbi_makeport)
if [ ! -f "${PBIMAKEPORT}" ]
then
echo "${PLUGIN}: ${PBIMAKEPORT} does not exist!"
exit 1
fi
export PBIMAKEPORT

#
# Path to ports collection
#
PLUGINPORTSDIR="${AVATAR_ROOT}/FreeBSD/ports"
if [ ! -d "${PLUGINPORTSDIR}" ]
then
echo "${PLUGIN}: ${PLUGINSPORTDIR} does not exist!"
exit 1
fi
export PLUGINPORTSDIR

#
# Path to port directory
#
PLUGINPORT="${PLUGINPORTSDIR}/net-p2p/bacula-daemon"
if [ ! -d "${PLUGINPORT}" ]
then
echo "${PLUGIN}: ${PLUGINPORT} does not exist!"
exit 1
fi
export PLUGINPORT

#
# Where to put the PBI
#
PLUGINOUT="${AVATAR_ROOT}/${AVATAR_COMPONENT}/${NANO_ARCH}"
mkdir -p "${PLUGINOUT}"
if [ "$?" != "0" ]
then
echo "${PLUGIN}: unable to create ${PLUGINOUT}!"
exit 1
fi
export PLUGINOUT

#
# Where plugin directories are located
#
PLUGINSDIR="${AVATAR_ROOT}/nanobsd/plugins"
if [ ! -d "${PLUGINSDIR}" ]
then
echo "${PLUGIN}: ${PLUGINSDIR} does not exist!"
exit 1
fi
export PLUGINSDIR

#
# Where the configuration for this plugin is located
#
PLUGINCONFDIR="${PLUGINSDIR}/${PLUGIN}_pbi"
if [ ! -d "${PLUGINCONFDIR}" ]
then
echo "${PLUGIN}: ${PLUGINCONFDIR} does not exist!"
exit 1
fi
export PLUGINCONFDIR

#
# pbi.conf for this plugin
#
PLUGINCONF="${PLUGINCONFDIR}/pbi.conf"
if [ ! -f "${PLUGINCONF}" ]
then
echo "${PLUGIN}: ${PLUGINCONF} does not exist!"
exit 1
fi
export PLUGINCONF

#
# logfile for build
#
PLUGINLOG="${PLUGINOUT}/${PLUGIN}.log"
export PLUGINLOG

#
# Trick NanoBSD
#
clean_build()
{
:
}
build_world()
{
:
}
build_kernel()
{
:
}
clean_world()
{
:
}
make_conf_install()
{
:
}
install_world()
{
:
}
install_etc()
{
:
}
install_kernel()
{
:
}

#
# This is enough into trickying NanoBSD to not build anything
#
mkdir -p "${AVATAR_ROOT}/${PLUGIN}/${NANO_ARCH}/_.w"
mtree -deU -f ${AVATAR_ROOT}/os-base/${NANO_ARCH}/_.w/etc/mtree/BSD.root.dist \
-p ${AVATAR_ROOT}/${PLUGIN}/${NANO_ARCH}/_.w >/dev/null


. ${PLUGINCONF}

#
# Ripped out of pbi-maanger to determine PBI name
#
if [ -z "${PBI_PROGVERSION}" ]
then
PORTVER="$(make -C ${PLUGINPORT} -V DISTVERSION 2>/dev/null)"
PORTREV="$(make -C ${PLUGINPORT} -V PORTREVISION 2>/dev/null)"
if [ ! -z "${PORTREV}" -a "${PORTREV}" != "0" ]
then
PORTVER="${PORTVER}_${PORTREV}"
fi
PBI_PROGVERSION="${PORTVER}"
fi

if [ -z "${PBI_PROGVERSION}" ]
then
echo "${PLUGIN}: unable to determine program version!"
exit 1
fi

if [ ! -z "${PBI_PROGREVISION}" ]
then
PBI_PROGVERSION="${PBI_PROGVERSION}_${PBI_PROGREVISION}"
fi

PBIFILE="${PLUGIN}-${PBI_PROGVERSION}-${NANO_ARCH}.pbi"

NANO_NAME="${PBIFILE}"
NANO_IMGNAME="${NANO_NAME}"
export NANO_NAME NANO_IMGNAME

last_orders()
{
if [ "${bacula_FORCE}" = "1" -o ! -f "${PLUGINOUT}/${PBIFILE}" ]
then
pprint 2 "Creating PBI"
pprint 3 "log: ${PLUGINLOG}"

${PBIMAKEPORT} -d "${PLUGINPORTSDIR}" -c "${PLUGINCONFDIR}" -o "${PLUGINOUT}" --tmpfs > "${PLUGINLOG}" 2>&1
if [ "$?" != "0" ]
then
echo "${PLUGIN}: failed to build PBI!"
exit 1
fi
fi
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
Loading

0 comments on commit 043b677

Please sign in to comment.