forked from dmach/libarch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libparch.spec
182 lines (132 loc) · 3.85 KB
/
libparch.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: libparch
Version: 1.0.0
Release: 1%{?dist}
Summary: Architecture detection and management library
License: MIT
URL: https://github.com/rpm-software-management/libparch
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
# ========== libparch ==========
%description
Architecture detection and management library
%files
%{_libdir}/libparch.so.*
%license mit.txt
# ========== libparch-devel ==========
%package devel
Summary: Development files for libparch
Requires: libparch%{?_isa} = %{version}-%{release}
%description devel
Development files for libparch.
%files devel
%{_includedir}/libparch/
%{_libdir}/libparch.so
%{_libdir}/pkgconfig/libparch.pc
%license COPYING.md
%license mit.txt
# ========== perl5-libparch ==========
%if %{with perl5}
%package -n perl5-libparch
Summary: Perl 5 for the libparch library.
Provides: perl(libparch) = %{version}-%{release}
Requires: libparch%{?_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-libparch
Perl 5 bindings for the libparch library.
%files -n perl5-libparch
%{perl_vendorarch}/libparch
%{perl_vendorarch}/auto/libparch
%license COPYING.md
%license mit.txt
%endif
# ========== python3-libparch ==========
%if %{with python3}
%package -n python3-libparch
%{?python_provide:%python_provide python3-libparch}
Summary: Python 3 bindings for the libparch library.
Requires: libparch%{?_isa} = %{version}-%{release}
BuildRequires: python3-devel
BuildRequires: swig >= %{swig_version}
%description -n python3-libparch
Python 3 bindings for the libparch library.
%files -n python3-libparch
%{python3_sitearch}/libparch/
%license COPYING.md
%license mit.txt
%endif
# ========== ruby-libparch ==========
%if %{with ruby}
%package -n ruby-libparch
Summary: Ruby bindings for the libparch library.
Provides: ruby(libparch) = %{version}-%{release}
Requires: libparch%{?_isa} = %{version}-%{release}
Requires: ruby(release)
BuildRequires: pkgconfig(ruby)
BuildRequires: swig >= %{swig_version}
%description -n ruby-libparch
Ruby bindings for the libparch library.
%files -n ruby-libparch
%{ruby_vendorarchdir}/libparch/
%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