%bcond_without check Name: cbang Version: 1.7.2 Release: %autorelease Summary: C! (a.k.a. C-Bang) library - a collection of C++ utility libraries License: LGPL-2.1-or-later URL: http://cbang.org/ Source0: https://github.com/CauldronDevelopmentLLC/%{name}/archive/%{version}/%{name}-%{version}.tar.gz # This patch is just to fix include files locations and it will not be sent upstream Patch100: cbang-Fix-includes-for-Fedora-build.patch BuildRequires: gcc-c++ BuildRequires: pkgconfig(re2) BuildRequires: pkgconfig(expat) BuildRequires: pkgconfig(bzip2) BuildRequires: pkgconfig(sqlite3) BuildRequires: pkgconfig(yaml-0.1) BuildRequires: pkgconfig(liblz4) BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(libevent) >= 2.1.4 BuildRequires: v8-devel BuildRequires: boost-devel >= 1.71.0 BuildRequires: python3-scons # pull py_byte_compile BuildRequires: python3-devel # Tests execution requires python3-six %if %{with check} BuildRequires: python3-six %endif %global _description %{expand: The C! or cbang library is a collection of C++ utility libraries developed over the course of +15 years and several major C++ application development projects. It should compile and run on Windows, Linux and OSX using a modern C++ compiler. Many of the facilities of C! are geared towards cross-platform application development and providing basic services that most applications need such as a configuration system, run-time build information, logging facilities, threads, smart pointers, simple embedded scripting, etc. C!'s philosophy is to create clean, simple, readable, modular and reusable code. C! also encourages exception based error handling, and light use of C++ templates and C preprocesor macros. C! "leans" on the venerable boost library but also reimplements several boost APIs which are considered by the author to be too template heavy, less readable or overly complicated in boost. The code was developed on an as needed basis and was never intended to be any sort of grand unifying system for C++ application development. However, I hope you find many parts of the library useful in your C++ development projects.} %description %_description %package devel Summary: The C! (C-Bang) C++ headers and shared development libraries Requires: %{name}%{?_isa} = %{version}-%{release} %description devel %_description The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %prep %autosetup -p1 # Remove unused bundled sources rm -rf debian find src -mindepth 1 -maxdepth 1 ! -name cbang ! -name resources -type d|xargs rm -rf find src/resources/licenses -mindepth 1 -maxdepth 1 ! -name cbang.txt -type f -delete %build %global _soname libcbang0.so.%(echo "%{version}"|sed 's/\.[0-9]$//') %global _scopts staticlib=0 sharedlib=1 soname=%{_soname} with_openssl=0 \\\ v8_compress_pointers=0 cxxstd=c++17 debug=1 strict=0 libpath=%{_lib} \\\ disable_local="zlib bzip2 lz4 sqlite3 expat boost libevent re2 libyaml" %{?_smp_mflags} scons %{_scopts} \ ccflags="%{optflags} -fpie" linkflags="%{build_ldflags} -pie" %install # --implicit-deps-unchanged required to avoid rebuilding unless scons bug is fixed, see CBANG #95 scons --implicit-deps-unchanged install prefix=%{buildroot}%{_prefix} %{_scopts} \ ccflags="%{optflags} -fpie" linkflags="%{build_ldflags} -pie" # These files are neccessary to build camotics without full cbang source tree find config include -type f "(" -name "*.h" -o -name "*.py" ")" -exec install -p -m 0644 -D {} \ %{buildroot}%{_prefix}/lib/%{name}/{} ";" %py_byte_compile %{python3} %{buildroot}%{_prefix}/lib/%{name}/config # Remove duplicate rm %{buildroot}%{_docdir}/%{name}/LICENSE %if %{with check} %check export CBANG_LIBNAME=cbang0 cd tests scons %{_scopts} \ ccflags="%{optflags} -fpie" linkflags="%{build_ldflags} -pie" ./testHarness %endif %files %{_libdir}/libcbang0.so.* %license LICENSE %files devel %{_includedir}/%{name} %{_libdir}/libcbang0.so %{_prefix}/lib/%{name} %doc %{_docdir}/%{name} %license LICENSE %changelog %autochangelog