Blob Blame History Raw
%global forgeurl0 %{url}

Name:           docopt-cpp
Version:        0.6.3
Release:        %autorelease
Summary:        C++11 Port of docopt

License:        MIT or Boost

Source0:        %{forgesource0}

Patch1:         %{url}/pull/145.patch#/docopt-0.6.3-run-tests.patch

BuildRequires:  cmake gcc-c++
BuildRequires:  rpmautospec redhat-rpm-config
# Needed for tests
BuildRequires:  python3-devel

%global common_description %{expand:docopt creates beautiful command-line interfaces

Isn't it awesome how getopt (and boost::program_options for you fancy folk!)
generate help messages based on your code?! These timeless functions have been
around for decades and have proven we don't need anything better, right?

Hell no! You know what's awesome? It's when the option parser is generated
based on the beautiful help message that you write yourself! This way you
don't need to write this stupid repeatable parser-code, and instead can
write only the help message-the way you want it.

This is a port of the module (,
and we have tried to maintain full feature parity (and code structure)
as the original.

This port is written in C++11 and also requires a good C++11 standard library
(in particular, one with regex support).

%package devel
Summary:        Developer files for a docopt C++11 port
Requires:       cmake-filesystem
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description devel
Contains developer headers and a library. Install if docopt.cpp is used in
a code to be compiled.

%forgeautosetup -p1

%cmake -DWITH_TESTS=on

rm -f ${RPM_BUILD_ROOT}%{_libdir}/libdocopt.a

pushd "%{__cmake_builddir}"
%python3 run_tests

%license LICENSE-Boost-1.0 LICENSE-MIT
%doc README.rst

%files devel