Some basic packaging cleanup.

I'm helping tachoknight to become a packager so that he can help with
this package.  I wanted to push some basic cleanups to rawhide so that
he wouldn't have to deal with a package filled with outdated cruft.  It
still needs a bit of work, though.
This commit is contained in:
Jason Tibbitts 2017-05-17 13:35:11 -05:00
parent cc800d9c8b
commit 15e56e38d5

View File

@ -5,10 +5,9 @@
Name: nethack
Version: 3.4.3
Release: 35%{?dist}
Release: 36%{?dist}
Summary: A rogue-like single player dungeon exploration game
Group: Amusements/Games
License: NGPL
URL: http://nethack.org
Source0: http://downloads.sourceforge.net/%{name}/%{name}-343-src.tgz
@ -18,7 +17,6 @@ Patch1: %{name}-%{version}-config.patch
Patch2: %{name}-%{version}-x11.patch
Patch3: %{name}-%{version}-guidebook.patch
Patch4: %{name}-%{version}-format-security.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: %{fontname}-fonts-core
BuildRequires: ncurses-devel
@ -46,7 +44,6 @@ characters: you can pick your race, your role, and your gender.
%package -n %{fontname}-fonts
Summary: Bitmap fonts for Nethack
Group: User Interface/X
BuildArch: noarch
Requires: fontpackages-filesystem
@ -55,7 +52,6 @@ Bitmap fonts for Nethack.
%package -n %{fontname}-fonts-core
Summary: X11 core fonts configuration for %{fontname}
Group: User Interface/X
BuildArch: noarch
Requires: %{fontname}-fonts
Requires(post): %{fontname}-fonts
@ -77,15 +73,15 @@ X11 core fonts configuration for %{fontname}.
(source sys/unix/setup.sh)
# Set our paths
%{__sed} -i -e "s:^\(HACKDIR=\).*:\1%{nhgamedir}:" sys/unix/nethack.sh
%{__sed} -i -e "s:FEDORA_CONFDIR:%{nhgamedir}:" sys/unix/nethack.sh
%{__sed} -i -e "s:FEDORA_STATEDIR:%{nhdatadir}:" include/unixconf.h
%{__sed} -i -e "s:FEDORA_HACKDIR:%{nhgamedir}:" include/config.h
%{__sed} -i -e "s:/usr/games/lib/nethackdir:%{nhgamedir}:" \
sed -i -e "s:^\(HACKDIR=\).*:\1%{nhgamedir}:" sys/unix/nethack.sh
sed -i -e "s:FEDORA_CONFDIR:%{nhgamedir}:" sys/unix/nethack.sh
sed -i -e "s:FEDORA_STATEDIR:%{nhdatadir}:" include/unixconf.h
sed -i -e "s:FEDORA_HACKDIR:%{nhgamedir}:" include/config.h
sed -i -e "s:/usr/games/lib/nethackdir:%{nhgamedir}:" \
doc/nethack.6 doc/nethack.txt doc/recover.6 doc/recover.txt
# Point the linker in the right direction
%{__sed} -i -e "s:-L/usr/X11R6/lib:-L/usr/X11R6/%{_lib}:" \
sed -i -e "s:-L/usr/X11R6/lib:-L/usr/X11R6/%{_lib}:" \
src/Makefile util/Makefile
@ -94,25 +90,24 @@ make all
%install
rm -rf $RPM_BUILD_ROOT
%makeinstall \
GAMEDIR=$RPM_BUILD_ROOT%{nhgamedir} \
VARDIR=$RPM_BUILD_ROOT%{nhdatadir} \
SHELLDIR=$RPM_BUILD_ROOT%{_bindir} \
GAMEDIR=%{buildroot}/%{nhgamedir} \
VARDIR=%{buildroot}/%{nhdatadir} \
SHELLDIR=%{buildroot}/%{_bindir} \
CHOWN=/bin/true \
CHGRP=/bin/true
rm -rf $RPM_BUILD_ROOT%{nhgamedir}/save
mv $RPM_BUILD_ROOT%{nhgamedir}/recover $RPM_BUILD_ROOT%{_bindir}/nethack-recover
rm -rf %{buildroot}/%{nhgamedir}/save
mv %{buildroot}/%{nhgamedir}/recover %{buildroot}/%{_bindir}/nethack-recover
install -d -m 0755 $RPM_BUILD_ROOT%{_mandir}/man6
make -C doc MANDIR=$RPM_BUILD_ROOT%{_mandir}/man6 manpages
install -d -m 0755 %{buildroot}/%{_mandir}/man6
make -C doc MANDIR=%{buildroot}/%{_mandir}/man6 manpages
install -D -p -m 0644 win/X11/nh_icon.xpm \
$RPM_BUILD_ROOT%{_datadir}/pixmaps/nethack.xpm
%{buildroot}/%{_datadir}/pixmaps/nethack.xpm
desktop-file-install \
--dir $RPM_BUILD_ROOT%{_datadir}/applications \
--dir %{buildroot}/%{_datadir}/applications \
--add-category Game \
--add-category RolePlaying \
%{SOURCE1}
@ -121,11 +116,11 @@ desktop-file-install \
cd win/X11
bdftopcf -o nh10.pcf nh10.bdf
bdftopcf -o ibm.pcf ibm.bdf
install -m 0755 -d $RPM_BUILD_ROOT%{_fontdir}
install -m 0644 -p *.pcf $RPM_BUILD_ROOT%{_fontdir}
install -m 0755 -d %{buildroot}/%{_fontdir}
install -m 0644 -p *.pcf %{buildroot}/%{_fontdir}
%{__sed} -i -e 's:^!\(NetHack.tile_file.*\):\1:' \
$RPM_BUILD_ROOT%{nhgamedir}/NetHack.ad
sed -i -e 's:^!\(NetHack.tile_file.*\):\1:' \
%{buildroot}/%{nhgamedir}/NetHack.ad
%post -n %{fontname}-fonts-core
@ -140,12 +135,8 @@ if [ $1 -eq 0 ] ; then
rm %{_fontdir}/fonts.dir
fi;
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc doc/*.txt README dat/license dat/history
%doc dat/opthelp dat/wizhelp
%{_mandir}/man6/*
@ -166,9 +157,11 @@ rm -rf $RPM_BUILD_ROOT
%_font_pkg -n bitmap *.pcf
%files -n %{fontname}-fonts-core
%defattr(-,root,root,-)
%changelog
* Wed May 17 2017 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.4.3-36
- Some basic packaging cleanup.
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.4.3-35
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
@ -246,7 +239,7 @@ rm -rf $RPM_BUILD_ROOT
- Rebuild for FC6
* Mon Apr 10 2006 Luke Macken <lmacken@redhat.com> 3.4.3-10
- Remove $RPM_BUILD_ROOT from %post (Bug #188008)
- Remove $RPM_BUILD_ROOT from %%post (Bug #188008)
* Wed Feb 15 2006 Luke Macken <lmacken@redhat.com> 3.4.3-9
- Add nethack-3.4.3-guidebook.patch to fix issues with generating the Guidebook