%bcond_without check %bcond_without bundle_libcutl %bcond_without cgit_source Name: cli Version: 1.2.0 Release: 1.b.3%{?dist} Summary: Command Line Interface compiler for C++ %if ! %{with bundle_libcutl} License: MIT %else License: MIT and Boost %endif URL: https://www.codesynthesis.com/projects/cli/ %if %{with cgit_source} Source0: https://git.codesynthesis.com/cgit/%{name}/%{name}/snapshot/%{name}-v%{version}-b.3.tar.xz %else Source0: https://pkg.cppget.org/1/beta/%{name}/%{name}-%{version}-b.3.tar.gz %endif # The latest official release of libcutl is not compatible with cli %if %{with bundle_libcutl} %global libcutl_bundle_version 1.11.0-b.4 Source100: https://pkg.cppget.org/1/beta/libcutl/libcutl-%{libcutl_bundle_version}.tar.gz %endif BuildRequires: gcc-c++ BuildRequires: build2 BuildRequires: build2-rpm-macros %if ! %{with bundle_libcutl} BuildRequires: libcutl-devel %endif %description Command Line Interface (CLI) definition language is a domain-specific language (DSL) for defining command line interfaces of C++ programs. It allows you to describe the options that your program supports, their types, default values, and documentation. CLI definitions are automatically translated to C++ classes using the CLI compiler. These classes implement parsing of the command line arguments and provide a convenient and type-safe interface for accessing the extracted data. In addition, the generated C++ code can print formatted program usage information. The CLI compiler can also generate the command line interface documentation in the HTML and man page formats. It is easy to start using CLI in your application since there are no external dependencies. You can compile your command line interface to C++ and simply add the generated files to your project's source code. Features: * Standard C++-based implementation. * No external dependencies, not even on a runtime library. * Any fundamental or user-defined C++ type can be used as an option type. * Automatic printing of formatted program usage information. * Automatic documentation generation in the HTML and man page formats. * Ability to read arguments from the argv array, file, and custom sources. * Support for erasing parsed arguments from the argv array. * Support for custom option formats. * Multi-value option parsing into the std::vector, std::set, and std::map containers. * Support for option aliases. %package -n %{name}-doc Summary: %{name} documentation BuildArch: noarch %description -n %{name}-doc This package contains the %{name} documentation. %prep %if ! %{with bundle_libcutl} %autosetup %global cli_dir . %else %setup -q -c -n %{name}-bundle -a 100 %if %{with cgit_source} %global cli_dir %{name}-v%{version}-b.3 %else %global cli_dir %{name}-%{version}-b.3 %endif %endif %build %if %{with bundle_libcutl} %build2_configure \ libcutl-%{libcutl_bundle_version}/ \ config.bin.lib=static \ config.install=false %build2_configure %{cli_dir}/ \ config.import.libcutl="libcutl-%{libcutl_bundle_version}/" b %{cli_dir}/ %else %build2 %{cli_dir}/ %endif %install %build2_install %{cli_dir}/ # move license from %%{_docdir} to %%{_defaultlicensedir} mkdir -p %{buildroot}%{_defaultlicensedir}/%{name} mv %{buildroot}%{_docdir}/%{name}/LICENSE %{buildroot}%{_defaultlicensedir}/%{name} %check %if %{with check} %build2_test %{cli_dir}/ %endif %ldconfig_scriptlets %files %dir %{_defaultlicensedir}/%{name} %dir %{_docdir}/%{name} %license %{_defaultlicensedir}/%{name}/LICENSE %doc %{_docdir}/%{name}/NEWS %doc %{_docdir}/%{name}/README %{_bindir}/cli # TODO: # man pages %files -n %{name}-doc %dir %{_docdir}/%{name} %doc %{_docdir}/%{name}/manifest %changelog * Tue Mar 5 2019 Matthew Krupcale - 1.2.0-1.b.3 - Initial package