import of dnsmasq-2.52.tar.gz

This commit is contained in:
Simon Kelley
2010-01-22 20:16:09 +00:00
parent 1f15b81d61
commit 316e2730ac
43 changed files with 2694 additions and 2033 deletions

View File

@@ -0,0 +1,25 @@
Ok, script attached ... seems to be working ok for me,
tried to install and remove a few times. It does the
right thing with the smf when installing, you can then
simply enable the service. Upon removal it cleans up the
files but won't clean up the services (I think until
a reboot) ... I've only started looking at the new
packages stuff in the last day or two, so I could be
missing something, but I can't find any way to force
a proper cleanup.
It requires that you have a writable repository setup
as per the docs on the opensolaris website and it will
create a dnsmasq package (package name is a variable
in the script). The script takes a version number for
the package and assumes that it's in the contrib/Solaris10
directory, it then works out the base tree directory
from $0.
i.e. $ contrib/Solaris10/create_package 2.52-1
or $ cd contrib/Solaris10; ./create_package 2.52-1
It's a bit more complex than it could be because I
prefer putting the daemon in /usr/sbin and the config
in /etc, so the script will actually create a new
version of the existing contrib dnsmasq.xml.

View File

@@ -0,0 +1,87 @@
#!/bin/sh
#
# For our package, and for the SMF script, we need to define where we
# want things to go...
#
BIN_DIR="/usr/sbin"
CONF_DIR="/etc"
MAN_DIR="/usr/man/man8"
PACKAGE_NAME="dnsmasq"
#
# Since we know we are in the contrib directory we can work out where
# the rest of the tree is...
#
BASEDIR="`dirname $0`/../.."
#
# We need a version number to use for the package creation...
#
if [ $# != 1 ]; then
echo "Usage: $0 <package_version_number>" >&2
exit 1
fi
VERSION="$1"
#
# First thing we do is fix-up the smf file to use the paths we prefer...
#
if [ ! -f "${BASEDIR}/contrib/Solaris10/dnsmasq.xml" ]; then
echo "$0: unable to find contrib/Solaris10/dnsmasq.xml" >&2
exit 1
fi
echo "Fixing up smf file ... \c"
cat "${BASEDIR}/contrib/Solaris10/dnsmasq.xml" | \
sed -e "s%/usr/local/etc%${CONF_DIR}%" \
-e "s%/usr/local/sbin%${BIN_DIR}%" \
-e "s%/usr/local/man%${MAN_DIR}%" > ${BASEDIR}/contrib/Solaris10/dnsmasq-pkg.xml
echo "done."
echo "Creating packaging file ... \c"
cat <<EOF >${BASEDIR}/contrib/Solaris10/dnsmasq_package.inc
#
# header
#
set name=pkg.name value="dnsmasq"
set name=pkg.description value="dnsmasq daemon - dns, dhcp, tftp etc"
set name=pkg.detailed_url value="http://www.thekelleys.org.uk/dnsmasq/doc.html"
set name=info.maintainer value="TBD (tbd@tbd.com)"
set name=info.upstream value="dnsmasq-discuss@lists.thekelleys.org.uk"
set name=info.upstream_url value="http://www.thekelleys.org.uk/dnsmasq/doc.html"
#
# dependencies ... none?
#
#
# directories
#
dir mode=0755 owner=root group=bin path=${BIN_DIR}/
dir mode=0755 owner=root group=sys path=${CONF_DIR}/
dir mode=0755 owner=root group=sys path=${MAN_DIR}/
dir mode=0755 owner=root group=sys path=/var/
dir mode=0755 owner=root group=sys path=/var/svc
dir mode=0755 owner=root group=sys path=/var/svc/manifest
dir mode=0755 owner=root group=sys path=/var/svc/manifest/network
#
# files
#
file ${BASEDIR}/src/dnsmasq mode=0555 owner=root group=bin path=${BIN_DIR}/dnsmasq
file ${BASEDIR}/man/dnsmasq.8 mode=0555 owner=root group=bin path=${MAN_DIR}/dnsmasq.8
file ${BASEDIR}/dnsmasq.conf.example mode=0644 owner=root group=sys path=${CONF_DIR}/dnsmasq.conf preserve=strawberry
file ${BASEDIR}/contrib/Solaris10/dnsmasq-pkg.xml mode=0644 owner=root group=sys path=/var/svc/manifest/network/dnsmasq.xml restart_fmri=svc:/system/manifest-import:default
EOF
echo "done."
echo "Creating package..."
eval `pkgsend open ${PACKAGE_NAME}@${VERSION}`
pkgsend include ${BASEDIR}/contrib/Solaris10/dnsmasq_package.inc
if [ "$?" = 0 ]; then
pkgsend close
else
echo "Errors"
fi