# remirepo/fedora spec file for dlib # # Copyright (c) 2020-2021 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # %global gh_commit 70ea028f12e10f4d992a0c4f0169749eae5bb185 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner davisking %global gh_project dlib %global libname lib%{gh_project} %global soname 19 Name: %{gh_project} Summary: A toolkit for making real world machine learning and data analysis Version: 19.22 Release: 1%{?dist} License: Boost URL: https://github.com/%{gh_owner}/%{gh_project}/ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz # only really needed libraries, not using full path Patch0: %{gh_project}-pc.patch %if 0%{?rhel} == 7 BuildRequires: cmake3 %global dtsenable source /opt/rh/devtoolset-7/enable BuildRequires: devtoolset-7-toolchain %else BuildRequires: cmake BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: libstdc++-devel %endif BuildRequires: openblas-devel BuildRequires: libpng-devel BuildRequires: libtiff-devel BuildRequires: libjpeg-turbo-devel BuildRequires: giflib-devel BuildRequires: sqlite-devel BuildRequires: zlib-devel BuildRequires: libX11-devel BuildRequires: libXext-devel %description Dlib is a modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++ to solve real world problems. See http://dlib.net for the main project documentation and API reference. %package devel Summary: Header files and development libraries for %{name} Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} Requires: giflib-devel %description devel This package contains the header files and development libraries for %{libname}. %prep %setup -q -n %{gh_project}-%{gh_commit} %patch0 -p1 -b .fixpc %build mkdir build cd build %if 0%{?rhel} == 7 %{dtsenable} %cmake3 \ %else %cmake \ %endif -B . -S .. make %{_smp_mflags} # see https://github.com/davisking/dlib/issues/2111 sed -E '/private/s:%{_libdir}/lib([^ ]*).so:-l\1:g' \ -i dlib/dlib-1.pc %install cd build %if 0%{?rhel} == 7 %{dtsenable} %endif make install DESTDIR="%{buildroot}" %if 0%{?fedora} < 28 && 0%{?rhel} < 8 %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %endif %files %{!?_licensedir:%global license %%doc} %license dlib/LICENSE.txt %{_libdir}/%{libname}.so.%{soname}* %files devel %doc README.md %{_libdir}/%{libname}.so %{_includedir}/%{name} %{_libdir}/cmake/%{name} %{_libdir}/pkgconfig/%{name}-1.pc %changelog * Thu Apr 8 2021 Remi Collet - 19.22-1 - update to 19.22 * Tue Aug 18 2020 Remi Collet - 19.21-2 - F33 build * Sun Aug 9 2020 Remi Collet - 19.21-1 - update to 19.21 * Wed Jul 1 2020 Remi Collet - 19.20-2 - use DTS 7 on EL-7 - improve pkg-config fix * Mon Jun 22 2020 Remi Collet - 19.20-1 - initial package - open https://github.com/davisking/dlib/issues/2111 broken pkg-config file