Skip to content

Commit

Permalink
Merge pull request #66 from whitehara/master
Browse files Browse the repository at this point in the history
Add umoria.spec, fix wizard.cpp compile error
  • Loading branch information
mrcook authored Mar 11, 2023
2 parents 86364b9 + 16a08c7 commit 61c2cf6
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/wizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ static bool wizardRequestObjectId(int &id, const std::string &label, int start_i

// Simplified wizard routine for creating an object
void wizardGenerateObject() {
int id;
int id=0;
if (!wizardRequestObjectId(id, "Dungeon/Store object", 0, 366)) {
return;
}
Expand Down
70 changes: 70 additions & 0 deletions umoria.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
%global debug_package %{nil}

%if 0%{?suse_version} || 0%{?rhel} == 8
%define __builddir %{_vpath_builddir}
%endif

Name: umoria
Version: 5.7.15
Release: 1%{?dist}
Summary: Umoria %{version}

License: GPL-3.0
URL: https://umoria.org
Source0: umoria-%{version}.tar.gz

BuildRequires: ncurses-devel gcc-c++ cmake
Requires: ncurses-libs


%description
The Dungeons of Moria is a single player dungeon simulation originally written by Robert Alan Koeneke, with its first public release in 1983.
The game was originally developed using VMS Pascal before being ported to the C language by James E. Wilson in 1988, and released a Umoria.


%prep
%autosetup


%build

%if 0%{?rhel} == 8
mkdir %{_vpath_builddir} && (cd %{_vpath_builddir}; %cmake ..; %cmake_build )
%else
%cmake
%cmake_build
%endif


%install
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
cp %{_vpath_builddir}/umoria/umoria $RPM_BUILD_ROOT/%{_bindir}/umoria.bin
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/games/umoria
cp -R %{_vpath_builddir}/umoria/data $RPM_BUILD_ROOT/%{_datadir}/games/umoria

cat << EOF > $RPM_BUILD_ROOT/%{_bindir}/umoria
#!/bin/sh
CONFDIR=~/.config/umoria
DATADIR=%{_datadir}/games/umoria/data
BIN=%{_bindir}/umoria.bin
[ ! -d \$CONFDIR ] && mkdir -p \$CONFDIR && ln -s \$DATADIR \$CONFDIR/data
[ ! -f \$CONFDIR/scores.dat ] && touch \$CONFDIR/scores.dat
(cd \$CONFDIR; \$BIN \$@)
EOF

chmod +x $RPM_BUILD_ROOT/%{_bindir}/umoria

%postun
echo "Please remove each user's ~/.config/umoria manually, if you need."

%files
%{_bindir}/umoria*
%{_datadir}/games/umoria/data/*
%license LICENSE
%doc *.md AUTHORS



%changelog
* Sat Feb 18 2023 Shiro Hara <[email protected]>
- Add .spec file

0 comments on commit 61c2cf6

Please sign in to comment.