Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Macosxpkg #3

Merged
merged 2 commits into from

2 participants

@svniemeijer

This patch makes sure that existing configuration files are preserved when using the installer package on Mac OS X.

svniemeijer added some commits
@svniemeijer svniemeijer Check for 'cc' instead of 'gcc' (since clang is starting to become th…
…e default)
e71f1ff
@svniemeijer svniemeijer Preserve existing configuration files during installation.
This is achieved by renaming any existing configuration files as a pre-install step.
As a post-install step and renamed files are then moved back to their original position (overwriting the config files that came with the installer).
2b16406
@hsleisink hsleisink merged commit 8030ce0 into hsleisink:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 9, 2013
  1. @svniemeijer
  2. @svniemeijer

    Preserve existing configuration files during installation.

    svniemeijer authored
    This is achieved by renaming any existing configuration files as a pre-install step.
    As a post-install step and renamed files are then moved back to their original position (overwriting the config files that came with the installer).
This page is out of date. Refresh to see the latest.
View
2  extra/macosx/diskimage/Installation.txt
@@ -1,8 +1,6 @@
Installation of the Hiawatha webserver
=======================================
-If you've already installed the Hiawatha webserver on this machine, make a backup of the files in /usr/local/etc/hiawatha or /etc/hiawatha.
-
Double-click the .pkg file to start the installation and follow the instructions on the screen. This will install Hiawatha in /usr/local. The configuration files can be found in /usr/local/etc/hiawatha.
Open a Terminal and execute 'sudo /usr/local/sbin/hiawatha' to start the Hiawatha webserver.
View
11 extra/macosx/scripts/postinstall
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+cd /usr/local/etc/hiawatha
+
+files="cgi-wrapper.conf hiawatha.conf index.xslt mimetype.conf"
+
+for file in $files ; do
+ if [ -f $file.installer.backup ]; then
+ mv $file.installer.backup $file
+ fi
+done
View
11 extra/macosx/scripts/preinstall
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+cd /usr/local/etc/hiawatha
+
+files="cgi-wrapper.conf hiawatha.conf index.xslt mimetype.conf"
+
+for file in $files ; do
+ if [ -f $file ]; then
+ mv $file $file.installer.backup
+ fi
+done
View
4 extra/make_macosx_package
@@ -16,7 +16,7 @@ fi
# Checking for tools required for building a MacOS X package
#
echo "-- Checking for required tools"
-tools="/usr/bin/gcc /usr/bin/pkgbuild /usr/bin/productbuild /usr/bin/hdiutil"
+tools="/usr/bin/cc /usr/bin/pkgbuild /usr/bin/productbuild /usr/bin/hdiutil"
missing=""
for tool in ${tools}; do
if [ ! -f ${tool} ]; then
@@ -55,7 +55,7 @@ cp ../extra/macosx/org.hiawatha-webserver.httpd.plist root/Library/LaunchDaemons
echo "-- Building package"
cp -r ../extra/macosx/diskimage .
version=`grep VERSION config.h | cut -f2 -d'"'`
-pkgbuild --root root --version ${version} --identifier org.hiawatha-webserver.httpd hiawatha.pkg
+pkgbuild --root root --scripts ../extra/macosx/scripts --version ${version} --identifier org.hiawatha-webserver.httpd hiawatha.pkg
productbuild --distribution ../extra/macosx/Distribution.xml --resources ../extra/macosx diskimage/hiawatha-${version}.pkg
echo "-- Buiding disk image"
hdiutil create ../"Hiawatha ${version}".dmg -srcfolder diskimage -volname "Hiawatha ${version}" -ov
Something went wrong with that request. Please try again.