File nethack.spec of Package nethack

#
# spec file for package nethack (Version 3.4.3)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           nethack
BuildRequires:  bison flex ncurses-devel texlive-latex
License:        NETHACK GENERAL PUBLIC LICENSE
Group:          Amusements/Games/RPG
AutoReqProv:    on
Requires:       /bin/gzip
PreReq:         permissions
Version:        3.4.3
Release:        291
Summary:        Character Based RPG
Source0:        nethack-343-src.tar.bz2
Source1:        SuSE.tar.bz2
Patch0:         nethack-config.patch
Patch1:         nethack-decl.patch
Patch2:         nethack-misc.patch
Patch3:         nethack-syscall.patch
Patch5:         nethack-gzip.patch
Patch6:         nethack-%{version}-attack-array.patch
Url:            http://www.nethack.org/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This RPG is somewhat cryptic with its character based output. But a
true fan knows and appreciates its complexity and possibilities.

This package contains the text interface.



Authors:
--------
    Stephen L. Ericksen <stevee@cc.usu.edu>

%prep
%setup
%patch0
%patch1
%patch2
%patch3
%patch5
%patch6
tar xvfj %{S:1}
sed -i "s/^CFLAGS.*/& $RPM_OPT_FLAGS/" sys/unix/Makefile*

%build
# create symlinks to makefiles
sh sys/unix/setup.sh 1
# tty
make clean
cp -f SuSE/tty/config.h include/config.h
cp -f SuSE/tty/Makefile.src src/Makefile
make nethack CFLAGS="$RPM_OPT_FLAGS -I../include -I/usr/X11R6/include -D_GNU_SOURCE" LFLAGS="-L/usr/X11R6/%{_lib}"
cp dat/options dat/options.tty
# doc, data, recover...
make Guidebook data oracles options quest.dat rumors dungeon spec_levs check-dlb x11tiles pet_mark.xbm rip.xpm mapbg.xpm
cd util && make CFLAGS="$RPM_OPT_FLAGS -I../include -I/usr/X11R6/include -D_GNU_SOURCE" LFLAGS="-L/usr/X11R6/%{_lib}" recover

%install
rm -rf $RPM_BUILD_ROOT
# direcotries
install -d $RPM_BUILD_ROOT/usr/lib/nethack/
install -d $RPM_BUILD_ROOT/usr/games
install -d $RPM_BUILD_ROOT/usr/share/games/nethack
install -d $RPM_BUILD_ROOT/%{_mandir}/man6/
# game directory
install -d $RPM_BUILD_ROOT/var/games/nethack/save
touch $RPM_BUILD_ROOT/var/games/nethack/perm \
        $RPM_BUILD_ROOT/var/games/nethack/record \
        $RPM_BUILD_ROOT/var/games/nethack/logfile
chmod -R 0775 $RPM_BUILD_ROOT/var/games/nethack
# binaries 
install -m 2755 src/nethack.tty $RPM_BUILD_ROOT/usr/lib/nethack/
# scripts
for STYLE in tty ; do 
    install -m 755 SuSE/$STYLE/nethack.sh $RPM_BUILD_ROOT/usr/games/nethack.$STYLE
    if [ -r SuSE/$STYLE/nethack-tty.sh ] ; then
        install -m 755 SuSE/$STYLE/nethack-tty.sh $RPM_BUILD_ROOT/usr/games/nethack.tty.$STYLE
    fi
done
# options
install -m 644 dat/options.tty $RPM_BUILD_ROOT/usr/lib/nethack/
# man pages
install -m 644 doc/{nethack,lev_comp,dlb,dgn_comp,recover}.6 $RPM_BUILD_ROOT/%{_mandir}/man6/
# doc
mkdir -p $RPM_BUILD_ROOT/%{_docdir}/nethack
install -m 644 doc/Guidebook.{tex,txt} $RPM_BUILD_ROOT/%{_docdir}/nethack
cd doc
tar cvfj $RPM_BUILD_ROOT/%{_docdir}/nethack/fixes.tar.bz2 fixes*
cd ..
chmod 644 $RPM_BUILD_ROOT/%{_docdir}/nethack/fixes.tar.bz2
install -m 644 dat/license $RPM_BUILD_ROOT/%{_docdir}/nethack
# common data
for file in nhdat x11tiles pet_mark.xbm rip.xpm mapbg.xpm license;
do 
  install -m 644 dat/$file  $RPM_BUILD_ROOT/usr/share/games/nethack/
