-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathlibstorage-ng.spec.in
234 lines (199 loc) · 6.52 KB
/
libstorage-ng.spec.in
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
#
# spec file for package libstorage-ng
#
# Copyright (c) 2021 SUSE LLC, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define libname %{name}1
Name: libstorage-ng
Version: @VERSION@
Release: 0
Summary: Library for storage management
License: GPL-2.0-only
Group: System/Libraries
URL: https://github.com/openSUSE/libstorage-ng
Source: libstorage-ng-%{version}.tar.xz
%if 0%{?suse_version} >= 1330
BuildRequires: libboost_headers-devel
BuildRequires: libboost_test-devel
%else
BuildRequires: boost-devel
%endif
BuildRequires: doxygen
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: graphviz
BuildRequires: grep
BuildRequires: libtool
BuildRequires: pkgconfig
BuildRequires: pkgconfig(python3)
BuildRequires: python-rpm-macros
BuildRequires: ruby
BuildRequires: ruby-devel
%if 0%{?suse_version} == 1315
# Using rubygem(test-unit) does not work since ruby2.1-stdlib claims to
# provide rubygem(test-unit). But that is plain wrong. The version in
# ruby2.1-stdlib does not provide the function assert_raise_kind_of.
BuildRequires: ruby2.1-rubygem-test-unit
%endif
%if 0%{?fedora}
BuildRequires: rubygem-test-unit
%endif
BuildRequires: swig >= 3.0.3
BuildRequires: pkgconfig(libxml-2.0)
%if 0%{?fedora}
BuildRequires: json-c-devel
BuildRequires: glibc-langpack-de
BuildRequires: glibc-langpack-fr
BuildRequires: glibc-langpack-en
%else
BuildRequires: libjson-c-devel
BuildRequires: glibc-locale
%endif
%description
This package contains libstorage-ng, a library for storage management.
%package lang
Summary: Languages for package %{name}
Group: System/Localization
Supplements: %{name}
Provides: %{name}-lang-all = %{version}
BuildArch: noarch
%description lang
Provides translations to the package %{name}
%package -n %{libname}
Summary: Library for storage management
Group: System/Libraries
Recommends: %{name}-lang
Requires: coreutils
Suggests: cryptsetup
Requires: device-mapper
Suggests: dmraid
Requires: lsscsi >= 0.26
Suggests: lvm2
Suggests: mdadm >= 3.3
Suggests: multipath-tools
Requires: parted >= 3.2
Requires: pkgconfig
Requires: util-linux >= 2.16
Requires: pkgconfig(udev)
Obsoletes: %{libname} < %{version}
Obsoletes: libstorage %(echo `seq -s " " -f "libstorage%.f" 9`)
%ifarch s390 s390x
Requires: s390-tools
%endif
# Old version of libdmraid cannot be used. Upgrading from SLE11 to SLE15
# does not remove old version, so it needs to be marked as conflict.
# For more info, see https://bugzilla.suse.com/show_bug.cgi?id=1088570#c35
Conflicts: libdmraid.so.1.0.0.rc16(libdmraid.so.1.0.0.rc16)(64bit)
%description -n %{libname}
This package contains libstorage-ng, a library for storage management.
%package devel
Summary: Header files and documentation for libstorage-ng
Group: Development/Languages/C and C++
Requires: %{libname} = %{version}
Requires: gcc-c++
Requires: libstdc++-devel
Requires: pkgconfig
Requires: pkgconfig(libxml-2.0)
%description devel
This package contains header files and documentation for developing with
libstorage-ng.
%package python3
Summary: Python bindings for libstorage-ng
Group: System/Libraries
Requires: %{libname} = %{version}
Obsoletes: libstorage-python
Provides: libstorage-ng-python-%{py3_ver}
%description python3
This package contains Python bindings for libstorage-ng.
%package ruby
Summary: Ruby bindings for libstorage-ng
Group: System/Libraries
Requires: %{libname} = %{version}
Obsoletes: libstorage-ruby
Provides: libstorage-ng-ruby-%{rb_ver}
%description ruby
This package contains Ruby bindings for libstorage-ng.
%package utils
Summary: Utils for libstorage-ng
Group: Development/Tools/Other
Recommends: graphviz
Recommends: ImageMagick
%description utils
This package contains utils for libstorage-ng.
%package integration-tests
Summary: Integration tests for libstorage-ng
Group: Development/Tools/Other
Requires: libstorage-ng-python3
BuildArch: noarch
%description integration-tests
This package contains integration tests for libstorage-ng.
%prep
%setup -q
%build
export CFLAGS="%{optflags} -DNDEBUG"
export CXXFLAGS="%{optflags} -DNDEBUG"
autoreconf -fvi
%configure \
--docdir="%{_docdir}/%{name}" \
--disable-static \
--disable-silent-rules
make %{?_smp_mflags}
%check
make %{?_smp_mflags} check VERBOSE=1 \
LIBSTORAGE_CONFDIR=%{buildroot}%{_datadir}/libstorage \
LIBSTORAGE_LOCALEDIR=%{buildroot}%{_datadir}/locale
%install
%make_install
find %{buildroot} -type f -name "*.la" -delete -print
find %{buildroot} -type f -name "*.pyc" -delete -print
install -d -m 755 %{buildroot}/run/libstorage-ng
touch %{buildroot}/run/libstorage-ng/lock
%fdupes -s %{buildroot}
%find_lang libstorage-ng
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%files -n %{name}-lang -f libstorage-ng.lang
%files -n %{libname}
%doc %dir %{_docdir}/%{name}
%doc %{_docdir}/%{name}/AUTHORS
%license %{_docdir}/%{name}/LICENSE
%{_libdir}/libstorage-ng.so.*
%ghost /run/libstorage-ng
%dir %{_datadir}/libstorage
%{_datadir}/libstorage/udev-filters.json
%files devel
%{_libdir}/libstorage-ng.so
%{_includedir}/storage
%dir %{_docdir}/%{name}/autodocs
%doc %{_docdir}/%{name}/autodocs/*
%files python3
%{python3_sitelib}/storage.py*
%attr(755,root,root) %{python3_sitearch}/_storage.so
# Fedora has brp-python-bytecompile so apparently they want those packaged
%if 0%{?fedora}
%{python3_sitelib}/__pycache__/storage*.pyc
%endif
%files ruby
%if 0%{?fedora}
%{ruby_vendorarchdir}/storage.so
%else
%{rb_vendorarchdir}/storage.so
%endif
%files utils
%dir %{_prefix}/lib/libstorage-ng
%{_prefix}/lib/libstorage-ng/utils
%files integration-tests
%{python3_sitelib}/storageitu.py*
%dir %{_prefix}/lib/libstorage-ng
%{_prefix}/lib/libstorage-ng/integration-tests
%changelog