Blob Blame History Raw
Name:           minetestmapper
Version:        20161218
Release:        3%{?dist}
Summary:        Generates a overview image of a minetest map

License:        BSD
URL:            https://github.com/minetest/minetestmapper
Source0:        https://github.com/minetest/minetestmapper/archive/%{version}/minetestmapper-%{version}.tar.gz

# Patch merged upstream to fix issue with water being transparent.
# https://github.com/minetest/minetestmapper/commit/d490cf0a31b1a64c604082b814cc2c3588a73a08.patch
Patch0:         d490cf0a31b1a64c604082b814cc2c3588a73a08.patch

# Patch sent upstream by dmoerner to install man page.
# https://github.com/minetest/minetestmapper/commit/07c371f68ccc10337fbdd60477bc621bf7cd2a7e.patch
Patch1:         07c371f68ccc10337fbdd60477bc621bf7cd2a7e.patch

BuildRequires:  gcc-c++, cmake, sqlite-devel, gd-devel, leveldb-devel, hiredis-devel

# Needs minetest for ownership of /usr/share/minetest if nothing else.
Requires:       minetest

# Minetest doesn't exist on ppc
ExcludeArch:    ppc64 ppc64le

%description
Generates a overview image of a minetest map. This is a port of
minetestmapper.py to C++, that is both faster and provides more
details than the deprecated Python script.

%prep
%autosetup -p1

# Remove reference to postgresql in manpage as per dmoerner's comments:
# (https://bugzilla.redhat.com/show_bug.cgi?id=1410651#c1)
# Postgresql backend was added upstream after the release of 20161218.
sed -i 's/\*postgresql\*, //' minetestmapper.6
%build
%cmake -DENABLE_LEVELDB=1 -DENABLE_REDIS=1
%make_build

%install
%make_install

# Install colors.txt into /usr/share/minetest.
mkdir -p %{buildroot}%{_datadir}/minetest
cp -a colors.txt %{buildroot}%{_datadir}/minetest/

# Remove copy of license from docdir.
rm -rf %{buildroot}%{_pkgdocdir}/COPYING

%files
%{_bindir}/minetestmapper
%{_datadir}/minetest/colors.txt
%{_mandir}/man6/minetestmapper.6*
%license COPYING
%doc AUTHORS README.rst

%changelog
* Tue Jan 24 2017 Ben Rosser <rosser.bjr@gmail.com> - 20161218-3
- Add ExcludeArch on ppc arches due to lack of minetest on them

* Fri Jan 20 2017 Ben Rosser <rosser.bjr@gmail.com> - 20161218-2
- Add man page for minetestmapper written by dmoerner.
- Reference patches without using a URL.
- Use version macro in Source0 URL.

* Fri Jan  6 2017 Ben Rosser <rosser.bjr@gmail.com> - 20161218-1
- Initial package for Fedora.