]> granicus.if.org Git - nethack/commitdiff
hints system changes and more Mac packaging
authorkeni <keni>
Wed, 23 Dec 2009 20:02:29 +0000 (20:02 +0000)
committerkeni <keni>
Wed, 23 Dec 2009 20:02:29 +0000 (20:02 +0000)
update file headers
add "#-PRE" and "#-POST" keywords (no default) so hints file can wrap Makefile.*
add make var with name of makefile (e.g. MAKEFILE_TOP) so hints file can be
 conditional on the file
add skeletel Mac Qt packaging target
add missing aux file generation for Mac Term packaging

sys/unix/hints/linux
sys/unix/hints/linux-x11
sys/unix/hints/macosx
sys/unix/hints/macosx.sh
sys/unix/hints/macosx10.5
sys/unix/hints/unix
sys/unix/mkmkfile.sh
sys/unix/setup.sh

index bdd8169a5d5f97d7d627624353b3acaf80c885f4..3390a43f6ca5dccc81be5d42c2e08fb215592a52 100644 (file)
@@ -1,8 +1,9 @@
-#      
-#      SCCS Id: @(#)linux 3.5     2007/12/15
+#
+# NetHack 3.5  linux $Date$  $Revision$
 # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
 # NetHack may be freely redistributed.  See license for details. 
 #
+#-PRE
 # Linux hints file
 # This hints file provides a single-user tty build for Linux, specifically
 # for Ubuntu dapper.
index baa316e68c28532f8d94ca93c0ef26165ce9877d..5bd20c9a43ec508b8b440aeedfffe6ad1f0ed1c8 100644 (file)
@@ -1,8 +1,9 @@
-#      
-#      SCCS Id: @(#)linux 3.5     2007/12/16
+#
+# NetHack 3.5  linux-x11 $Date$  $Revision$
 # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
 # NetHack may be freely redistributed.  See license for details. 
 #
+#-PRE
 # Linux hints file
 # This hints file provides a single-user x11 build for Linux, specifically
 # for Ubuntu dapper.
index de2594c00ac343a387f73b84f1ce04dd143e9465..0ef9c342ce8f746ca6fb9f20459a10abc282b52c 100644 (file)
@@ -1,8 +1,9 @@
 #
-#      SCCS Id: @(#)macosx 3.5     2007/12/12
+# NetHack 3.5  macosx $Date$  $Revision$
 # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
 # NetHack may be freely redistributed.  See license for details.
 #
+#-PRE
 # Mac OS X (Darwin) hints file
 # This is for Mac OS X 10.4.10 (Darwin 8.10).  If this doesn't work for some
 # other version of either Darwin or Mac OS X, make a new file for that OS,
index 4eb9e20a98e595f775684929a0ff0be731d0ff2b..712134dfb7961dbf4be9ceab1f3ed3bcec868179 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-#      SCCS Id: @(#)macosx.sh 3.5     2007/12/12
+# NetHack 3.5  macosx.sh $Date$  $Revision$
 # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
 # NetHack may be freely redistributed.  See license for details.
 #
@@ -105,6 +105,73 @@ xgroup2)
 # RecordType: dsRecTypeStandard:Groups
 # SMBSID: S-1-5-21-100
 
+xdescplist)    SVSDOT=`util/makedefs --svs .`
+       cat <<E_O_M;
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+        <key>IFPkgDescriptionDeleteWarning</key>
+        <string></string>
+        <key>IFPkgDescriptionDescription</key>
+        <string>NetHack $SVSDOT for the MacOS X Terminal
+</string>
+        <key>IFPkgDescriptionTitle</key>
+        <string>NetHack</string>
+        <key>IFPkgDescriptionVersion</key>
+        <string>$SVSDOT</string>
+</dict>
+</plist>
+E_O_M
+       ;;
+
+xinfoplist)    SVSDOT=`util/makedefs --svs .`
+       cat <<E_O_M;
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>CFBundleGetInfoString</key>
+       <string>NetHack $SVSDOT for the MacOS X Terminal</string>
+       <key>CFBundleIdentifier</key>
+       <string>org.nethack.term</string>
+       <key>CFBundleName</key>
+       <string>NetHack</string>
+       <key>CFBundleShortVersionString</key>
+       <string>$SVSDOT</string>
+       <key>IFMajorVersion</key>
+       <integer>3</integer>
+       <key>IFMinorVersion</key>
+       <integer>3</integer>
+       <key>IFPkgFlagAllowBackRev</key>
+       <true/>
+       <key>IFPkgFlagAuthorizationAction</key>
+       <string>RootAuthorization</string>
+       <key>IFPkgFlagDefaultLocation</key>
+       <string>/usr/games</string>
+       <key>IFPkgFlagInstallFat</key>
+       <false/>
+       <key>IFPkgFlagIsRequired</key>
+       <false/>
+       <key>IFPkgFlagOverwritePermissions</key>
+       <true/>
+       <key>IFPkgFlagRelocatable</key>
+       <false/>
+       <key>IFPkgFlagRestartAction</key>
+       <string>NoRestart</string>
+       <key>IFPkgFlagRootVolumeOnly</key>
+       <false/>
+       <key>IFPkgFlagUpdateInstalledLanguages</key>
+       <false/>
+       <key>IFPkgFlagUseUserMask</key>
+       <false/>
+       <key>IFPkgFormatVersion</key>
+       <real>0.10000000149011612</real>
+</dict>
+</plist>
+E_O_M
+       ;;
+
 *)      echo "Unknown command $cmd"
        exit 1
         ;;
