# This is useful for debugging
#set -x
+if [ "$1" = "-v" ]; then
+ silent_make_flags=""
+ shift
+else
+ silent_make_flags="-s LIBTOOLFLAGS=--silent"
+fi
#### CHECKS
if [ ! -f common-src/amanda.h ]; then
echo "Error: 'buildpkg' must be run from the root of an otherwise unused amanda source"
{ echo "client or server not given" && exit 1; }
rm -rf ${INSTALL_DEST} ${PKG_DEST}
mkdir ${INSTALL_DEST} ${PKG_DEST} || exit 1
- make distclean
+ make ${silent_make_flags} distclean
echo "Running configure.."
CONF="$CONF \
STAR=/opt/csw/bin/star \
GLIB_MKENUMS=glib-mkenums \
${CONF} || exit 1
- echo "Building.."
+ echo "Building $1.."
# rpcgen should be run natively on solaris, linux generated XDR stubs
# are not compatible. Specially when being compiled in 64 bit mode.
(cd ndmp-src;rpcgen ndmp0.x;rpcgen ndmp2.x;rpcgen ndmp3.x;rpcgen ndmp4.x; rpcgen ndmp9.x)
- make || exit 1
- make DESTDIR=${INSTALL_DEST} install || exit 1
+ make ${silent_make_flags}|| exit 1
+ make ${silent_make_flags} DESTDIR=${INSTALL_DEST} install || exit 1
# the gnulib makefiles create $amlibdir/charset.alias in hopes of "merging"
# it with a similar file from other applications. This doesn't work with
cp ${src_dir}/${pkg_root}/${subpkg}/* ${PKG_DEST} || exit 1
cd ${INSTALL_DEST} || exit 1
- # amanda does not create /etc/amanda
+ # amanda does not create /etc/amanda
mkdir -p ${AMSTATEDIR} || exit 1
mkdir -p ${ETCDIR}/amanda || exit 1
# permissions and ownership per pkg settings if included.
cat "${PKG_DEST}/pkgproto" \
>> ${PKG_DEST}/prototype || exit 1
- pkgproto $PREFIX >> ${PKG_DEST}/prototype || exit 1
+ pkgproto $PREFIX ${AMSTATEDIR} ${ETCDIR}/amanda >> ${PKG_DEST}/prototype || exit 1
# Using --disable-installperms creates installperms.sh, which this bit of
# perl will merge into the prototype. Note that this perl script is
# Explanation of solaris paths:
# /opt/SUNWspro/*: Sun compiler, NOT USED FOR PACKAGING.
-# /opt/csw/*: blastwave.
+# /opt/csw/*: OpenCSW.
# /usr/ccs/*: sun compilation tools (ld, lex, yacc)
# /usr/sfw/*: SunFreeware, sometimes. (solaris 10)
# /usr/local/*: SunFreeware, othertimes. (solaris 8)
-# Not Absolute! Remember to prefix a "/" except in pkgproto.
# sparc or intel
arch=`uname -p`
# 5.8 or 5.10
# Compile 32bit because csw perl is 32bit and native is too old.
CFLAGS="-O2 -pipe -m32"; export CFLAGS
CPPFLAGS="-I/opt/csw/include"; export CPPFLAGS
-PREFIX=opt/amanda; export PREFIX # Not absolute. Pkgprot needs this.
+# Not Absolute! Remember to prefix a "/" except in pkgproto.
+PREFIX=opt/amanda; export PREFIX # Not absolute.
amlibdir=${PREFIX}/lib # Not absolute
LOCALSTATEDIR=var; export LOCALSTATEDIR
AMSTATEDIR=${LOCALSTATEDIR}/lib/amanda; export AMSTATEDIR
ETCDIR=etc; export ETCDIR
DBGDIR=${LOCALSTATEDIR}/log; export DBGDIR
# Each client and server and platform combination gets different compile options
-if [ "x${1}" = "xclient" -o "x${1}" = "x" ]; then
+if [ "x${1}" = "xclient" ] || [ "x${1}" = "x" ]; then
CC=/usr/sfw/bin/gcc
# Variables with spaces must be entered on the configure line separate from
# CONF to maintain quoting.
GLIB_LIBS="-lglib-2.0 -lgobject-2.0 -lgthread-2.0"; export GLIB_LIBS
elif [ "x$arch" = "xi386" -a "x$os_rel" = "x5.10" ]; then
GLIB_CFLAGS="-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include"; export GLIB_CFLAGS
+ GLIB_LIBS="-lglib-2.0 -lgobject-2.0 -lgthread-2.0"; export GLIB_LIBS
elif [ "x$arch" = "xsparc" -a "x$os_rel" = "x5.8" ]; then
# CSW glib2.0 flags for gcc. CSW compiles with Sunstudio, so some
# flags may not work
do_package "client"
fi
-if [ "x${1}" = "xserver" -o "x${1}" = "x" ]; then
+if [ "x${1}" = "xserver" ] || [ "x${1}" = "x" ]; then
LDFLAGS="-L/usr/lib -R/usr/lib \
-L/opt/csw/lib -R/opt/csw/lib \
-L/usr/sfw/lib \
fi
CONF="--with-amlibdir=/${amlibdir} \
--enable-s3-device \
+ --with-libcurl=/opt/csw \
CC=/usr/sfw/bin/gcc \
PERL=/opt/csw/bin/perl \
MTX=/opt/csw/sbin/mtx" ; export CONF