commit 707cc42dec2439da1fdee4ed3eb0e0a44d5ea9fe from: Alexander Barton date: Tue Aug 12 15:30:38 2008 UTC 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. commit - 30f1ed211d5014b964f147539970befcd7c9f7d2 commit + 707cc42dec2439da1fdee4ed3eb0e0a44d5ea9fe blob - d678f171d8361c2c087c1fdf61b42d31de832cf5 blob + 23ed90bccb007dd7a485cbd946973729ca93a2e8 --- Makefile.am +++ 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- blob - f02835fb9bca4d0b7eacaa00106ea90487235458 blob + 7cbc80ac13653164754515de97dfc19be398122f --- configure.in +++ 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 blob - 42847d1e8ec93c8d687a2a243c4288acd908c9b9 blob + 2f1d141c8fc130073946c9528b90b31bc2c0b7a1 --- contrib/MacOSX/Makefile.am +++ 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 blob - /dev/null blob + bc1e5a791fd3e6cf70d20d8a075301bd8049f777 (mode 644) --- /dev/null +++ contrib/MacOSX/ngIRCd.pmdoc/01ngircd-contents.xml @@ -0,0 +1 @@ + \ No newline at end of file blob - /dev/null blob + 66dbd1f087b324ab38efd9c484706f1ead17c4b4 (mode 644) --- /dev/null +++ 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 blob - /dev/null blob + bc1e5a791fd3e6cf70d20d8a075301bd8049f777 (mode 644) --- /dev/null +++ contrib/MacOSX/ngIRCd.pmdoc/02de-contents.xml @@ -0,0 +1 @@ + \ No newline at end of file blob - /dev/null blob + 59b5202355d045efdd310fef3b423e6a863bedde (mode 644) --- /dev/null +++ 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 blob - /dev/null blob + e11eeb1e57fd3adc2187a794c5377c29d438f396 (mode 644) --- /dev/null +++ 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- blob - /dev/null blob + 553e305091abbc400727294378f831fa8748b92c (mode 644) --- /dev/null +++ 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 blob - /dev/null blob + 9cca7b48a3453a1315622fc2eed38714bf3dace0 (mode 755) --- /dev/null +++ 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- blob - /dev/null blob + 0e13bacf24ab16fafb64e24bee2e4cd11e73b8e5 (mode 755) --- /dev/null +++ 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-