]> git.saurik.com Git - apple/syslog.git/blobdiff - syslogd.tproj/after_install.sh
syslog-322.tar.gz
[apple/syslog.git] / syslogd.tproj / after_install.sh
index d54cd6ae27dad78e8dd312c3521c718f0890b33f..6fb20af8f37e85d7510dd394801fffed0a092227 100755 (executable)
@@ -1,35 +1,44 @@
-#! /bin/bash
-set -e
+#! /bin/bash -e -x
 
-if [ "${RC_ProjectName%_Sim}" != "${RC_ProjectName}" ] ; then
+if [[ "${PLATFORM_NAME}" =~ "simulator" ]] ; then
     PLIST="${SRCROOT}"/syslogd.tproj/com.apple.syslogd_sim.plist
+    ASL_CONF="${SRCROOT}"/syslogd.tproj/asl.conf.ios_sim
+elif [[ "${PLATFORM_NAME}" == "macosx" ]] ; then
+    PLIST="${SRCROOT}"/syslogd.tproj/com.apple.syslogd.plist
+    ASL_CONF="${SRCROOT}"/syslogd.tproj/asl.conf.osx
+    SYSLOG_CONF="${SRCROOT}"/syslogd.tproj/syslog.conf
 else
     PLIST="${SRCROOT}"/syslogd.tproj/com.apple.syslogd.plist
+    ASL_CONF="${SRCROOT}"/syslogd.tproj/asl.conf.ios
+    SYSLOG_CONF="${SRCROOT}"/syslogd.tproj/syslog.conf
+    SYSTEM_LOG_CONF="${SRCROOT}"/syslogd.tproj/com.apple.system.log
 fi
 
-DESTDIR="${DSTROOT}${INSTALL_PATH_PREFIX}"/System/Library/LaunchDaemons
+DESTDIR="${DSTROOT}"/private/etc
+install -d -m 0755 -o root -g wheel "${DESTDIR}"
+install -m 0644 -o root -g wheel "${ASL_CONF}" "${DESTDIR}"/asl.conf
+if [[ -n "${SYSLOG_CONF}" ]] ; then
+    install -m 0644 -o root -g wheel "${SYSLOG_CONF}" "${DESTDIR}"
+fi
 
+DESTDIR="${DSTROOT}"/System/Library/LaunchDaemons
 install -d -m 0755 -o root -g wheel "${DESTDIR}"
 install -m 0644 -o root -g wheel "${PLIST}" "${DESTDIR}"/com.apple.syslogd.plist
 plutil -convert binary1 "${DESTDIR}"/com.apple.syslogd.plist
 
-if [ "${RC_ProjectName%_Sim}" != "${RC_ProjectName}" ] ; then
+if [[ "${PLATFORM_NAME}" =~ "simulator" ]] ; then
     exit 0
 fi
 
 install -d -m 0755 -o root -g wheel "$DSTROOT"/private/var/log/asl
 
-PRODUCT=$(xcodebuild -sdk "${SDKROOT}" -version PlatformPath | head -1 | sed 's,^.*/\([^/]*\)\.platform$,\1,')
-
-if [ ${SDKROOT}x = x ]; then
-       PRODUCT=MacOSX
-fi
-
-if [ ${PRODUCT}x = x ]; then
-       PRODUCT=MacOSX
-fi
-
-if [ ${PRODUCT} = iPhone ]; then
+if [[ "${PLATFORM_NAME}" != "macosx" ]]; then
     install -d -m 0755 -o root -g wheel "$DSTROOT"/usr/share/sandbox
     install -m 0644 -o root -g wheel "$SRCROOT"/syslogd.tproj/syslogd.sb "$DSTROOT"/usr/share/sandbox
 fi
+
+if ! [[ "${PLATFORM_NAME}" =~ "simulator" || "${PLATFORM_NAME}" == "macosx" ]]; then
+       DESTDIR="${DSTROOT}"/usr/local/etc/asl
+       install -d -m 0755 -o root -g wheel "${DESTDIR}"
+       install -m 0644 -o root -g wheel "${SYSTEM_LOG_CONF}" "${DESTDIR}"/com.apple.system.log
+fi