1 #!/usr/bin/bash
   2 #
   3 # CDDL HEADER START
   4 #
   5 # The contents of this file are subject to the terms of the
   6 # Common Development and Distribution License, Version 1.0 only
   7 # (the "License").  You may not use this file except in compliance
   8 # with the License.
   9 #
  10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  11 # or http://www.opensolaris.org/os/licensing.
  12 # See the License for the specific language governing permissions
  13 # and limitations under the License.
  14 #
  15 # When distributing Covered Code, include this CDDL HEADER in each
  16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  17 # If applicable, add the following below this CDDL HEADER, with the
  18 # fields enclosed by brackets "[]" replaced with your own identifying
  19 # information: Portions Copyright [yyyy] [name of copyright owner]
  20 #
  21 # CDDL HEADER END
  22 #
  23 #
  24 # Copyright 2011-2012 OmniTI Computer Consulting, Inc.  All rights reserved.
  25 # Use is subject to license terms.
  26 #
  27 # Load support functions
  28 . ../../lib/functions.sh
  29 
  30 PROG=dbus
  31 VER=1.6.8
  32 PKG=dbus ##IGNORE##
  33 SUMMARY="$PROG - IPC-based message notifications"
  34 DESC="$SUMMARY"
  35 
  36 DEPENDS_IPS="SUNWcs"
  37 
  38 # Use old gcc4 standards level for this.
  39 CFLAGS="$CFLAGS -std=gnu89"
  40 CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__ -D_REENTRANT"
  41 CONFIGURE_OPTS="--with-x=no --with-dbus-user=root --disable-static --with-dbus-daemondir=/usr/lib
  42         --bindir=/usr/bin --localstatedir=/var --libexecdir=/usr/libexec"
  43 
  44 # We build backwards here on purpose so that 32bit binaries win (for install collisions).
  45 build() {
  46     if [[ $BUILDARCH == "64" || $BUILDARCH == "both" ]]; then
  47         build64
  48     fi
  49     if [[ $BUILDARCH == "32" || $BUILDARCH == "both" ]]; then
  50         build32
  51     fi
  52 }
  53 
  54 make_prog64() {
  55     logcmd perl -pi -e 's#(\$CC.*\$compiler_flags)#$1 -nostdlib#g;' libtool ||
  56         logerr "libtool patch failed"
  57     logcmd gmake || logerr "Make failed"
  58 }
  59 
  60 make_prog32() {
  61     logcmd perl -pi -e 's#(\$CC.*\$compiler_flags)#$1 -nostdlib#g;' libtool ||
  62         logerr "libtool patch failed"
  63     logcmd gmake || logerr "Make failed"
  64 }
  65 
  66 post_install() {
  67     mkdir -p $DESTDIR/var/svc/manifest/system
  68     cp files/dbus.xml $DESTDIR/var/svc/manifest/system/dbus.xml
  69     chmod 444 $DESTDIR/var/svc/manifest/system/dbus.xml
  70     mkdir -p $DESTDIR/lib/svc/method
  71     cp files/svc-dbus $DESTDIR/lib/svc/method/svc-dbus
  72     chmod 555 $DESTDIR/lib/svc/method/svc-dbus
  73     mkdir -p $DESTDIR/etc/security/auth_attr.d
  74     mkdir -p $DESTDIR/etc/security/prof_attr.d
  75     cp files/auth-system%2Flibrary%2Fdbus $DESTDIR/etc/security/auth_attr.d/system%2Flibrary%2Fdbus
  76     cp files/prof-system%2Flibrary%2Fdbus $DESTDIR/etc/security/prof_attr.d/system%2Flibrary%2Fdbus
  77 }
  78 
  79 init
  80 download_source $PROG $PROG $VER
  81 patch_source
  82 prep_build
  83 build
  84 make_isa_stub
  85 post_install
  86 
  87 PKG=system/library/dbus
  88 SUMMARY="Simple IPC library based on messages"
  89 DESC="Simple IPC library based on messages"
  90 make_package dbus.mog
  91 
  92 PKG=system/library/libdbus
  93 SUMMARY="Simple IPC library based on messages - client libraries"
  94 DESC="Simple IPC library based on messages - client libraries"
  95 make_package libdbus.mog
  96 
  97 #clean_up