Allow building on FreeBSD
authorMarcin Cieslak <saper@saper.info>
Thu, 6 Sep 2012 11:45:11 +0000 (13:45 +0200)
committerJon Trulson <jon@radscan.com>
Thu, 6 Sep 2012 17:17:43 +0000 (11:17 -0600)
- build shared libraries with major number only (libtt.so.2)
- don't build dtlogin and dtinfo

FreeBSD support for the installer:
- work around awk issue
- create post_install FreeBSD scripts
- install only cmsd on /etc/inetd.conf
  skip dtspc and ttdbserver for now

Note to users: please check
if you are affected by awk bug
in udbParseLib.awk if you can.

13 files changed:
cde/.gitignore
cde/admin/IntegTools/dbTools/installCDE.src
cde/admin/IntegTools/dbTools/udbParseLib.awk
cde/admin/IntegTools/post_install/Imakefile
cde/admin/IntegTools/post_install/freebsd/Imakefile [new file with mode: 0644]
cde/admin/IntegTools/post_install/freebsd/configMin.src [new file with mode: 0755]
cde/admin/IntegTools/post_install/freebsd/configRun.src [new file with mode: 0755]
cde/admin/IntegTools/post_install/freebsd/configShlibs.src [new file with mode: 0755]
cde/admin/IntegTools/post_install/freebsd/configTT.src [new file with mode: 0755]
cde/config/cf/FreeBSD.cf
cde/config/cf/bsdLib.rules
cde/databases/CDE-SHLIBS.src
cde/programs/Imakefile

