File hhexen.spec of Package hhexen

# norootforbuild

%define _prefix	/usr

Name:			hhexen
Summary:		Hacked Hexen is a Linux port of Raven Game's old shooter, Hexen
License:		GPL-2.0-or-later
Group:			Amusements/Games/Action/Shoot
Version:		1.6.4
Release:		0.pm.1.4
URL:			http://hhexen.sourceforge.net/
Source:			http://downloads.sourceforge.net/hhexen/%{name}-%{version}.tar.gz
Source1:		%{name}.png
Source2:		http://downloads.sourceforge.net/hhexen/hexen_demo_wad_1.1.tgz
Source90:		%{name}-rpmlintrc
BuildRoot:		%{_tmppath}/%{name}-%{version}-build
BuildRequires:	Mesa-devel
BuildRequires:	SDL-devel >= 1.2.4
BuildRequires:	SDL_mixer-devel >= 1.2.4
BuildRequires:	update-desktop-files
# needed for midi-output
Requires:		timidity
# make sure at least one of the executables is installed
Requires:		%{name}-exe

%description
Hacked Hexen is a Linux port of Raven Game's old shooter, Hexen.

This is a new release of Dan's excellent Hacked Hexen, by the
authors of Hammer of Thyrion (Hexen II). We're applying fixes,
adding a few features, and ensuring it runs on most *nix operating
systems.

This package contains common files.

%package gl
Summary:	Hacked Hexen is a Linux port of Raven Game's old shooter, Hexen
Group:		Amusements/Games/Action/Shoot
Requires:	%{name}
Provides:	%{name}-exe

%description gl
Hacked Hexen is a Linux port of Raven Game's old shooter, Hexen.

This is a new release of Dan's excellent Hacked Hexen, by the
authors of Hammer of Thyrion (Hexen II). We're applying fixes,
adding a few features, and ensuring it runs on most *nix operating
systems.

This package contains the OpenGL enabled binary.

%package sdl
Summary:	Hacked Hexen is a Linux port of Raven Game's old shooter, Hexen
Group:		Amusements/Games/Action/Shoot
Requires:	%{name}
Provides:	%{name}-exe

%description sdl
Hacked Hexen is a Linux port of Raven Game's old shooter, Hexen.

This is a new release of Dan's excellent Hacked Hexen, by the
authors of Hammer of Thyrion (Hexen II). We're applying fixes,
adding a few features, and ensuring it runs on most *nix operating
systems.

This package contains the sdl enabled binary.

%package demo
Summary:	Hacked Hexen is a Linux port of Raven Game's old shooter, Hexen
Group:		Amusements/Games/Action/Shoot
Requires:	%{name}

%description demo
Hacked Hexen is a Linux port of Raven Game's old shooter, Hexen.

This package contains the demo wad (a 4 level version from the
MacHexen shareware)
Those without the full retail version of Hexen can still play the
demo.

%prep
%setup -q -n %{name}-%{version} -a2

%build
# compile the OpenGL version (hhexen-gl)
%configure \
	--enable-fullscreen \
	--with-datapath=%{_datadir}/games/%{name} \
	--with-audio=sdlmixer
%__make %{?jobs:-j%{jobs}}

# compile the software version (hhexen-sdl)
%__make clean
%configure \
	--disable-gl \
	--enable-fullscreen \
	--with-datapath=%{_datadir}/games/%{name} \
	--with-audio=sdlmixer
%__make %{?jobs:-j%{jobs}}

%install
# install the gamedata
%__install -dm 755 %{buildroot}/%{_datadir}/games/%{name}
%__install -m 644 hexen.wad \
	%{buildroot}%{_datadir}/games/%{name}

%__install -dm 755 %{buildroot}%{_bindir}/%{name}
%__install -dm 755 %{buildroot}%{_datadir}/pixmaps
for i in gl sdl; do
	# binaries
	%__install -m 755 %{name}-$i \
		%{buildroot}%{_bindir}/
done

# install icon
%__install -m 644 %{SOURCE1} \
	%{buildroot}%{_datadir}/pixmaps/%{name}.png

