# survex.spec.  Generated from survex.spec.in by configure.
Summary: Cave Surveying Software
Name: survex
Vendor: The Survex Project
Version: 1.4.20
Release: 1
License: GPL
Group: Applications/Misc
Source: https://survex.com/software/1.4.20/survex-1.4.20.tar.gz
URL: https://survex.com/
Packager: Olly Betts <olly@survex.com>
# Fedora have removed gcc from the default build environment so explicitly list it here
BuildRequires: wxGTK3-devel, proj-devel, gcc-g++
Requires: wxGTK3, proj, proj-epsg
BuildRoot: %{_tmppath}/%{name}-buildroot

%description
The development branch of Survex, a software suite to process, view, and
print cave survey data.  Survex is cross-platform (Linux/Unix, and
Microsoft Windows).  It includes English, French, German, Portuguese,
Catalan, and Spanish internationalisations. It can deal with extremely
large and complex datasets and can read survey data from many sources.

%prep
%setup

%build
[ "%{buildroot}" = "/" ] && echo "buildroot cannot be /" && exit 1
./configure --prefix=/usr
make

%install
[ "%{buildroot}" = "/" ] && echo "buildroot cannot be /" && exit 1
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
mkdir -p "%{buildroot}"
make install DESTDIR="%{buildroot}"
make -C vim vimdir=/usr/share/vim install DESTDIR="%{buildroot}"
# Move docs back into build tree to keep rpmbuild happy by letting
# it do the installing.
mv "%{buildroot}"/usr/share/doc/survex ./built-docs

%clean
[ "%{buildroot}" = "/" ] && echo "buildroot cannot be /" && exit 1
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files
%defattr(-, root, root)
%doc AUTHORS COPYING NEWS TODO ChangeLog
%doc built-docs/*
%doc /usr/share/man/
/usr/bin/*
/usr/share/survex/
/usr/share/mime/
/usr/share/applications/survex-aven.desktop
/usr/share/icons/
/usr/share/vim/
