summaryrefslogtreecommitdiffstats
path: root/dlib.spec
blob: e68672c4fa6064080ed1152a47b9e7ed6c09445b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# 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: 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:   openblas-devel
Requires:   libpng-devel
Requires:   libtiff-devel
Requires:   libjpeg-turbo-devel
Requires:   giflib-devel
Requires:   sqlite-devel
Requires:   zlib-devel
Requires:   libX11-devel
Requires:   libXext-devel

%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 <remi@remirepo.net> - 19.20-1
- initial package
- open https://github.com/davisking/dlib/issues/2111 broken pkg-config file