index 3d34ffab8029af20a16c6d162e660c3bb7caf5b1..6db7d002072ed88517e391cb90a3a9bc4a729a7f 100644 (file)
@@ -25,6 +25,19 @@ admin/IntegTools/post_install/*.list
 admin/IntegTools/post_install/*.lst
 admin/IntegTools/post_install/linux
 
+admin/IntegTools/post_install/freebsd/CDE-MIN.list
+admin/IntegTools/post_install/freebsd/CDE-MIN.lst
+admin/IntegTools/post_install/freebsd/CDE-RUN.list
+admin/IntegTools/post_install/freebsd/CDE-RUN.lst
+admin/IntegTools/post_install/freebsd/CDE-SHLIBS.list
+admin/IntegTools/post_install/freebsd/CDE-SHLIBS.lst
+admin/IntegTools/post_install/freebsd/CDE-TT.list
+admin/IntegTools/post_install/freebsd/CDE-TT.lst
+admin/IntegTools/post_install/freebsd/configMin
+admin/IntegTools/post_install/freebsd/configRun
+admin/IntegTools/post_install/freebsd/configShlibs
+admin/IntegTools/post_install/freebsd/configTT
+
 admin/IntegTools/post_install/configDemos
 admin/IntegTools/post_install/configFonts
 admin/IntegTools/post_install/configHelp
index 8e64bef641b260eacb579acc7f30d28c0017a11f..9531ee82cd0287acaa3dfac38473116413e8577b 100755 (executable)
@@ -51,7 +51,7 @@ REVISION="$(echo "$Revision: /main/20 $" | awk '{print $2}')"
 
 Log()
 {
-  echo "$1" | tee -a $LOGFILE
+  /bin/echo "$1" | tee -a $LOGFILE
 }
 
 MakeTarball()
@@ -210,6 +210,14 @@ CleanDaemons()
     elif [ "$PLATFORM" = openbsd ]
     then
       true
+    elif [ "$PLATFORM" = freebsd ]
+    then
+      ps axo pid,comm | grep $i > /tmppsout
+      if [ -s /tmp/tmppsout ]
+      then
+        awk '{print "kill " $1}' /tmp/tmppsout | /bin/csh -f
+        sleep 2
+      fi
     else    
       ps -ef | grep $i | grep -v grep >/tmp/tmppsout
       if [ -s /tmp/tmppsout ]
@@ -240,6 +248,9 @@ RestartInetd()
   elif [ "$PLATFORM" = "openbsd" ]
   then
     true
+  elif [ "$PLATFORM" = "freebsd" ]
+  then
+    /etc/rc.d/inetd onestart
   else
 #ifdef hpV4
     /usr/sbin/inetd 
@@ -543,6 +554,10 @@ XCOMM
   then
     PLATFORM="linux"
     PLATFORM_SCRIPT_DIR=""
+  elif [ $BUILDSYSTEM = "FreeBSD" ];
+  then
+    PLATFORM="freebsd"
+    PLATFORM_SCRIPT_DIR="freebsd"
   elif [ $BUILDSYSTEM = "OpenBSD" ];
   then
     PLATFORM="openbsd"
index 86691967e90c3006ed23e42717f3ea0a13b7ba07..d1399afb72f79925724259510a28f9e5c29d55cc 100644 (file)
@@ -268,6 +268,13 @@ function tokenize() {
                        printf(" ") > DeBugFile
                print "Entering function tokenize:" > DeBugFile
        }
+       # Workaround for a strange awk bug, seen on FreeBSD
+       # and results in .db files generated with
+       #   Syntax ERROR line: 10 of file: CDE-INC.udb
+       #           Missing initial {
+       #
+       DUMMY = $0
+
        # Skip blank/comment lines
        while ( NF == 0 || $0 ~ /^[     ]*#/  ) {
                if ( (getline) <= 0 ) {
index 3b6bc433f9ae6d6ab8f716e3fe725bf0b54915af..b0dcbf84e2786b4ef1cc39437ae72e24f55aa872 100644 (file)
@@ -25,6 +25,7 @@ PLATFORM = openbsd
 #endif
 #ifdef FreeBSDArchitecture
 PLATFORM = freebsd
+SUBDIRS = freebsd
 #endif
 #ifdef RsArchitecture
 PLATFORM = aix
diff --git a/cde/admin/IntegTools/post_install/freebsd/Imakefile b/cde/admin/IntegTools/post_install/freebsd/Imakefile
new file mode 100644 (file)
index 0000000..7bf6c55
--- /dev/null
@@ -0,0 +1,65 @@
+XCOMM $TOG: Imakefile /main/1 1998/03/11 16:08:16 mgreess $
+TOOL_DIR = ../../dbTools
+DATABASE_DIR = ../../../../databases
+
+#ifdef HPArchitecture
+PLATFORM = hp-ux
+#endif
+#ifdef LinuxArchitecture
+PLATFORM = linux
+#endif
+#ifdef FreeBSDArchitecture
+PLATFORM = freebsd
+#endif
+#ifdef RsArchitecture
+PLATFORM = aix
+#endif
+#ifdef SunArchitecture
+PLATFORM = sun
+.NO_PARALLEL:
+#endif
+#ifdef USLArchitecture
+PLATFORM = usl
+#endif
+#ifdef UXPArchitecture
+PLATFORM = uxp
+#endif
+
+UDBTOANY = $(KORNSHELL) $(TOOL_DIR)/udbToAny.ksh
+BUILD_UDB_LIST = $(SHELL) ../build_udb_list
+
+all::
+
+configMin:: $(DATABASE_DIR)/CDE-MIN.udb
+       $(UDBTOANY) -toLst -ReleaseStream $(PLATFORM) \
+            $(DATABASE_DIR)/CDE-MIN.udb > CDE-MIN.lst
+       $(BUILD_UDB_LIST) CDE-MIN ../../../..
+
+configTT:: $(DATABASE_DIR)/CDE-TT.udb
+       $(UDBTOANY) -toLst -ReleaseStream $(PLATFORM) \
+            $(DATABASE_DIR)/CDE-TT.udb > CDE-TT.lst
+       $(BUILD_UDB_LIST) CDE-TT ../../../..
+
+configRun:: $(DATABASE_DIR)/CDE-RUN.udb
+       $(UDBTOANY) -toLst -ReleaseStream $(PLATFORM) \
+            $(DATABASE_DIR)/CDE-RUN.udb > CDE-RUN.lst
+       $(BUILD_UDB_LIST) CDE-RUN ../../../..
+
+configShlibs:: $(DATABASE_DIR)/CDE-SHLIBS.udb
+       $(UDBTOANY) -toLst -ReleaseStream $(PLATFORM) \
+            $(DATABASE_DIR)/CDE-SHLIBS.udb > CDE-SHLIBS.lst
+       $(BUILD_UDB_LIST) CDE-SHLIBS ../../../..
+
+LOCAL_CPP_DEFINES = -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \
+                    -DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP) \
+                    -DCDE_LOGFILES_TOP=$(CDE_LOGFILES_TOP)
+
+AllTarget(configShlibs configTT configRun configMin)
+
+CppScriptTarget(configShlibs,configShlibs.src,$(LOCAL_CPP_DEFINES),)
+CppScriptTarget(configTT,configTT.src,$(LOCAL_CPP_DEFINES),)
+CppScriptTarget(configRun,configRun.src,$(LOCAL_CPP_DEFINES),)
+CppScriptTarget(configMin,configMin.src,$(LOCAL_CPP_DEFINES),)
+
+clean::
+       $(RM) *.lst *.list
diff --git a/cde/admin/IntegTools/post_install/freebsd/configMin.src b/cde/admin/IntegTools/post_install/freebsd/configMin.src
new file mode 100755 (executable)
index 0000000..977ac86
--- /dev/null
@@ -0,0 +1,257 @@
+XCOMM! /bin/ksh
+XCOMM #######
+XCOMM  Product: CDE
+XCOMM  Fileset: CDE-MIN
+XCOMM  configure
+XCOMM  @(#) $TOG: configMin.src /main/1 1998/03/11 16:18:12 mgreess $
+XCOMM #######
+#define HASH #
+
+PRODUCT=CDE
+FILESET=CDE-MIN
+DO_CONFIGURATION=""
+retval=0
+
+FixEtcServices()
+{
+FILE=/etc/services
+TMPFILE=/tmp/services
+
+XCOMM
+XCOMM check for existence of /etc/services
+XCOMM
+
+    if [ ! -f $FILE ]  # highly unlikely
+    then
+       echo "" >$FILE
+    fi
+
+XCOMM
+XCOMM see if it already exists
+XCOMM
+
+    awk '{if ($1 == "dtspc")
+               print $0 > "/tmp/dtspc-already-there"
+        }' $FILE >/dev/null
+
+    if [ ! -f /tmp/dtspc-already-there ]
+    then
+        printf "dtspc\t\t6112/tcp\t#subprocess control" >>$FILE
+    else
+       rm /tmp/dtspc-already-there
+    fi
+
+XCOMM
+XCOMM remove legacy entries like dtspcd
+XCOMM
+
+    awk '{if ($1 == "dtspcd" || $1 == "#dtspcd")
+               ;
+         else
+               print $0
+        }' $FILE >$TMPFILE
+
+    cp $TMPFILE $FILE
+    rm $TMPFILE
+}
+
+UnfixEtcServices()
+{
+FILE=/etc/services
+TMPFILE=/tmp/services
+
+    awk '{if ($1 == "dtspc" && $2 == "6112/tcp")
+               ;
+         else
+               print $0
+        }' $FILE >$TMPFILE
+
+    cp $TMPFILE $FILE
+    rm $TMPFILE
+}
+
+FixEtcInetdDotConf()
+{
+FILE=/etc/inetd.conf
+TMPFILE=/tmp/inetd.conf
+
+XCOMM
+XCOMM check for existence of /etc/inetd.conf
+XCOMM
+
+    if [ ! -f $FILE ]  # highly unlikely
+    then
+       echo "" >$FILE
+    fi
+
+XCOMM
+XCOMM see if it already exists
+XCOMM
+
+    awk '{if ($1 == "dtspc")
+               print $0 > "/tmp/dtspc-already-there"
+        }' $FILE >/dev/null
+
+    DTSPCD=CDE_INSTALLATION_TOP/bin/dtspcd
+
+    if [ ! -f /tmp/dtspc-already-there ]
+    then
+        echo "dtspc stream tcp4 nowait root $DTSPCD $DTSPCD" >>$FILE
+    else
+       rm /tmp/dtspc-already-there
+    fi
+
+XCOMM
+XCOMM remove legacy entries like dtspcd
+XCOMM
+
+    awk '{if ($1 == "dtspcd" || $1 == "#dtspcd")
+               ;
+         else
+               print $0
+        }' $FILE >$TMPFILE
+
+    cp $TMPFILE $FILE
+    rm $TMPFILE
+}
+
+UnfixEtcInetdDotConf()
+{
+FILE=/etc/inetd.conf
+TMPFILE=/tmp/inetd.conf
+
+    awk '{if ($1 == "dtspc")
+               ;
+         else
+               print $0
+        }' $FILE >$TMPFILE
+
+    cp $TMPFILE $FILE
+    rm $TMPFILE
+}
+
+FixEtcPamDotConf()
+{
+FILE=/etc/pam.conf
+ORIGFILE=/etc/pam.conf.preCDE
+
+XCOMM
+XCOMM check for existence of /etc/pam.conf
+XCOMM
+
+    if [ -f $FILE ]
+    then
+       echo "" > $ORIGFILE
+       cp CDE_INSTALLATION_TOP/config/sys.pam.conf $FILE
+       chmod 644 $FILE
+    else
+       echo "Warning: $FILE already exists.  Leaving it alone." 1>&2
+       cp CDE_INSTALLATION_TOP/config/sys.pam.conf $ORIGFILE
+    fi
+
+}
+
+UnfixEtcPamDotConf()
+{
+FILE=/etc/pam.conf
+TMPFILE=/etc/pam.conf.CDE
+ORIGFILE=/etc/pam.conf.preCDE
+
+    if [ ! -f $FILE ]
+    then
+       echo "Warning: $FILE does not exist." 1>&2
+    elif [ ! -f $ORIGFILE ]
+    then
+       echo "Warning: $ORIGFILE does not exist.  Leaving $FILE alone." 1>&2
+    else
+       mv $FILE $TMPFILE
+       cp $ORIGFILE $FILE
+       chmod 664 $FILE
+    fi
+}
+
+RemoveMinFiles()
+{
+    while read SRC
+    do
+      if [ "$SRC" != "" ]
+      then
+       rm -f $SRC
+       dirname=${SRC%/STAR}
+       if [ -d $dirname ]
+       then
+         cd $dirname
+         while [ "$dirname" != "$CDE_TOP" ]
+         do
+           cd ..
+           rmdir ${dirname##STAR/} >/dev/null 2>/dev/null
+           dirname=${dirname%/STAR}
+         done
+       fi
+      fi
+    done <<-EOF
+#include "CDE-MIN.list"
+       EOF
+}
+
+VerifyInstalledFiles()
+{
+    echo "Status   mode    owner   group   filename"
+    echo "-----------------------------------------"
+XCOMM    exists  correct correct correct  /usr/dt/foo1
+XCOMM    MISSING  WRONG   WRONG   WRONG   /usr/dt/foo2
+XCOMM        exists    the link is correct    /usr/dt/link
+
+    while read SRC
+    do
+#include "../verify.func"
+    done <<-EOF
+#include "CDE-MIN.lst"
+       EOF
+}
+
+#include "../option.func"
+
+XCOMM ###############################################################
+XCOMM
+XCOMM Main Body
+XCOMM
+XCOMM ###############################################################
+
+  HandleOption $*
+
+  if [ "$OPERATION" = "configure" ]
+  then
+
+    FixEtcServices
+
+    : FixEtcInetdDotConf
+
+    HASH
+    HASH  create the /var/dt/tmp directory for the dtspcd
+    HASH
+
+    if [ ! -d CDE_LOGFILES_TOP/tmp ]
+    then
+       mkdir -p CDE_LOGFILES_TOP/tmp
+    fi
+
+  elif [ "$OPERATION" = "deconfigure" ]
+  then
+
+    UnfixEtcServices
+
+    : UnfixEtcInetdDotConf
+
+    RemoveMinFiles
+
+    VerifyInstalledFiles
+
+  elif [ "$OPERATION" = "verify" ]
+  then
+
+    VerifyInstalledFiles
+
+  fi
+
+  return $retval
diff --git a/cde/admin/IntegTools/post_install/freebsd/configRun.src b/cde/admin/IntegTools/post_install/freebsd/configRun.src
new file mode 100755 (executable)
index 0000000..42d2677
--- /dev/null
@@ -0,0 +1,331 @@
+XCOMM! /bin/ksh
+XCOMM #######
+XCOMM  Product: CDE
+XCOMM  Fileset: CDE-RUN
+XCOMM  configure
+XCOMM  @(#) $TOG: configRun.src /main/1 1998/03/11 16:18:24 mgreess $
+XCOMM #######
+
+#define HASH #
+#define STAR *
+
+PRODUCT=CDE
+FILESET=CDE-RUN
+DO_CONFIGURATION=""
+retval=0
+
+FixInetdDotConf()
+{
+FILE=/etc/inetd.conf
+TMPFILE=/tmp/inetd.conf
+CMSD=CDE_INSTALLATION_TOP/bin/rpc.cmsd
+
+XCOMM
+XCOMM desired inetd.conf entry:
+XCOMM cmsd/2-4 dgram rpc/udp4 wait root CDE_INSTALLATION_TOP/bin/rpc.cmsd rpc.cmsd
+XCOMM
+
+XCOMM first make an awk script and put it in a file.
+XCOMM
+
+XCOMM comment out any non-cde rpc.cmsd lines
+XCOMM
+
+    nawk -v cmsd=$CMSD \
+       '{if ($1 == "cmsd/2-4" && $6 != cmsd)
+               print "#cde " $0;
+         else
+               print $0
+        }' $FILE >$TMPFILE
+
+    cp $TMPFILE $FILE
+    rm $TMPFILE
+
+XCOMM remove any cde 2-4 cmsd
+XCOMM
+
+    nawk -v cmsd=$CMSD \
+       '{if ($1 == "cmsd/2-4" && $6 == cmsd)
+               ;
+         else
+               print $0
+        }' $FILE >$TMPFILE
+
+    cp $TMPFILE $FILE
+    rm $TMPFILE
+
+XCOMM
+XCOMM now run an awk script to see if there is an occurrence of 2-5 cmsd
+XCOMM
+
+    nawk -v cmsd=$CMSD \
+       '{if ($6 == cmsd && $1 == "cmsd/2-5")
+               print $0 > "/tmp/cmsd-already-there"
+        }' $FILE >/dev/null
+
+XCOMM
+XCOMM if it is not there, add it
+XCOMM
+
+    if [ ! -f /tmp/cmsd-already-there ]
+    then
+        echo "cmsd/2-5 dgram rpc/udp4 wait root $CMSD rpc.cmsd" >>$FILE
+    else
+       rm /tmp/cmsd-already-there
+    fi
+
+}
+
+UnfixInetdDotConf()
+{
+FILE=/etc/inetd.conf
+TMPFILE=/tmp/inetd.conf
+CMSD=CDE_INSTALLATION_TOP/bin/rpc.cmsd
+
+    HASH first remove the CDE rpc.cmsd entry
+
+    nawk -v cmsd=$CMSD \
+       '{if (($1 == "cmsd/2-4" || $1 == "cmsd/2-5") && $6 == cmsd)
+               ;
+         else
+               print $0
+        }' $FILE >$TMPFILE
+
+    cp $TMPFILE $FILE
+    rm $TMPFILE
+
+    HASH now uncomment any previously existing cmsd entry
+
+    awk '{if ($1 == "#cde") {
+               if ($2 == "cmsd/2-4") {
+                       $1 = $2;
+                       $2 = ""
+               }
+         }
+         print $0
+        }' $FILE >$TMPFILE
+
+    cp $TMPFILE $FILE
+    rm $TMPFILE
+}
+
+CreateAppConfigDirectory()
+{
+  HASH
+  HASH Create the APPCONFIG directory inside DT_CONFIG_TOP and create
+  HASH all of its subdirectories
+  HASH
+
+    cd $DT_CONFIG_TOP
+    if [ ! -d $APPCONFIG ]
+    then
+       mkdir $APPCONFIG
+    fi
+
+    cd $APPCONFIG
+
+    for i in $APPCONFIG_DIRS
+    do
+       if [ ! -d $i ]
+       then
+           mkdir $i
+       fi
+       cd $i
+        HASH
+       HASH for each locale
+       HASH
+       for j in $DT_TOP/$APPCONFIG/$i/STAR
+       do
+           if [ ! -d `basename $j` ]
+           then
+               mkdir `basename $j`
+           fi
+       done
+       cd ..
+    done
+
+}
+
+doDttermTerminfo()
+{
+    if [ -f $DT_TOP/config/dtterm.ti ]
+    then
+       tic $DT_TOP/config/dtterm.ti
+    else
+       echo "Unable to find $DT_TOP/config/dtterm.ti"
+    fi
+}
+
+RemoveRunFiles()
+{
+    while read SRC
+    do
+      if [ "$SRC" != "" ]
+      then
+       rm -f $SRC
+       dirname=${SRC%/STAR}
+       if [ -d $dirname ]
+       then
+         cd $dirname
+         while [ "$dirname" != "$CDE_TOP" ]
+         do
+           cd ..
+           rmdir ${dirname##STAR/} >/dev/null 2>/dev/null
+           dirname=${dirname%/STAR}
+         done
+       fi
+      fi
+    done <<-EOF
+#include "CDE-RUN.list"
+       EOF
+}
+
+
+VerifyInstalledFiles()
+{
+    echo "Status   mode    owner   group   filename"
+    echo "-----------------------------------------"
+XCOMM    exists  correct correct correct  /usr/dt/foo1
+XCOMM    MISSING  WRONG   WRONG   WRONG   /usr/dt/foo2
+XCOMM        exists    the link is correct    /usr/dt/link
+
+    while read SRC
+    do
+#include "../verify.func"
+    done <<-EOF
+#include "CDE-RUN.lst"
+       EOF
+}
+
+
+PrintUsage()
+{
+  echo "Usage:" $0 "[OPERATION]"
+  echo ""
+  echo "Operations:"
+  echo "    -e        configure"
+  echo "    -d        deconfigure"
+  echo "    -v        verify"
+  echo "    -s        size"
+  echo "    -h        help"
+}
+
+#include "../option.func"
+
+XCOMM ##########################################################################
+XCOMM
+XCOMM                          Main Body
+XCOMM
+XCOMM ##########################################################################
+
+PRODUCT=CDE
+FILESET=CDE-RUN
+
+DT_TOP=CDE_INSTALLATION_TOP
+DT_CONFIG_TOP=CDE_CONFIGURATION_TOP
+DT_TEMP_TOP=CDE_LOGFILES_TOP
+ROOT=/
+
+retval=0
+
+APPCONFIG=appconfig
+APPCONFIG_DIRS="appmanager help icons types"
+PRINTERS=""
+DEFAULT_PRINTER="DtPrint"
+
+  HandleOption $*
+
+  if [ "$OPERATION" = "usage" ]
+  then
+    PrintUsage
+    exit 0
+  fi
+
+  if [ "$OPERATION" = "configure" ]
+  then
+
+    HASH
+    HASH create the CDE_LOGFILES_TOP directory
+    HASH
+
+    if [ ! -d $DT_TEMP_TOP/$APPCONFIG/appmanager ]
+    then
+       mkdir -p $DT_TEMP_TOP/$APPCONFIG/appmanager
+    fi
+
+    cd $DT_TEMP_TOP
+    mv $APPCONFIG/appmanager .hidden-appmanager
+    chmod -R 755 *
+    chmod 755 .hidden-appmanager
+    chown -R bin *
+    chgrp -R bin *
+    mv .hidden-appmanager $APPCONFIG/appmanager
+    chmod 755 .
+    chown bin .
+    chgrp bin .
+
+    HASH
+    HASH create the CDE_CONFIGURATION_TOP and its config directory
+    HASH
+    if [ ! -d $DT_CONFIG_TOP ]
+    then
+       mkdir -p $DT_CONFIG_TOP
+    fi
+    if [ ! -d $DT_CONFIG_TOP/config ]
+    then
+       mkdir -p $DT_CONFIG_TOP/config
+    fi
+
+    CreateAppConfigDirectory
+
+    HASH
+    HASH ConfigurePrintersDir
+    HASH
+    env LANG=C /usr/dt/bin/dtprintinfo -populate
+
+    HASH
+    HASH Configure Xsession.d
+    HASH
+
+    cd $DT_CONFIG_TOP/config
+    if [ ! -d Xsession.d ]
+    then
+       mkdir Xsession.d
+    fi
+
+    cd $DT_CONFIG_TOP
+    chmod -R 755 *
+
+    FixInetdDotConf
+
+  elif [ "$OPERATION" = "deconfigure" ]
+  then
+
+    UnfixInetdDotConf
+
+    RemoveRunFiles
+
+    VerifyInstalledFiles
+
+  elif [ "$OPERATION" = "verify" ]
+  then
+
+    VerifyInstalledFiles
+
+  fi
+
+  if [ "$OPERATION" != "verify" ]
+  then
+
+    HASH issue a SIGHUP to the inetd process
+
+    /etc/rc.d/inetd onereload
+  fi
+
+   HASH dtmail requires setgid
+   chmod 2555 $DT_TOP/bin/dtmail
+
+  HASH dtmail requires setgid
+  chmod 2555 $DT_TOP/bin/dtmail
+
+  return $retval
diff --git a/cde/admin/IntegTools/post_install/freebsd/configShlibs.src b/cde/admin/IntegTools/post_install/freebsd/configShlibs.src
new file mode 100755 (executable)
index 0000000..3807af3
--- /dev/null
@@ -0,0 +1,109 @@
+XCOMM!/bin/ksh
+XCOMM $TOG: configShlibs.src /main/1 1998/03/11 16:18:33 mgreess $
+
+#define STAR *
+
+XCOMM ############################################
+RemoveShlibFiles()
+{
+    while read SRC
+    do
+      if [ "$SRC" != "" ]
+      then
+       rm -f $SRC
+       dirname=${SRC%/STAR}
+       if [ -d $dirname ]
+       then
+         cd $dirname
+         while [ "$dirname" != "$CDE_TOP" ]
+         do
+           cd ..
+           rmdir ${dirname##STAR/} >/dev/null 2>/dev/null
+           dirname=${dirname%/STAR}
+         done
+       fi
+      fi
+    done <<-EOF
+#include "CDE-SHLIBS.list"
+       EOF
+}
+
+VerifyInstalledFiles()
+{
+    echo "Status   mode    owner   group   filename"
+    echo "-----------------------------------------"
+XCOMM    exists  correct correct correct  /usr/dt/foo1
+XCOMM    MISSING  WRONG   WRONG   WRONG   /usr/dt/foo2
+XCOMM        exists    the link is correct    /usr/dt/link
+
+    while read SRC
+    do
+#include "../verify.func"
+    done <<-EOF
+#include "CDE-SHLIBS.lst"
+       EOF
+}
+
+#include "../option.func"
+
+MakeTheLink()
+{
+XCOMM
+XCOMM Usage: configTT
+XCOMM
+XCOMM creates links in the install tree libtt.so -> libtt.so.1
+XCOMM
+
+  cd CDE_INSTALLATION_TOP/lib
+
+  for lib in `/bin/ls *.so.*`
+  do
+    link=`echo $lib | cut -d. -f1,2`
+
+    rm -f $link
+    ln -s $lib $link
+
+  done
+
+}
+
+XCOMM #########################################################################
+XCOMM
+XCOMM                          Main Body
+XCOMM
+XCOMM #########################################################################
+
+PRODUCT=CDE
+FILESET=CDE-SHLIBS
+retval=0
+CDE_TOP=CDE_INSTALLATION_TOP
+CDE_CONF_TOP=CDE_CONFIGURATION_TOP
+
+  HandleOption $*
+
+  if [ "$OPERATION" = "deconfigure" ]
+  then
+
+    echo "de-Configuring for CDE-SHLIBS..."
+
+    RemoveShlibFiles
+
+    /sbin/ldconfig -R
+
+    VerifyInstalledFiles
+
+  elif [ "$OPERATION" = "configure" ]
+  then
+
+    MakeTheLink
+
+    /sbin/ldconfig -m "${DT_TOP}/lib"
+
+  elif [ "$OPERATION" = "verify" ]
+  then
+
+    VerifyInstalledFiles
+
+  fi
+
+  return $retval
diff --git a/cde/admin/IntegTools/post_install/freebsd/configTT.src b/cde/admin/IntegTools/post_install/freebsd/configTT.src
new file mode 100755 (executable)
index 0000000..8c9556a
--- /dev/null
@@ -0,0 +1,150 @@
+XCOMM! /bin/ksh
+XCOMM #######
+XCOMM  Product: CDE
+XCOMM  Fileset: CDE-TT
+XCOMM  configure
+XCOMM  @(#) $TOG: configTT.src /main/1 1998/03/11 16:18:40 mgreess $
+XCOMM #######
+XCOMM
+XCOMM (c) Copyright Hewlett-Packard Company, 1993
+XCOMM
+XCOMM #######
+#define HASH #
+
+PRODUCT=CDE
+FILESET=CDE-TT
+DO_CONFIGURATION=""
+retval=0
+
+FixInetdDotConf()
+{
+FILE=/etc/inetd.conf
+TMPFILE=/tmp/inetd.conf
+TTDBSERVERD=CDE_INSTALLATION_TOP/bin/rpc.ttdbserver
+
+XCOMM
+XCOMM see if it already exists
+XCOMM
+
+    nawk -v ttdb=$TTDBSERVERD \
+       '{if ($1 == "ttdbserver/1" && $6 != ttdb)
+               print "#cde " $0;
+         else
+               print $0
+        }' $FILE >$TMPFILE
+
+    cp $TMPFILE $FILE
+    rm $TMPFILE
+
+    awk '{if ($1 == "ttdbserver/1")
+               print $0 > "/tmp/tt-already-there"
+        }' $FILE >/dev/null
+
+    if [ ! -f /tmp/tt-already-there ]
+    then
+        echo "ttdbserver/1 stream rpc/tcp4 wait root $TTDBSERVERD $TTDBSERVERD" \
+                >>$FILE
+    else
+       rm /tmp/tt-already-there
+    fi
+}
+
+UnfixInetdDotConf()
+{
+FILE=/etc/inetd.conf
+TMPFILE=/tmp/inetd.conf
+TTDBSERVERD=CDE_INSTALLATION_TOP/bin/rpc.ttdbserver
+
+    nawk -v ttdb=$TTDBSERVERD \
+       '{if ($1 == "ttdbserver/1" && $6 == ttdb)
+               ;
+         else
+               print $0
+        }' $FILE >$TMPFILE
+
+    cp $TMPFILE $FILE
+    rm $TMPFILE
+
+    awk '{if ($1 == "#cde" && ($2 == "ttdbserver/1" || $2 == "ttdbserver")) {
+               $1 = $2;
+               $2 = ""
+            }
+            print $0
+        }' $FILE >$TMPFILE
+
+    cp $TMPFILE $FILE
+    rm $TMPFILE
+}
+
+RemoveTTFiles()
+{
+    while read SRC
+    do
+      if [ "$SRC" != "" ]
+      then
+       rm -f $SRC
+       dirname=${SRC%/STAR}
+       if [ -d $dirname ]
+       then
+         cd $dirname
+         while [ "$dirname" != "$CDE_TOP" ]
+         do
+           cd ..
+           rmdir ${dirname##STAR/} >/dev/null 2>/dev/null
+           dirname=${dirname%/STAR}
+         done
+       fi
+      fi
+    done <<-EOF
+#include "CDE-TT.list"
+       EOF
+}
+
+VerifyInstalledFiles()
+{
+    echo "Status   mode    owner   group   filename"
+    echo "-----------------------------------------"
+XCOMM    exists  correct correct correct  /usr/dt/foo1
+XCOMM    MISSING  WRONG   WRONG   WRONG   /usr/dt/foo2
+XCOMM        exists    the link is correct    /usr/dt/link
+
+    while read SRC
+    do
+#include "../verify.func"
+    done <<-EOF
+#include "CDE-TT.lst"
+       EOF
+}
+
+#include "../option.func"
+
+XCOMM ######################################################################
+XCOMM
+XCOMM                          Main Body
+XCOMM
+XCOMM ######################################################################
+
+  HandleOption $*
+
+  if [ "$OPERATION" = "configure" ]
+  then
+
+    : FixInetdDotConf
+
+  elif [ "$OPERATION" = "deconfigure" ]
+  then
+
+    : UnfixInetdDotConf
+
+    RemoveTTFiles
+
+    VerifyInstalledFiles
+
+  elif [ "$OPERATION" = "verify" ]
+  then
+
+    VerifyInstalledFiles
+
+  fi
+
+  return $retval
index 1a300642b09a6a5ed2b3eba7a3f3e2bf73081970..cc6bf1369ee5bf8bf8d8e7f62a920a054b82174a 100644 (file)
@@ -154,6 +154,9 @@ XCOMM operating system:  OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVe
 #define StandardIncludes       -I/usr/local/include
 #define BuildLibPathVar                LD_LIBRARY_PATH
 
+#define DefaultUserPath                /bin:/usr/bin:/usr/local/bin:$(BINDIR)
+#define DefaultSystemPath      /sbin:/usr/sbin:/bin:/usr/bin:$(BINDIR)
+
 #define TroffCmd               groff -Tps
 #define SetTtyGroup            YES
 #define HasNdbm                        YES
@@ -167,8 +170,6 @@ XCOMM operating system:  OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVe
 #define HasPlugin              YES
 #define VendorHasX11R6_3libXext        YES     /* XC or XFree86 3.3.1 */
 
