diff options
| author | Alexander Barton <alex@barton.de> | 2008-08-12 17:30:38 +0200 |
|---|---|---|
| committer | Alexander Barton <alex@barton.de> | 2008-08-12 17:30:38 +0200 |
| commit | 707cc42dec2439da1fdee4ed3eb0e0a44d5ea9fe (patch) | |
| tree | 9dcfde47b5a9832df6353ef4445c436fd5101f02 /contrib/MacOSX/postinstall.sh | |
| parent | 30f1ed211d5014b964f147539970befcd7c9f7d2 (diff) | |
| download | ngircd-707cc42dec2439da1fdee4ed3eb0e0a44d5ea9fe.tar.gz ngircd-707cc42dec2439da1fdee4ed3eb0e0a44d5ea9fe.zip | |
New make target: "osxpkg" to create an Mac OS X installer package.
This patch adds a new make target, "osxpkg", to the main Makefile which gereates a Apple Mac OS X installer package of ngIRCd. The packagemaker(1) project bundle is stored in contrib/MacOSX/ngIRCd.pmdoc.
Diffstat (limited to 'contrib/MacOSX/postinstall.sh')
| -rwxr-xr-x | contrib/MacOSX/postinstall.sh | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/contrib/MacOSX/postinstall.sh b/contrib/MacOSX/postinstall.sh new file mode 100755 index 00000000..9cca7b48 --- /dev/null +++ b/contrib/MacOSX/postinstall.sh @@ -0,0 +1,42 @@ +#!/bin/sh +# ngIRCd Mac OS X postinstall/postupgrade script + +LDPLIST="/Library/LaunchDaemons/de.barton.ngircd.plist" + +if [ ! -e /etc/ngircd ]; then + echo "Creating symlink: /opt/ngircd/etc -> /etc/ngircd" + ln -s /opt/ngircd/etc /etc/ngircd || exit 1 +else + echo "/etc/ngircd already exists. Don't create symlink." +fi + +if [ ! -e /opt/ngircd/etc/ngircd.conf ]; then + echo "Creating default configuration: /opt/ngircd/etc/ngircd.conf" + cp /opt/ngircd/share/doc/ngircd/sample-ngircd.conf \ + /opt/ngircd/etc/ngircd.conf || exit 1 +else + echo "/opt/ngircd/etc/ngircd.conf exists. Don't copy sample file." +fi +chmod o-rwx /opt/ngircd/etc/ngircd.conf + +if [ -f "$LDPLIST" ]; then + echo "Fixing ownership and permissions of LaunchDaemon script ..." + chown root:wheel "$LDPLIST" || exit 1 + chmod 644 "$LDPLIST" || exit 1 +fi + +if [ -f /tmp/ngircd_needs_restart ]; then + echo "ngIRCd should be (re-)started ..." + if [ -r "$LDPLIST" ]; then + echo "LaunchDaemon script found, starting daemon ..." + launchctl load -w "$LDPLIST" || exit 1 + echo "OK, LaunchDaemon script loaded successfully." + else + echo "LaunchDaemon script not installed. Can't start daemon." + fi +else + echo "Not loading LaunchDaemon script." +fi +rm -f /tmp/ngircd_needs_restart + +# -eof- |