# remirepo/fedora spec file for dlib # # Copyright (c) 2020 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # %global gh_commit 5612caa16937b5b81eb2dba17c20e303537a6a9d %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.20 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 %if 0%{?rhel} == 6 || 0%{?rhel} == 7 BuildRequires: cmake3 BuildRequires: devtoolset-6-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: 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} %description devel This package contains the header files and development libraries for %{libname}. %prep %setup -q -n %{gh_project}-%{gh_commit} %build mkdir build cd build %if 0%{?rhel} == 6 || 0%{?rhel} == 7 source /opt/rh/devtoolset-6/enable %cmake3 \ %else %cmake \ %endif .. make %{_smp_mflags} %install cd build %if 0%{?rhel} == 6 || 0%{?rhel} == 7 source /opt/rh/devtoolset-6/enable %endif make install DESTDIR="%{buildroot}" # see https://github.com/davisking/dlib/issues/2111 sed -e 's:%{_libdir}/lib:-l:g;s/\.so//g' \ -i %{buildroot}%{_libdir}/pkgconfig/dlib-1.pc %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 * Mon Jun 22 2020 Remi Collet - 19.20-1 - initial package - open https://github.com/davisking/dlib/issues/2111 broken pkg-config file