# stargnud/cfg - "Build" settings for package

#---------------------------------------------------------------------

[technotes]

1. "stargnud" is a fork of "noegnud" 0.8.3.

"stargnud" is more limited than "noegnud", in some respects.  Most im-
portantly:

      a. "stargnud" doesn't support SlashEm
      b. This version has fewer "tilesets"
      c. Some options are omitted
      d. This version only runs under Linux

However, several improvements have been made:

      a. GUI shortcuts have been  added --  just press F2 to cycle GUI
         modes or F3 to cycle themes.  You  can also  press  alt-F2 or
         alt-F3 to cycle backwards.

      b. This version  implements  phasers,  tricorders, grenades, and
         nuclear weapons.

         Ed. note: I'm aware that SlashEm supports grenades (and gren-
         ade launchers). Therefore,  grenades aren't really a new fea-
         ture.  However, for what it's worth, they're new to Noegnud's
         Nethack mode.

      c. This version enables sound-card support automatically.

      d. This version has  better support for  older keyboards  (PC-AT
         keyboards, in particular).

      e. Noegnud  uses a "strobe" lighting effect  that's interesting,
         but distracting. Stargnud disables the "strobe" effect.

      f. A few Nethack sounds have been added  (cat meow and dog bark,
         borrowed from Falcon's Eye mode,  plus an "eating" sound, cat
         purr,  and  slightly broader use of  the existing  "landmine"
         sound).

      g. The Abigabi tileset images have been  sharpened  slightly and
         some image-file names have been corrected  (the  filename ex-
         tensions were wrong).

      h. Some additional bugs have been fixed,  including a few crash-
         es.

#---------------------------------------------------------------------

2. As of 2007,  the official "noegnud" web site seemed to  have disap-
peared. Note: The "noegnud" web page at Sourceforge wasn't the offici-
al site. The original author discontinued his association with Source-
forge circa 2004.

Therefore,  there's no  official URL for the original "noegnud" source
tarball that we started with.  However,  you  should be able  to get a
copy of the original tarball from the same place that you obtained the
modified version.

#---------------------------------------------------------------------

3. "stargnud" is based on a version of  "noegnud" that  was apparently
distributed under the  Nethack General  Public License.  However, this
isn't 100% clear, and this assertion shouldn't be treated as legal ad-
vice.