done
# configs
install -m 755 -d $RPM_BUILD_ROOT/etc/nethack
for STYLE in tty ; do 
    install -m 755 SuSE/$STYLE/nethackrc $RPM_BUILD_ROOT/etc/nethack/nethackrc.$STYLE
done
# main launcher script
install -m 755 SuSE/nethack $RPM_BUILD_ROOT/usr/games/
# recover helper
install -m 755 SuSE/recover-helper $RPM_BUILD_ROOT/usr/lib/nethack/
# utils
install -m 755 util/{dgn_comp,dlb,lev_comp,makedefs,recover,tile2x11} $RPM_BUILD_ROOT/usr/lib/nethack/
#install -m 755 util/tilemap $RPM_BUILD_ROOT/usr/lib/nethack/
# x11 app-defaults
#mkdir -p $RPM_BUILD_ROOT/usr/X11R6/lib/X11/app-defaults
#install -m 644 win/X11/NetHack.ad $RPM_BUILD_ROOT/usr/X11R6/lib/X11/app-defaults/NetHack
# x11 font
#/usr/bin/X11/bdftopcf -o nh10.pcf win/X11/nh10.bdf
#mkdir -p $RPM_BUILD_ROOT/usr/X11R6/lib/X11/fonts/misc/
#install -m 644 nh10.pcf $RPM_BUILD_ROOT/usr/X11R6/lib/X11/fonts/misc/
#gzip $RPM_BUILD_ROOT/usr/X11R6/lib/X11/fonts/misc/nh10.pcf
# the font is added into fonts.dir by SuSEconfig.fonts

%clean
rm -rf $RPM_BUILD_ROOT

%post
%run_permissions
%verifyscript
%verify_permissions -e /usr/lib/nethack/nethack.tty

