repo: ngircd
action: commit
revision: 
path_from: 
revision_from: 707cc42dec2439da1fdee4ed3eb0e0a44d5ea9fe:
path_to: 
revision_to: 
git.thebackupbox.net
ngircd
git clone git://git.thebackupbox.net/ngircd
commit 707cc42dec2439da1fdee4ed3eb0e0a44d5ea9fe
Author: Alexander Barton 
Date:   Tue Aug 12 17:30:38 2008 +0200

    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.

diff --git a/Makefile.am b/Makefile.am
index d678f171d8361c2c087c1fdf61b42d31de832cf5..
index ..23ed90bccb007dd7a485cbd946973729ca93a2e8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,6 +15,7 @@ SUBDIRS = doc src man contrib

 clean-local:
 	rm -f build-stamp*
+	rm -rf ngircd.dest

 maintainer-clean-local:
 	rm -rf autom4te.cache
@@ -45,4 +46,27 @@ deb:
 	[ -f debian/rules ] || ln -s contrib/Debian debian
 	dpkg-buildpackage -rfakeroot

+osxpkg:
+	@packagemaker >/dev/null 2>&1; [ $$? -ge 1 ] \
+	 || ( echo; echo "Error: \"packagemaker\" not found!"; echo; exit 2)
+	make clean
+	./configure --prefix=/opt/ngircd
+	make xcode
+	make -C contrib/MacOSX de.barton.ngircd.plist
+	mkdir -p ngircd.dest/opt/ngircd/sbin
+	DESTDIR="$$PWD/ngircd.dest" make -C doc install
+	DESTDIR="$$PWD/ngircd.dest" make -C contrib install
+	DESTDIR="$$PWD/ngircd.dest" make -C man install
+	cp contrib/MacOSX/build/Default/ngIRCd \
+	 ngircd.dest/opt/ngircd/sbin/ngircd
+	rm ngircd.dest/opt/ngircd/etc/ngircd.conf
+	echo "Have a nice day IRCing!" >ngircd.dest/opt/ngircd/etc/ngircd.motd
+	chmod -R a-s,og-w,a+rX ngircd.dest
+	cd contrib/MacOSX && packagemaker \
+	 --doc ngIRCd.pmdoc \
+	 --out ../../$(distdir).mpkg
+	rm -f $(distdir).mpkg.zip
+	zip -ro9 $(distdir).mpkg.zip $(distdir).mpkg
+	rm -rf ngircd.dest $(distdir).mpkg
+
 # -eof-
diff --git a/configure.in b/configure.in
index f02835fb9bca4d0b7eacaa00106ea90487235458..
index ..7cbc80ac13653164754515de97dfc19be398122f 100644
--- a/configure.in
+++ b/configure.in
@@ -497,6 +497,7 @@ AC_OUTPUT([ \
 	contrib/Debian/Makefile \
 	contrib/MacOSX/Makefile \
 	contrib/MacOSX/ngIRCd.xcodeproj/Makefile \
+	contrib/MacOSX/ngIRCd.pmdoc/Makefile \
 ])

 type dpkg >/dev/null 2>&1
diff --git a/contrib/MacOSX/Makefile.am b/contrib/MacOSX/Makefile.am
index 42847d1e8ec93c8d687a2a243c4288acd908c9b9..
index ..2f1d141c8fc130073946c9528b90b31bc2c0b7a1 100644
--- a/contrib/MacOSX/Makefile.am
+++ b/contrib/MacOSX/Makefile.am
@@ -9,7 +9,7 @@
 # Please read the file COPYING, README and AUTHORS for more information.
 #

-SUBDIRS = ngIRCd.xcodeproj
+SUBDIRS = ngIRCd.xcodeproj ngIRCd.pmdoc

 EXTRA_DIST = de.barton.ngircd.plist.tmpl config.h