# install menu entry
%__install -dm 755 %{buildroot}%{_datadir}/applications
%{__cat} > %{name}-gl.desktop << EOF
[Desktop Entry]
Name=Hacked Hexen (OpenGL)
GenericName=Hacked Hexen (OpenGL)
Comment=Hacked Hexen is a Linux port of Raven Game's old shooter, Hexen
Exec=%{name}-gl
Icon=%{name}
Terminal=false
Type=Application
#Encoding=UTF-8
EOF

%{__cat} > %{name}-sdl.desktop << EOF
[Desktop Entry]
Name=Hacked Hexen (SDL)
GenericName=Hacked Hexen (SDL)
Comment=Hacked Hexen is a Linux port of Raven Game's old shooter, Hexen
Exec=%{name}-sdl
Icon=%{name}
Terminal=false
Type=Application
#Encoding=UTF-8
EOF

%__install -m 644 %{name}*.desktop \
	%{buildroot}%{_datadir}/applications
%suse_update_desktop_file -i %{name}-gl Game ActionGame
%suse_update_desktop_file -i %{name}-sdl Game ActionGame

%clean
[ -d "%{buildroot}" -a "%{buildroot}" != "" ] && %__rm -rf "%{buildroot}"

%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog LICENSE README RELEASE TODO WADFILES
%{_datadir}/pixmaps/%{name}.png

%files gl
%defattr(-,root,root)
%{_bindir}/%{name}-gl
%{_datadir}/applications/%{name}-gl.desktop

%files sdl
%defattr(-,root,root)
%{_bindir}/%{name}-sdl
%{_datadir}/applications/%{name}-sdl.desktop

%files demo
%defattr(-,root,root)
%doc README.demowad
%dir %{_datadir}/games/%{name}
%{_datadir}/games/%{name}/*.wad

%changelog
* Wed Mar 26 2025 Wolfgang Bauer <wbauer1@a1.net> - 1.6.4
- Update to version 1.6.4
  * fixed a heap buffer overrun which was introduced back in v1.6.0
  * avoid possible buffer overruns in opengl texture code
  * new mus2midi converter code by Bret Curtis
  * double-buffering support and double-buffered rectangle rendering in
    software renderer, by Miro Kropacek
  * Atari (FreeMint) support, by Miro Kropacek
  * miscellaneous cleanups and build fixes
* Sat May 29 2021 Wolfgang Bauer <wbauer@tmo.at>
- Enable fullscreen by default
* Fri May 28 2021 Wolfgang Bauer <wbauer@tmo.at>
- Move executables from /usr/games/ to /usr/bin/
- Set shared datapath appropriately when building
  and drop wrapper start script as it is no longer needed
- Split out hhexen-gl into its own subpackage
  and only install one icon for both executables
* Fri Sep 20 2013 Wolfgang Bauer <wbauer@tmo.at> - 1.6.3
- update to 1.6.3
  * verified successful compilation using gcc-4.6 to 4.8 and clang-3.x
    fixed some undefined behaviors in the C code
  * recognize Hexen wads from Mac port by Presage and display proper credits page
* Wed Mar 28 2012 Wolfgang Bauer <wbauer@tmo.at> - 1.6.2
- update to 1.6.2
  * reject the old (beta) PC demo (from hexen.zip, "Released October 2nd, 1995")
  * configury updates
* Sun Dec 06 2009 Toni Graffy <toni@links2linux.de> - 1.6.1-0.pm.1
- update to 1.6.1
* Thu Jun 11 2009 Toni Graffy <toni@links2linux.de> - 1.6.0-0.pm.1
- update to 1.6.0
* Sun May 10 2009 Toni Graffy <toni@links2linux.de> - 1.5.3-0.pm.1
- update to 1.5.3
* Fri Dec 12 2008 Toni Graffy <toni@links2linux.de> - 1.5.2-0.pm.1
- update to 1.5.2
* Thu Dec 11 2008 Toni Graffy <toni@links2linux.de> - 1.5.1-0.pm.2
- initial build for packman 1.5.1
- fixed SDL_mixer freeze with zero music volume in some cases
openSUSE Build Service is sponsored by