index 9c278d665868d4b312f6d20e3f54ded4c6d3c723..0cbf9cc11d037e310da34e4308baa6b6b8b35541 100644 (file)
@@ -1,8 +1,9 @@
 #
-#      SCCS Id: @(#)macosx 3.5     2007/12/12
-# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
+# NetHack 3.5  macosx10.5 $Date$  $Revision$
+# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009.
 # NetHack may be freely redistributed.  See license for details.
 #
+#-PRE
 # Mac OS X (Darwin) hints file
 # This is for Mac OS X 10.5.3 (Darwin 9.3).  If this doesn't work for some
 # other version of either Darwin or Mac OS X, make a new file for that OS,
@@ -173,6 +174,8 @@ endif       # !WANT_SOURCE_INSTALL
 # Install.Qt mentions a patch for macos - it's not there (it seems to be in the Qt binary
 # package under the docs directory).
 
+#-POST
+ifdef MAKEFILE_TOP
 ###
 ### Packaging
 ###
@@ -188,10 +191,11 @@ PKGR=$(DEVUTIL)/PackageMaker.app/Contents/MacOS/PackageMaker
 SVS=$(shell $(NHSROOT)/util/makedefs --svs)
 
 build_tty_pkg:
-if defined(WANT_WIN_X11) || defined(WANT_WIN_QT)
-$(error "build_tty_pkg only works for a tty-only build)
+ifneq (,$(WANT_WIN_X11)$(WANT_WIN_QT))
+       -echo build_tty_pkg only works for a tty-only build
+       exit 1
 else
-        $(MAKE) build_package_root
+       $(MAKE) build_package_root
        rm -rf RESOURCES
        mkdir RESOURCES
        enscript --language=rtf -o - < dat/license >RESOURCES/License.rtf
@@ -201,8 +205,8 @@ else
        $(PKGR) --root PKGROOT --info Info.plist -e RESOURCES -v -o NetHack-$(SVS)-mac-Term.pkg
        hdiutil create -verbose -srcfolder NetHack-$(SVS)-mac-Term.pkg Nethack-$(SVS)-mac-Term.dmg
 
-SVS:=$(shell util/makedefs -svs)
-SVSDOT:=$(shell util/makedefs -svs .)
+SVS=$(shell util/makedefs --svs)
+SVSDOT=$(shell util/makedefs --svs .)
 
 build_package_root:
        cd src/..       # make sure we are at TOP
@@ -219,6 +223,46 @@ build_package_root:
        touch PKGROOT/perm PKGROOT/record PKGROOT/logfile
 # XXX may need postinstall script to get perms right for sgid, etc.
        mkdir PKGROOT/save
+# XXX what about a news file?
+endif  # end of build_tty_pkg
+endif  # WANT_WIN_TTY for packaging
 
-endif
-endif
+ifdef WANT_WIN_QT
+# XXX untested and incomplete (see below)
+build_qt_pkg:
+ifneq (,$(WANT_WIN_X11)$(WANT_WIN_TTY))
+       -echo build_qt_pkg only works for a qt-only build
+       exit 1
+else
+       $(MAKE) build_package_root
+       rm -rf NetHackQt
+       mkdir -p NetHackQt/NetHackQt.app/nethackdir/save
+       mkdir NetHackQt/Documentation
+       cp doc/Guidebook.txt doc/nethack.txt doc/recover.txt NetHackQt/Documentation
+
+       osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
+                win/macosx/NetHackRecover.applescript
+       cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
+
+       mkdir -p NetHackQt/NetHackQt.app/Contents/Frameworks
+       cp $(QTDIR)/libqt-mt.3.dylib NetHackQt/NetHackQt.app/Contents/Frameworks
+
+       mkdir NetHackQt/NetHackQt.app/Contents/MacOS
+       mv PKGROOT/nethack NetHackQt/NetHackQt.app/Contents/MacOS
+
+       mv PKGROOT/lib/nethackdir NetHackQt/NetHackQt.app/nethackdir
+
+# XXX still missing:
+#NetHackQt/NetHackQt.app
+# /Contents
+#      Info.plist
+#      Resources/nethack.icns
+#NetHackQt/Documentation
+#NetHackQtRecover.txt
+#NetHack Defaults.txt
+#changes.patch XXX is this still needed?  why isn't it part of the tree?
+#  doesn't go here
+       hdiutil create -verbose -srcfolder NetHackQt NetHack-$(SVS)-macosx-qt.dmg
+endif  # end of build_qt_pkg
+endif  # WANT_WIN_QT for packaging
+endif  # MAKEFILE_TOP
index 4dc8c6c39f3195679e64fdbdc09653fd96b0d65e..d6f230e44e4c7fef0ca608dca2cc2b2f869287c3 100644 (file)
@@ -1,8 +1,9 @@
-#      
-#      SCCS Id: @(#)unix 3.5     2007/12/12
+#
+# NetHack 3.5 unix $Date$  $Revision$
 # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
 # NetHack may be freely redistributed.  See license for details. 
 #
+#-PRE
 # unix hints file
 # This hints file provides the legacy configuration that NetHack has shipped
 # with historically - this means you will most likely need to hand edit .h
index 20f118cb9233cdc4ac191aedf6d9e5e004261fe1..be140aa809037b9d9cb0165e6ec56a9db5b58425 100644 (file)
@@ -1,23 +1,42 @@
 #!/bin/sh
 # NetHack 3.5  mkmkfile.sh     $Date$  $Revision$
-#      SCCS Id: @(#)macosx 3.5     2007/12/12
 # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
 # NetHack may be freely redistributed.  See license for details.
 
 # build one makefile
 # args are:
 #  $1 basefile
-#  $2 install path
-#  $3 hints file
+#  $2 basefile tag
+#  $3 install path
+#  $4 hints file
 
-echo "#" > $2
-echo "# This file is generated automatically.  Do not edit." >> $2
-echo "# Your changes will be lost.  See sys/unix/NewInstall.unx." >> $2
-echo "###" >> $2
-echo "### Start $3" >> $2
-echo "###" >> $2
-cat $3 >> $2
-echo "### end of file" >> $2
-echo "### Start $1" >> $2
-cat $1 >> $2
-echo "### end of file" >> $2
+echo "#" > $3
+echo "# This file is generated automatically.  Do not edit." >> $3
+echo "# Your changes will be lost.  See sys/unix/NewInstall.unx." >> $3
+echo "# Identify this file:" >> $3
+echo "MAKEFILE_$2=1" >> $3
+echo "" >> $3
+
+echo "###" >> $3
+echo "### Start $4 PRE" >> $3
+echo "###" >> $3
+awk '/^#-PRE/,/^#-POST/{ \
+       if(index($0, "#-PRE") == 1) print "# (new segment at source line",NR,")"; \
+       if(index($0, "#-P") != 1) print}' $4 >> $3
+echo "### end $4 PRE" >> $3
+echo "" >> $3
+
+echo "###" >> $3
+echo "### Start $1" >> $3
+echo "###" >> $3
+cat $1 >> $3
+echo "### end of file" >> $3
+echo "" >> $3
+
+echo "###" >> $3
+echo "### Start $4 POST" >> $3
+echo "###" >> $3
+awk '/^#-POST/,/^#-PRE/{ \
+       if(index($0, "#-POST") == 1) print "# (new segment at source line",NR,")"; \
+       if(index($0, "#-P") != 1) print}' $4 >> $3
+echo "### end $4 POST" >> $3
index ccda05bffdd05c5f7e84741f6320e32610c47fee..31844cbe48d5a86776efdf6d3f8ff5feb54ff075 100644 (file)
@@ -1,6 +1,5 @@
 #!/bin/sh
 # NetHack 3.5  setup.sh        $Date$  $Revision$
-#      SCCS Id: @(#)setup.sh 3.5     2007/12/12
 # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
 # NetHack may be freely redistributed.  See license for details.
 #
@@ -18,8 +17,8 @@ x)      hints=/dev/null
         ;;
 esac
 
-/bin/sh ./mkmkfile.sh Makefile.top ../../Makefile $hints
-/bin/sh ./mkmkfile.sh Makefile.dat ../../dat/Makefile $hints
-/bin/sh ./mkmkfile.sh Makefile.doc ../../doc/Makefile $hints
-/bin/sh ./mkmkfile.sh Makefile.src ../../src/Makefile $hints
-/bin/sh ./mkmkfile.sh Makefile.utl ../../util/Makefile $hints
+/bin/sh ./mkmkfile.sh Makefile.top TOP ../../Makefile $hints
+/bin/sh ./mkmkfile.sh Makefile.dat DAT ../../dat/Makefile $hints
+/bin/sh ./mkmkfile.sh Makefile.doc DOC ../../doc/Makefile $hints
+/bin/sh ./mkmkfile.sh Makefile.src SRC ../../src/Makefile $hints
+/bin/sh ./mkmkfile.sh Makefile.utl UTL ../../util/Makefile $hints