diff --git a/contrib/MacOSX/ngIRCd.pmdoc/01ngircd-contents.xml b/contrib/MacOSX/ngIRCd.pmdoc/01ngircd-contents.xml
new file mode 100644
index 0000000000000000000000000000000000000000..bc1e5a791fd3e6cf70d20d8a075301bd8049f777
--- /dev/null
+++ b/contrib/MacOSX/ngIRCd.pmdoc/01ngircd-contents.xml
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/contrib/MacOSX/ngIRCd.pmdoc/01ngircd.xml b/contrib/MacOSX/ngIRCd.pmdoc/01ngircd.xml
new file mode 100644
index 0000000000000000000000000000000000000000..66dbd1f087b324ab38efd9c484706f1ead17c4b4
--- /dev/null
+++ b/contrib/MacOSX/ngIRCd.pmdoc/01ngircd.xml
@@ -0,0 +1 @@
+de.barton.ngircd.daemon.pkg1../../ngircd.dest/parentscripts.postinstall.pathscripts.postinstall.isRelativeTypescripts.preupgrade.pathinstallFrom.isRelativeTypeversionscripts.preinstall.isRelativeTypeidentifierinstallTopreinstall.shpreinstall.sh
\ No newline at end of file
diff --git a/contrib/MacOSX/ngIRCd.pmdoc/02de-contents.xml b/contrib/MacOSX/ngIRCd.pmdoc/02de-contents.xml
new file mode 100644
index 0000000000000000000000000000000000000000..bc1e5a791fd3e6cf70d20d8a075301bd8049f777
--- /dev/null
+++ b/contrib/MacOSX/ngIRCd.pmdoc/02de-contents.xml
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/contrib/MacOSX/ngIRCd.pmdoc/02de.xml b/contrib/MacOSX/ngIRCd.pmdoc/02de.xml
new file mode 100644
index 0000000000000000000000000000000000000000..59b5202355d045efdd310fef3b423e6a863bedde
--- /dev/null
+++ b/contrib/MacOSX/ngIRCd.pmdoc/02de.xml
@@ -0,0 +1 @@
+de.barton.ngircd.launchscript.pkg1de.barton.ngircd.plist/Library/LaunchDaemonsparentscripts.postinstall.pathscripts.postupgrade.pathinstallFrom.isRelativeTypeinstallTo.pathinstallToidentifierpostinstall.shpostinstall.sh
\ No newline at end of file
diff --git a/contrib/MacOSX/ngIRCd.pmdoc/Makefile.am b/contrib/MacOSX/ngIRCd.pmdoc/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..e11eeb1e57fd3adc2187a794c5377c29d438f396
--- /dev/null
+++ b/contrib/MacOSX/ngIRCd.pmdoc/Makefile.am
@@ -0,0 +1,18 @@
+#
+# ngIRCd -- The Next Generation IRC Daemon
+# Copyright (c)2001-2008 Alexander Barton 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# Please read the file COPYING, README and AUTHORS for more information.
+#
+
+EXTRA_DIST = index.xml \
+ 01ngircd-contents.xml 01ngircd.xml 02de-contents.xml 02de.xml
+
+maintainer-clean-local:
+	rm -f Makefile Makefile.in
+
+# -eof-
diff --git a/contrib/MacOSX/ngIRCd.pmdoc/index.xml b/contrib/MacOSX/ngIRCd.pmdoc/index.xml
new file mode 100644
index 0000000000000000000000000000000000000000..553e305091abbc400727294378f831fa8748b92c
--- /dev/null
+++ b/contrib/MacOSX/ngIRCd.pmdoc/index.xml
@@ -0,0 +1,188 @@
+ngIRCd/Users/alex/Desktop/ngIRCd.mpkgde.barton.ngircdngIRCd – next generation IRC (Internet Relay Chat) server daemon//Library/LaunchDaemons01ngircd.xml02de.xmlproperties.customizeOptionproperties.titledescriptionproperties.anywhereDomainproperties.systemDomain
\ No newline at end of file
diff --git a/contrib/MacOSX/postinstall.sh b/contrib/MacOSX/postinstall.sh
new file mode 100755
index 0000000000000000000000000000000000000000..9cca7b48a3453a1315622fc2eed38714bf3dace0
--- /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-
diff --git a/contrib/MacOSX/preinstall.sh b/contrib/MacOSX/preinstall.sh
new file mode 100755
index 0000000000000000000000000000000000000000..0e13bacf24ab16fafb64e24bee2e4cd11e73b8e5
--- /dev/null
+++ b/contrib/MacOSX/preinstall.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+# ngIRCd Mac OS X preinstall/preupgrade script
+
+LDPLIST="/Library/LaunchDaemons/de.barton.ngircd.plist"
+
+rm -f /tmp/ngircd_needs_restart || exit 1
+if [ -r "$LDPLIST" ]; then
+	echo "LaunchDaemon script found, checking status ..."
+	launchctl list | fgrep "de.barton.ngIRCd" >/dev/null 2>&1
+	if [ $? -eq 0 ]; then
+		# ngIRCd is already running; stop it and touch a
+		# "stamp file" so that we know that we have to
+		# restart it after installation/upgrade.
+		echo "ngIRCd is already running; stop it ..."
+		launchctl unload "$LDPLIST" || exit 1
+		echo "Daemon has been stopped."
+		touch /tmp/ngircd_needs_restart || exit 1
+	else
+		echo "ngIRCd is not running."
+	fi
+else
+	echo "LaunchDaemon script not found."
+fi
+
+# -eof-

-----END OF PAGE-----