# The naming scheme in non-Mandriva-based distros
%if 0%{!?mklibname:1}
%define mklibname(ds)  lib%{1}%{?2:%{2}}%{-s:-static}%{-d:-devel}
%endif
%if 0%{!?mkrel:1}
%define mkrel(c) %{1}%{?dist}
%endif

%if 0%{!?cmake_build}
%define cmake_build cmake --build .
%endif
%if 0%{!?cmake_install}
%define cmake_install DESTDIR="%{buildroot}" cmake --install .
%endif

Name: argagg
Version: 0.4.7
Release: %mkrel 1
Source0: https://github.com/vietjtnguyen/argagg/archive/%{version}/%{name}-%{version}.tar.gz
Summary: Argument Aggregator, a C++ command line argument/option parser
URL: https://github.com/vietjtnguyen/argagg
License: GPL
Group: Development/C++
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: doxygen
BuildArch: noarch

%description
This is yet another C++ command line argument/option parser. It was written as a
simple and idiomatic alternative to other frameworks like getopt, Boost program
options, TCLAP, and others. The goal is to achieve the majority of argument
parsing needs in a simple manner with an easy to use API. It operates as a
single pass over all arguments, recognizing flags prefixed by - (short) or --
(long) and aggregating them into easy to access structures with lots of
convenience functions. It defers processing types until you access them, so the
result structures end up just being pointers into the original command line
argument C-strings.

%prep
%autosetup -p1
sed -i -e 's/^.*cmake_minimum_required.*$//' CMakeLists.txt
%cmake \
	-DARGAGG_BUILD_EXAMPLES=OFF \
	-DARGAGG_BUILD_TESTS=OFF

%build
%cmake_build

%install
%cmake_install

%check
cd build
ctest -V

%files
%{_includedir}/*
%doc %{_datadir}/doc/argagg