-
Notifications
You must be signed in to change notification settings - Fork 2
/
libarch.spec
182 lines (132 loc) · 3.81 KB
/
libarch.spec
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
Name: libarch
Version: 1.0.0
Release: 1%{?dist}
Summary: Architecture detection and management library
License: MIT
URL: https://github.com/rpm-software-management/libarch
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
# ========== build options ==========
%bcond_with html
%bcond_with man
%bcond_without go
%bcond_without perl5
%bcond_without python3
%bcond_without ruby
%bcond_with sanitizers
%bcond_without tests
# ========== versions of dependencies ==========
%global swig_version 3.0.12
# ========== build requires ==========
BuildRequires: cmake
BuildRequires: doxygen
BuildRequires: gcc
%if %{with html} || %{with man}
BuildRequires: python3dist(breathe)
BuildRequires: python3dist(sphinx)
BuildRequires: python3dist(sphinx-rtd-theme)
%endif
%if %{with sanitizers}
BuildRequires: libasan-static
BuildRequires: liblsan-static
BuildRequires: libubsan-static
%endif
# ========== libarch ==========
%description
Architecture detection and management library
%files
%{_libdir}/libarch.so.*
%license mit.txt
# ========== libarch-devel ==========
%package devel
Summary: Development files for libarch
Requires: libarch%{?_isa} = %{version}-%{release}
%description devel
Development files for libarch.
%files devel
%{_includedir}/libarch/
%{_libdir}/libarch.so
%{_libdir}/pkgconfig/libarch.pc
%license COPYING.md
%license mit.txt
# ========== perl5-libarch ==========
%if %{with perl5}
%package -n perl5-libarch
Summary: Perl 5 for the libarch library.
Provides: perl(libarch) = %{version}-%{release}
Requires: libarch%{?_isa} = %{version}-%{release}
BuildRequires: perl-devel
BuildRequires: swig >= %{swig_version}
%if %{with tests}
BuildRequires: perl(strict)
BuildRequires: perl(Test::More)
BuildRequires: perl(warnings)
%endif
%description -n perl5-libarch
Perl 5 bindings for the libarch library.
%files -n perl5-libarch
%{perl_vendorarch}/libarch
%{perl_vendorarch}/auto/libarch
%license COPYING.md
%license mit.txt
%endif
# ========== python3-libarch ==========
%if %{with python3}
%package -n python3-libarch
%{?python_provide:%python_provide python3-libarch}
Summary: Python 3 bindings for the libarch library.
Requires: libarch%{?_isa} = %{version}-%{release}
BuildRequires: python3-devel
BuildRequires: swig >= %{swig_version}
%description -n python3-libarch
Python 3 bindings for the libarch library.
%files -n python3-libarch
%{python3_sitearch}/libarch/
%license COPYING.md
%license mit.txt
%endif
# ========== ruby-libarch ==========
%if %{with ruby}
%package -n ruby-libarch
Summary: Ruby bindings for the libarch library.
Provides: ruby(libarch) = %{version}-%{release}
Requires: libarch%{?_isa} = %{version}-%{release}
Requires: ruby(release)
BuildRequires: pkgconfig(ruby)
BuildRequires: swig >= %{swig_version}
%description -n ruby-libarch
Ruby bindings for the libarch library.
%files -n ruby-libarch
%{ruby_vendorarchdir}/libarch/
%license COPYING.md
%license mit.txt
%endif
# ========== unpack, build, check & install ==========
%prep
%autosetup -p1
%build
%cmake \
-DPACKAGE_VERSION=%{version} \
-DPERL_INSTALLDIRS=vendor \
\
-DWITH_HTML=%{?with_html:ON}%{!?with_html:OFF} \
-DWITH_MAN=%{?with_man:ON}%{!?with_man:OFF} \
\
-DWITH_GO=%{?with_go:ON}%{!?with_go:OFF} \
-DWITH_PERL5=%{?with_perl5:ON}%{!?with_perl5:OFF} \
-DWITH_PYTHON3=%{?with_python3:ON}%{!?with_python3:OFF} \
-DWITH_RUBY=%{?with_ruby:ON}%{!?with_ruby:OFF} \
\
-DWITH_SANITIZERS=%{?with_sanitizers:ON}%{!?with_sanitizers:OFF} \
-DWITH_TESTS=%{?with_tests:ON}%{!?with_tests:OFF}
%make_build
%if %{with man}
make doc-man
%endif
%check
%if %{with tests}
make ARGS="-V" test
%endif
%install
%make_install
%ldconfig_scriptlets
%changelog