-#include <bsdLib.rules>
+#define CDESharedRev           2
 
-#ifdef i386Architecture
-#include <xfree86.cf>
-#endif
+#include <bsdLib.rules>
index 0d18ecac2f5472c05e98a1dfa7b2321052fbb4e1..5f9d69d336f8d54152e77362f474839807fde0fd 100644 (file)
@@ -49,13 +49,13 @@ AllTarget(Concat(lib,libname.so.rev))                                       @@\
                                                                        @@\
 Concat(lib,libname.so.rev):  solist $(EXTRALIBRARYDEPS)                        @@\
        $(RM) $@~                                                       @@\
-       (cd down; $(LD) -o up/$@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS)) @@\
+       (cd down; $(LD) -o up/$@~ -soname $@ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS)) @@\
        $(RM) $@                                                        @@\
        $(MV) $@~ $@                                                    @@\
        $(RM) Concat(lib,libname.so)                                    @@\
        $(LN) $@ Concat(lib,libname.so)                                 @@\
        LinkBuildLibrary($@)                                            @@\
-       LinkBuildLibrary(Concat(lib,libname.so))                        @@\
+       (cd $(BUILDLIBDIR) && $(LN) $@ Concat(lib,libname.so))          @@\
                                                                        @@\
 clean::                                                                        @@\
        $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