%files
%defattr(-,root,root)
%verify(not mode) %attr(0755,games,games) /usr/lib/nethack/nethack.tty
/usr/lib/nethack/options.tty
/usr/games/nethack*.tty
%config /etc/nethack/nethackrc.tty
%dir /etc/nethack
%dir /usr/lib/nethack
/usr/share/games/nethack
/usr/lib/nethack/recover-helper
/usr/lib/nethack/dgn_comp
/usr/lib/nethack/dlb
/usr/lib/nethack/lev_comp
/usr/lib/nethack/makedefs
/usr/lib/nethack/recover
/usr/lib/nethack/tile2x11
#/usr/lib/nethack/tilemap
%{_docdir}/nethack
%{_mandir}/man6/*
%attr(-,games,games) /var/games/nethack
/usr/games/nethack

%changelog
* Mon Nov 03 2008 pgajdos@suse.cz
- removed readme.SuSE beacause hack-qt, gnomehack and xhack are
  no longer provided [bnc#440906]
* Mon Apr 23 2007 ro@suse.de
- use texlive for building
* Sat Mar 31 2007 aj@suse.de
- Add ncurses-devel, flex, bison to BuildRequires.
* Mon Feb 19 2007 mvaner@suse.cz
- Fixing possible array overflow in check for impossible situation
  (bug #238278)
  - attack-array.patch
* Tue Feb 14 2006 mmarek@suse.cz
- use /usr/lib/nethack instead of /usr/%%_lib/nethack, because we
  don't install any libraries there and /etc/permissions* contains
  /usr/lib/nethack
  [#140336]
- build as user
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Fri May 06 2005 sbrabec@suse.cz
- Fixed duplicated declarations.
- Build with correct CFLAGS.
* Thu Jan 20 2005 ro@suse.de
- drop nethack-qt, gnomehack, xnethack
- re-unite nethack and nethack-common
* Wed Nov 10 2004 ro@suse.de
- reduced neededforbuild
* Thu Sep 30 2004 sbrabec@suse.cz
- Biarch path fix (#31938).
* Mon Feb 09 2004 sbrabec@suse.cz
- Updated to version 3.4.3.
* Wed Nov 05 2003 ro@suse.de
- package according to permissions.secure and add run_permissions
* Mon Sep 01 2003 sbrabec@suse.cz
- Updated to version 3.4.2 (bug #29803).
* Thu Jun 12 2003 coolo@suse.de
- fiddle with %%_docdir
* Sat Jun 07 2003 coolo@suse.de
- compile with latest Qt
- remove buildroot before installing
- package /usr/games/nethack (as installed explicitly)
* Thu Feb 27 2003 sbrabec@suse.cz
- Use gzip instead of compress for compression (bug #22454).
* Wed Feb 26 2003 sbrabec@suse.cz
- Security fix (local buffer overflow).
* Mon Feb 17 2003 sbrabec@suse.cz
- Removed -mminimal-toc from spec file for PPC, since it is now RPM
  default (bug #23266).
* Wed Oct 23 2002 mcihar@suse.cz
- enabled data librarian
- added X11 version
- Qt version renamed to nethack-qt (from xnethack) and built against qt3
  (qt-mt)
- different styles (tty/Qt/Gnome/X11) do not conflict
- new lanching script nethack, ui can be chosen by environment variable
  HACKSTYLE=x11/qt/gnome/tty
- cleaned neededforbuild
- included some tools into nethack-common (was nethack_data)
* Fri Sep 27 2002 ro@suse.de
- Added alsa alsa-devel to neededforbuild (esound)
* Thu Sep 12 2002 kukuk@suse.de
- Add missing obsolete from package rename
* Wed Aug 21 2002 mcihar@suse.cz
- added PreReqs
* Sun Jul 28 2002 kukuk@suse.de
- change group game to games
* Tue Jul 16 2002 mcihar@suse.cz
- nh_data renamed to nethack_data
- nh_binary renamed to nethack_binary
- updated nethack_data description to mention gnomehack also
* Mon Jul 01 2002 olh@suse.de
- build with -mminimal-toc on ppc64
* Thu Jun 06 2002 prehak@suse.de
- fixed for ia64
  - using of macro _syscall3 replaced with ordinary system call
  - kernel header linux/unistd.h replaced with unistd.h
* Fri May 31 2002 prehak@suse.de
- fixed to build on x86_64 and s390x
* Thu May 16 2002 prehak@suse.cz
- updated to new version 3.4.0
* Mon Jan 21 2002 tcrhak@suse.cz
- fixed include dir path for gnome
* Mon Jan 14 2002 tcrhak@suse.cz
- moved static data to /usr/share/games/nethack
- and executables to /usr/lib/nethack (FHS 2.2)
* Fri Nov 09 2001 ro@suse.de
- use qt-devel-packages in neededforbuild
* Mon Sep 03 2001 schwab@suse.de
- Fix conflicting declaration.
* Mon Mar 19 2001 ro@suse.de
- fixed neededforbuild
* Thu Mar 08 2001 uli@suse.de
- added xf86 to neededforbuild
- replaced static GTK include paths with "gtk-config --cflags"
* Thu Jan 25 2001 vinil@suse.cz
- upgraded to 3.3.1
- difs split and cleanup
- gnome version included
* Tue Jan 23 2001 schwab@suse.de
- Fix conflicting declarations.
* Thu Nov 30 2000 ro@suse.de
- neededforbuild += liblcms
* Fri Nov 17 2000 ro@suse.de
- fixed neededforbuild: += libmng-devel
* Sun Nov 05 2000 kukuk@suse.de
- adjust neededforbuild
* Fri Oct 20 2000 ro@suse.de
- added libmng to neededforbuild
* Tue Aug 22 2000 vinil@suse.cz
- mesa, mesasoft added to neededforbuild
* Tue Jul 18 2000 vinil@suse.cz
- Alt (Meta) key should work now in tty version, too
  (are there any problems with it?)
* Fri Jun 23 2000 vinil@suse.cz
- doc files relocated
* Tue Jun 20 2000 vinil@suse.cz
- major file relocation
- nethackrc demofile added
* Tue Jun 13 2000 vinil@suse.cz
- nethack and xnethack are two frontends now
- nh_data is needed for both
* Sat Feb 19 2000 kasal@suse.cz
- upgraded to 3.3.0
- added BuildRoot
- moved manpages to /usr/share/man
* Mon Sep 13 1999 bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
* Wed Jun 11 1997 rj@suse.de
- new version 3.2.2
openSUSE Build Service is sponsored by