Circa 2004,  the original author proposed switching the code to a spe-
cial license.  There  were objections to the new license,  and  it ap-
pears  that  the switch didn't take place (in 2004, at least).  There-
fore,  the  old license  probably applies to the  copy that we started
with (it's a 2004 version).

Note:  These  notes  only apply  to  2004 versions of  "noegnud".  The
original author  released  at  least  one version  of  "noegnud" after
2004 (i.e., "noegnud" 0.8.4). However, due to the disappearance of the
official website,  nothing  is  known about the  license used for that
version.

For  more information,  try Wikipedia.  As of early 2007,  there was a
Wikipedia entry for "noegnud" that discusses license issues in greater
detail.

#---------------------------------------------------------------------

4. "stargnud" (like "noegnud")  is essentially a GUI wrapper that runs
on  top of  core program(s) (e.g., "nethack").  The original "noegnud"
source package  didn't include the core-program source code.  Instead,
it  downloaded  the  source  code  from  Sourceforge  automatically at
"build" time.

This version  includes source code for the (single) variant supported;
i.e., the new source tarball is self-contained. Specifically, the sou-
rce  tree  includes an  embedded tarball named  "nethack-343-src.tgz",
which contains the source code for  Nethack 3.4.3.  The latter tarball
was obtained originally from:

      http://dl.sourceforge.net/sourceforge/nethack/\
nethack-343-src.tgz

#---------------------------------------------------------------------

5. "stargnud" adds a startup wrapper to the existing GUI.  The startup
wrapper is a simple  "gtk2-perl" script which  executes  a dialog box.
The dialog box explains a few issues (the exact number depends  on the
local system).  For  more information,  see the files "readme.txt" and
"stargnud.wrapper" provided in the source tree.

#---------------------------------------------------------------------

6. This package can't set "exepack = yes",  because the package's main
executable requires a special attribute,  and the  distro's executable
compressor (upx) doesn't support special attributes. However, the exe-
cutable is fairly large, so compression is a good idea. Therefore, the
"build" block used compresses  the executable directly.  As a workaro-
und,  we remove the special attribute,  run "upx", and restore the at-
tribute afterwards.

#---------------------------------------------------------------------

7. In theory,  if you're a Nethack expert,  you can add new objects to
the game. However, this version requires some extra steps  (beyond the
usual modifications).  For  more  information,  see the # "readme.txt"
file provided in the source tree.

#---------------------------------------------------------------------

8. As of early 2008, the sizes of this distro's versions of "stargnud"
were as follows:

      Normal      hard-disk copy = 76 MB
      LiveDistro "squashfs" copy = 59 MB

#---------------------------------------------------------------------

[buildtimes]

00.01 hours (or 000.57 minutes) - Dell Inspiron 6400 2.0 GHz Intel Duo
                                  7200 2GB RAM
00.02 hours (or 001.28 minutes) - ThinkPad E540 i7 4x2 16GB RAM
00.11 hours (or 006.37 minutes) - Compaq 1.7 GHz Intel Pentium 4 512MB
                                  RAM

#---------------------------------------------------------------------

[settings]
altpkg    = yes
ldbefore  = -lm -lc
configure = none
license   = See "technotes" in "cfg" file
setup     = boot
setpaths  = xorg
tmpsize   = 141M

#---------------------------------------------------------------------

[depends]
alsa
cpancore
jpeg
ncurses
sdl
slang
xorg

#---------------------------------------------------------------------

[build]
DIR=`pwd`/variants/nethack-3.4.3/include
export LACINCDIRS=$DIR:$LACINCDIRS

SPCMISC=$PKGDIR_SPECIAL/misc
cd wrapper
WRAPDIR=`pwd`
cd ..

for x in \
    data/sound/nhs.nethackrc \
    variants/Makefile \
    variants/diffs/*.patch
do
    sed -e "s|/opt/stargnud|$PKGDIR_PROD|g" -i $x
done

cd variants
make spotless
make nh343
make install_nh343
make install_data

EXEFILE=noegnud-0.8.0-nethack-3.4.3
cd $PKGDIR_PROD/lib/noegnud-0.8.0/nethack-3.4.3/
chmod 755  $EXEFILE
upx --lzma $EXEFILE
chmod g+s  $EXEFILE

cd $PKGDIR_PROD/bin
sed -e "s|^MAXNROFPLAYERS=.*|MAXNROFPLAYERS=20|" \
    -i  noegnud-nethack-3.4.3
ln -nsf noegnud-nethack-3.4.3 stargnud.bin

cp -p $WRAPDIR/stargnud.wrapper stargnud
chmod 755 stargnud
ln -nsf   stargnud noegnud
cd ..

mkdir -p misc
cp -p $WRAPDIR/*.png          misc/
cp -p $SPCMISC/Rob_Balder_-_* misc/

#---------------------------------------------------------------------

[postbuild]
BINDIR=$PKGDIR_PROD/bin
PROGBASE=stargnud

cd $BINDIR
mv $PROGBASE $PROGBASE-menu

sed -e "s|__META_LACUTIL__|$SYSDIR_LACUTIL|g" \
    -e "s|__META_PREFIX__|$PKGDIR_PROD|g" \
    -e "s|__META_PRODTREE__|$PRODTREE|g" \
        < $PKGDIR_SPECIAL/wrappers/$PROGBASE.wrapper.in \
        > $PROGBASE
chmod 755 $PROGBASE

#---------------------------------------------------------------------

[setup.boot]
# Remove old "lock" files
rm -f $PKGDIR_PROD/lib/noegnud-*/nethack-*/alock.*

#---------------------------------------------------------------------

# Original URLs. These URLs were valid at one point, but may have died
# since then. If you download newer versions of tarballs [etc.], don't
# delete  the  original versions,  as you may not  be able  to replace
# them.

[urls]
url_debian  = none
url_home    = none          # See "technotes" in "cfg" file
url_lfs     = none
url_tarball = none          # See "technotes" in "cfg" file