Tomato 1.28
[tomato.git] / release / src / router / dnsmasq / contrib / Solaris10 / create_package
blobacfa2a1c067ecf84e5941eecdcd82de9ff2ad2a2
1 #!/bin/sh
4 # For our package, and for the SMF script, we need to define where we
5 # want things to go...
7 BIN_DIR="/usr/sbin"
8 CONF_DIR="/etc"
9 MAN_DIR="/usr/share/man/man8"
11 PACKAGE_NAME="dnsmasq"
14 # Since we know we are in the contrib directory we can work out where
15 # the rest of the tree is...
17 BASEDIR="`dirname $0`/../.."
20 # We need a version number to use for the package creation...
22 if [ $# != 1 ]; then
23 echo "Usage: $0 <package_version_number>" >&2
24 exit 1
26 VERSION="$1"
29 # First thing we do is fix-up the smf file to use the paths we prefer...
31 if [ ! -f "${BASEDIR}/contrib/Solaris10/dnsmasq.xml" ]; then
32 echo "$0: unable to find contrib/Solaris10/dnsmasq.xml" >&2
33 exit 1
36 echo "Fixing up smf file ... \c"
37 cat "${BASEDIR}/contrib/Solaris10/dnsmasq.xml" | \
38 sed -e "s%/usr/local/etc%${CONF_DIR}%" \
39 -e "s%/usr/local/sbin%${BIN_DIR}%" \
40 -e "s%/usr/local/man%${MAN_DIR}%" > ${BASEDIR}/contrib/Solaris10/dnsmasq-pkg.xml
41 echo "done."
43 echo "Creating packaging file ... \c"
44 cat <<EOF >${BASEDIR}/contrib/Solaris10/dnsmasq_package.inc
46 # header
48 set name=pkg.name value="dnsmasq"
49 set name=pkg.description value="dnsmasq daemon - dns, dhcp, tftp etc"
50 set name=pkg.detailed_url value="http://www.thekelleys.org.uk/dnsmasq/doc.html"
51 set name=info.maintainer value="TBD (tbd@tbd.com)"
52 set name=info.upstream value="dnsmasq-discuss@lists.thekelleys.org.uk"
53 set name=info.upstream_url value="http://www.thekelleys.org.uk/dnsmasq/doc.html"
55 # dependencies ... none?
59 # directories
61 dir mode=0755 owner=root group=bin path=${BIN_DIR}/
62 dir mode=0755 owner=root group=sys path=${CONF_DIR}/
63 dir mode=0755 owner=root group=sys path=${MAN_DIR}/
64 dir mode=0755 owner=root group=sys path=/var/
65 dir mode=0755 owner=root group=sys path=/var/svc
66 dir mode=0755 owner=root group=sys path=/var/svc/manifest
67 dir mode=0755 owner=root group=sys path=/var/svc/manifest/network
70 # files
72 file ${BASEDIR}/src/dnsmasq mode=0555 owner=root group=bin path=${BIN_DIR}/dnsmasq
73 file ${BASEDIR}/man/dnsmasq.8 mode=0555 owner=root group=bin path=${MAN_DIR}/dnsmasq.8
74 file ${BASEDIR}/dnsmasq.conf.example mode=0644 owner=root group=sys path=${CONF_DIR}/dnsmasq.conf preserve=strawberry
75 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
77 EOF
78 echo "done."
80 echo "Creating package..."
81 eval `pkgsend open ${PACKAGE_NAME}@${VERSION}`
82 pkgsend include ${BASEDIR}/contrib/Solaris10/dnsmasq_package.inc
83 if [ "$?" = 0 ]; then
84 pkgsend close
85 else
86 echo "Errors"