File mimalloc.spec of Package mimalloc

#
# spec file for package mimalloc
#
# Copyright (c) 2020, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

%global sover   1
%global libname mimalloc%{sover}
Name:           mimalloc
Version:        1.6.3
Release:        0
Summary:        A compact general purpose allocator
License:        MIT
Group:          Development/Libraries/C and C++
URL:            https://github.com/microsoft/mimalloc
Source:         https://github.com/microsoft/mimalloc/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires:  cmake
BuildRequires:  gcc-c++

%description
This is a general purpose allocator with excellent performance
characteristics. Initially developed by Daan Leijen for the
run-time systems of the Koka and Lean languages.

It is a drop-in replacement for malloc and can be used in other
programs without code changes.

%package -n %{libname}
Summary:        A compact general purpose allocator
Group:          System/Libraries

%description -n %{libname}
This is a general purpose allocator with excellent performance
characteristics. Initially developed by Daan Leijen for the
run-time systems of the Koka and Lean languages.

It is a drop-in replacement for malloc and can be used in other
programs without code changes.

%package devel
Summary:        Development files for mimalloc
Group:          Development/Libraries/C and C++
Requires:       %{libname} = %{version}

%description devel
This is a general purpose allocator with excellent performance
characteristics. Initially developed by Daan Leijen for the
run-time systems of the Koka and Lean languages.

It is a drop-in replacement for malloc and can be used in other
programs without code changes.

This subpackage contains libraries and header files for developing
applications that want to make use of mimalloc.

%prep
%setup

%build
%cmake
%make_build

%install
%cmake_install
# FIXME:
rm %{buildroot}/usr/lib/mimalloc-1.6/libmimalloc.a

%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig

%files -n %{libname}
%license LICENSE
%doc readme.md
### HACK
%dir /usr/lib/mimalloc-1.6
%dir /usr/lib/mimalloc-1.6/cmake/
/usr/lib/mimalloc-1.6/cmake/mimalloc-config-version.cmake
/usr/lib/mimalloc-1.6/cmake/mimalloc-config.cmake
/usr/lib/mimalloc-1.6/cmake/mimalloc-relwithdebinfo.cmake
/usr/lib/mimalloc-1.6/cmake/mimalloc.cmake
%dir /usr/lib/mimalloc-1.6/include
/usr/lib/mimalloc-1.6/include/mimalloc-new-delete.h
/usr/lib/mimalloc-1.6/include/mimalloc-override.h
/usr/lib/mimalloc-1.6/include/mimalloc.h
/usr/lib/mimalloc-1.6/libmimalloc.so
/usr/lib/mimalloc-1.6/libmimalloc.so.1.6
/usr/lib/mimalloc-1.6/mimalloc.o
### /HACK

#%{_libdir}/liblockfile.so.%{sover}*

%files devel
#%{_includedir}/lockfile.h
#%{_includedir}/maillock.h
#%{_libdir}/liblockfile.so
#%{_mandir}/man3/lockfile_create.3%{?ext_man}
#%{_mandir}/man3/maillock.3%{?ext_man}

%changelog
openSUSE Build Service is sponsored by