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 CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__ -D_REENTRANT"
  39 CONFIGURE_OPTS="--with-x=no --with-dbus-user=root --disable-static --with-dbus-daemondir=/usr/lib
  40         --bindir=/usr/bin --localstatedir=/var --libexecdir=/usr/libexec"
  41 
  42 # We build backwards here on purpose so that 32bit binaries win (for install collisions).
  43 build() {
  44     if [[ $BUILDARCH == "64" || $BUILDARCH == "both" ]]; then
  45         build64
  46     fi
  47     if [[ $BUILDARCH == "32" || $BUILDARCH == "both" ]]; then
  48         build32
  49     fi
  50 }
  51 
  52 make_prog64() {
  53     logcmd perl -pi -e 's#(\$CC.*\$compiler_flags)#$1 -nostdlib#g;' libtool ||
  54         logerr "libtool patch failed"
  55     logcmd gmake || logerr "Make failed"
  56 }
  57 
  58 make_prog32() {
  59     logcmd perl -pi -e 's#(\$CC.*\$compiler_flags)#$1 -nostdlib#g;' libtool ||
  60         logerr "libtool patch failed"
  61     logcmd gmake || logerr "Make failed"
  62 }
  63 
  64 post_install() {
  65     mkdir -p $DESTDIR/var/svc/manifest/system
  66     cp files/dbus.xml $DESTDIR/var/svc/manifest/system/dbus.xml
  67     chmod 444 $DESTDIR/var/svc/manifest/system/dbus.xml
  68     mkdir -p $DESTDIR/lib/svc/method
  69     cp files/svc-dbus $DESTDIR/lib/svc/method/svc-dbus
  70     chmod 555 $DESTDIR/lib/svc/method/svc-dbus
  71     mkdir -p $DESTDIR/etc/security/auth_attr.d
  72     mkdir -p $DESTDIR/etc/security/prof_attr.d
  73     cp files/auth-system%2Flibrary%2Fdbus $DESTDIR/etc/security/auth_attr.d/system%2Flibrary%2Fdbus
  74     cp files/prof-system%2Flibrary%2Fdbus $DESTDIR/etc/security/prof_attr.d/system%2Flibrary%2Fdbus
  75 }
  76 
  77 init
  78 download_source $PROG $PROG $VER
  79 patch_source
  80 prep_build
  81 build
  82 make_isa_stub
  83 post_install
  84 
  85 PKG=system/library/dbus
  86 SUMMARY="Simple IPC library based on messages"
  87 DESC="Simple IPC library based on messages"
  88 make_package dbus.mog
  89 
  90 PKG=system/library/libdbus
  91 SUMMARY="Simple IPC library based on messages - client libraries"
  92 DESC="Simple IPC library based on messages - client libraries"
  93 make_package libdbus.mog
  94 
  95 #clean_up