index a9db7f8f6c4e6cc91ac257d341998796c6bbbfb6..c756ca6efa7e232970db9cc4fe5bc47e928b9f0a 100644 (file)
@@ -1295,3 +1295,130 @@ lib/DtMmdb/libDtMmdb.so.0.0
 }
 XCOMM 
 #endif
+
+XCOMM
+XCOMM
+XCOMM >>-----------------------------
+XCOMM  FreeBSD libraries
+XCOMM <<-----------------------------
+XCOMM
+XCOMM
+lib/DtHelp/libDtHelp.so.2
+{ freebsd
+        install_target = /usr/dt/lib/libDtHelp.so.2
+        mode = 0555
+}
+XCOMM
+./libDtHelp.so.2
+{ freebsd
+        install_target = /usr/dt/lib/libDtHelp.so
+        type = sym_link
+}
+XCOMM
+lib/DtPrint/libDtPrint.so.2
+{ freebsd
+        install_target = /usr/dt/lib/libDtPrint.so.2
+        mode = 0555
+}
+XCOMM
+./libDtPrint.so.2
+{ freebsd
+        install_target = /usr/dt/lib/libDtPrint.so
+        type = sym_link
+}
+XCOMM
+lib/DtMrm/libDtMrm.so.2
+{ freebsd
+        install_target = /usr/dt/lib/libDtMrm.so.2
+        mode = 0555
+}
+XCOMM
+./libDtMrm.so.2
+{ freebsd
+        install_target = /usr/dt/lib/libDtMrm.so
+        type = sym_link
+}
+XCOMM
+lib/DtSvc/libDtSvc.so.2
+{ freebsd
+        install_target = /usr/dt/lib/libDtSvc.so.2
+        mode = 0555
+}
+XCOMM
+./libDtSvc.so.2
+{ freebsd
+        install_target = /usr/dt/lib/libDtSvc.so
+        type = sym_link
+}
+XCOMM
+lib/DtWidget/libDtWidget.so.2
+{ freebsd
+        install_target = /usr/dt/lib/libDtWidget.so.2
+        mode = 0555
+}
+XCOMM
+./libDtWidget.so.2
+{ freebsd
+        install_target = /usr/dt/lib/libDtWidget.so
+        type = sym_link
+}
+XCOMM
+lib/DtTerm/libDtTerm.so.2
+{ freebsd
+        install_target = /usr/dt/lib/libDtTerm.so.2
+        mode = 0555
+}
+XCOMM
+./libDtTerm.so.2
+{ freebsd
+        install_target = /usr/dt/lib/libDtTerm.so
+        type = sym_link
+}
+XCOMM
+lib/tt/lib/libtt.so.2
+{ freebsd
+        install_target = /usr/dt/lib/libtt.so.2
+        mode = 0555
+}
+XCOMM
+./libtt.so.2
+{ freebsd
+        install_target = /usr/dt/lib/libtt.so
+        type = sym_link
+}
+XCOMM
+lib/csa/libcsa.so.2
+{ freebsd
+        install_target = /usr/dt/lib/libcsa.so.2
+        mode = 0555
+}
+XCOMM
+./libcsa.so.2
+{ freebsd
+        install_target = /usr/dt/lib/libcsa.so
+        type = sym_link
+}
+XCOMM
+lib/DtSearch/libDtSearch.so.2
+{ freebsd
+        install_target = /usr/dt/lib/libDtSearch.so.2
+       mode = 0555
+}
+XCOMM
+./libDtSearch.so.2
+{ freebsd
+        install_target = /usr/dt/lib/libDtSearch.so
+        type = sym_link
+}
+XCOMM
+lib/DtMmdb/libDtMmdb.so.2
+{ freebsd
+        install_target = /usr/dt/lib/libDtMmdb.so.2
+       mode = 0755
+}
+XCOMM
+./libDtMmdb.so.2
+{ freebsd
+        install_target = /usr/dt/lib/libDtMmdb.so
+        type = sym_link
+}
index 4b1e1d05f0dd9300072da3924f79bcffeaabee75..a7ba46d1e26313fc333f09b4be7b268a10fb5e97 100644 (file)
@@ -12,28 +12,39 @@ XCOMM dtksh dtinfo
 #if defined(LinuxArchitecture)
 DTKSHDIR = 
 DTINFODIR = 
