1 #!/usr/bin/bash
2 #
3 # CDDL HEADER START
4 #
5 # This file and its contents are supplied under the terms of the
6 # Common Development and Distribution License ("CDDL"), version 1.0.
7 # You may only use this file in accordance with the terms of version
8 # 1.0 of the CDDL.
9 #
10 # A full copy of the text of the CDDL should have accompanied this
11 # source. A copy of the CDDL is also available via the Internet at
12 # http://www.illumos.org/license/CDDL.
13 #
14 # CDDL HEADER END
15 #
16 #
17 # Copyright 2014 OmniTI Computer Consulting, Inc. All rights reserved.
18 #
19 # Load support functions
20 . ../../lib/functions.sh
21
22 PROG=dhcp
23 VER=4.3.2
24 VERHUMAN=$VER
25 PKG=network/service/isc-dhcp
26 SUMMARY="ISC DHCP"
27 DESC="$SUMMARY $VER"
28
29 DEPENDS_IPS="system/library"
30
31 # XXX 32-bit until Y2038 rears its ugly head.
32 BUILDARCH=32
33
34 # Use old gcc4 standards level for this.
35 export CFLAGS="$CFLAGS -std=gnu89"
36
37 CONFIGURE_OPTS="--enable-use-sockets --enable-ipv4-pktinfo --prefix=$PREFIX --bindir=$PREFIX/bin --sbindir=$PREFIX/sbin"
38
39 pre_package() {
40 # Make directories and install extra files before package construction.
41 logcmd mkdir -p $DESTDIR/usr/share/isc-dhcp/examples || logerr \
42 "mkdir of $DESTDIR/usr/share/isc-dhcp/examples failed"
43 logcmd mkdir -p $DESTDIR/lib/svc/manifest/network || logerr \
44 "mkdir of $DESTDIR/lib/svc/manifest/network failed"
45 logcmd mkdir -p $DESTDIR/lib/svc/method || logerr \
46 "mkdir of $DESTDIR/lib/svc/method failed"
47 logcmd mkdir -p $DESTDIR/var/db || logerr "mkdir of $DESTDIR/var/db failed"
48 logcmd mkdir -p $DESTDIR/var/db || logerr "mkdir of $DESTDIR/var/db failed"
49 logcmd touch $DESTDIR/var/db/dhcpd.leases
50 logcmd touch $DESTDIR/var/db/dhcpd6.leases
51 logcmd cp $SRCDIR/files/isc-dhcp.xml $DESTDIR/lib/svc/manifest/network || \
52 logerr "Cannot copy in manifest."
53 chmod 0444 $DESTDIR/lib/svc/manifest/network/isc-dhcp.xml
54 logcmd cp $SRCDIR/files/dhcrelay $DESTDIR/lib/svc/method || \
55 logerr "Cannot copy in method."
56 chmod 0555 $DESTDIR/lib/svc/method/dhcrelay
57 }
58
59 init
60 download_source $PROG $PROG $VER
61 patch_source
62 prep_build
63 build
64 # Make directories in the proto area prior to the package being built.
65 pre_package
66 make_package
67 clean_up
68
69 # Vim hints
70 # vim:ts=4:sw=4:et: