%define git_version %(echo %{version} | sed -e 's/\\./_/g')

Name:    log4cplus
Version: 2.0.5
Release: 3
Summary: simple logging API by using C++
License: BSD
URL:	 https://sourceforge.net/projects/log4cplus
Source0: https://github.com/log4cplus/log4cplus/releases/download/REL_%{git_version}/%{name}-%{version}.tar.gz

BuildRequires: 	cmake

%description
log4cplus is a simple to use C++ logging API providing thread-safe, flexible, and arbitrarily granular control over log management and configuration. It is modelled after the Java log4j API.
%package devel
Summary: log4cplus headers, static libraries
Requires: %name = %version

%description devel
log4cplus is a simple to use C++ logging API providing thread-safe, 
flexible, and arbitrarily granular control over log management and 
configuration. It is modeled after the Java log4j API.

%prep
%setup -q -n %{name}-%{version}/

%build
export CFLAGS=$RPM_OPT_FLAGS
export CXXFLAGS="$RPM_OPT_FLAGS -std=c++11"
%configure
make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
%make_install

%clean
rm -rf $RPM_BUILD_ROOT

%files
%license LICENSE
%_libdir/lib*.so*
%_libdir/*.la

%files devel
%{_includedir}/*
%{_libdir}/pkgconfig/log4cplus.pc
%{_libdir}/lib*.so

%changelog
* Mon Oct 12 2020 liqingqing_1229 <liqingqing3@huawei.com> - 2.0.5-3
- update source0

* Tue Aug 11 2020 douyan <douyan@kylinos.cn> - 2.0.5-2
- add devel package

* Sun Mar 29 2020 Wei Xiong <myeuler@163.com>
- Package init