-#elif defined(FreeBSDArchitecture) || defined(OpenBSDArchitecture)
+DTCMDIR = dtcm
+DTLOGINDIR = dtlogin
+#elif defined(OpenBSDArchitecture)
 DTKSHDIR = dtksh
 DTINFODIR = 
+DTCMDIR = dtcm
+DTLOGINDIR = dtlogin
+#elif defined(FreeBSDArchitecture)
+DTKSHDIR = dtksh
+DTINFODIR =
+DTCMDIR = dtcm
+DTLOGINDIR = dtlogin/config
 #else
 DTKSHDIR = dtksh
 DTINFODIR = dtinfo
+DTCMDIR = dtcm
+DTLOGINDIR = dtlogin
 #endif
 
 
-SUBDIRS = dthelp dsdm dtmail dtpad dtfile dtwm dtlogin \
+SUBDIRS = dthelp dsdm dtmail dtpad dtfile dtwm $(DTLOGINDIR) \
        dtsession dthello dtstyle dtexec dtdbcache dticon dtterm \
        dtcalc dtaction dtspcd \
-       dtscreen $(DTKSHDIR) dtcm dtsearchpath \
+       dtscreen $(DTKSHDIR) $(DTCMDIR) dtsearchpath \
         dtappbuilder dtappintegrate dtprintegrate dtconfig \
         dtcreate dtprintinfo fontaliases dtdspmsg ttsnoop \
        dtudcfonted dtudcexch dtimsstart dtdocbook dtpdm dtsr \
        dtpdmd $(DTINFODIR) $(EXTRADIRS)
 
-LINTSUBDIRS = dthelp dsdm dtmail dtpad dtfile dtlogin dtwm \
+LINTSUBDIRS = dthelp dsdm dtmail dtpad dtfile $(DTLOGINDIR) dtwm \
        dtsession dthello dtstyle dtexec dtdbcache dticon dtterm \
        dtcalc dtaction dtcreate \
-       dtscreen $(DTKSHDIR) dtcm dtsearchpath \
+       dtscreen $(DTKSHDIR) $(DTCMDIR) dtsearchpath \
         dtappbuilder dtappintegrate dtprintegrate dtprintinfo dtdspmsg \
        dtudcfonted dtudcexch dtimsstart dtdocbook dtpdm dtsr \
        dtpdmd $(DTINFODIR) $(EXTRADIRS)