libblockdev/libblockdev.spec

257 lines
8.5 KiB
RPMSpec
Raw Normal View History

#
# spec file for package libblockdev
#
# Copyright (c) 2018 SUSE LINUX GmbH, 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 http://bugs.opensuse.org/
#
%bcond_with python2
%define somajor 2
%define libname %{name}%{somajor}
Name: libblockdev
Summary: A library for low-level manipulation with block devices
License: LGPL-2.1-only
Group: Development/Libraries/C and C++
Version: 2.16
Release: 0
URL: https://github.com/storaged-project/libblockdev
Source0: https://github.com/storaged-project/libblockdev/releases/download/%{version}-1/libblockdev-%{version}.tar.gz
# PATCH-FIX-OPENSUSE libblockdev-fix-libkmod-include.patch luc14n0@linuxmail.org -- openSUSE's libkmod.h file location are not under the expected /usr/include directory but /usr/include/kmod.
Patch0: libblockdev-fix-libkmod-include.patch
BuildRequires: dmraid-devel
BuildRequires: gobject-introspection-devel >= 1.3.0
BuildRequires: gtk-doc
%{?with_python2:BuildRequires: python-devel}
BuildRequires: python3-base
BuildRequires: python3-devel
# There is a s390x plugin that, until vtoc.h is provided, can't be added.
#BuildRequires: s390-tools-devel
BuildRequires: volume_key-devel
BuildRequires: pkgconfig(blkid) >= 2.23.0
BuildRequires: pkgconfig(bytesize) >= 0.1
BuildRequires: pkgconfig(devmapper) >= 1.02.93
BuildRequires: pkgconfig(gio-2.0) >= 2.42.2
BuildRequires: pkgconfig(glib-2.0) >= 2.42.2
BuildRequires: pkgconfig(gobject-2.0) >= 2.42.2
BuildRequires: pkgconfig(libcryptsetup) >= 1.6.7
BuildRequires: pkgconfig(libkmod) >= 19
BuildRequires: pkgconfig(libparted) >= 3.1
BuildRequires: pkgconfig(libudev) >= 216
BuildRequires: pkgconfig(mount) >= 2.23.0
BuildRequires: pkgconfig(nss) >= 3.18.0
Requires: %{libname} >= %{version}
%description
The LibBlockDev is a C library with GObject introspection support that can be
used for doing low-level operations with block devices like setting up LVM,
BTRFS, LUKS or MD RAID. The library uses plugins (LVM, BTRFS,...) and serves as
a thin wrapper around its plugins' functionality. All the plugins, however, can
be used as standalone libraries. One of the core principles of LibBlockDev is
that it is stateless from the storage configuration's perspective (e.g. it has
no information about VGs when creating an LV).
%package -n %{libname}
Summary: A library for low-level manipulation with block devices
Group: System/Libraries
Requires: bcache-tools >= 1.0.8
Requires: device-mapper
# For thin_metadata_size
#Requires: device-mapper-persistent-data
Requires: dmraid
Requires: gdisk
Requires: lvm2
Requires: lvm2-clvm >= 2.02.156
Requires: mdadm
Requires: util-linux
%description -n %{libname}
The LibBlockDev is a C library with GObject introspection support that can be
used for doing low-level operations with block devices like setting up LVM,
BTRFS, LUKS or MD RAID. The library uses plugins (LVM, BTRFS,...) and serves as
a thin wrapper around its plugins' functionality. All the plugins, however, can
be used as standalone libraries. One of the core principles of LibBlockDev is
that it is stateless from the storage configuration's perspective (e.g. it has
no information about VGs when creating an LV).
%package -n typelib-1_0-BlockDev-2_0
Summary: Introspection bindings for the LibBlockDev library
Group: System/Libraries
%description -n typelib-1_0-BlockDev-2_0
This package provides the GObject Introspection bindings for LibBlockDev, which
provides low-level manipulation of block devices.
%package devel
Summary: Development files for the LibBlockDev library
Group: Development/Libraries/C and C++
Requires: %{libname} >= %{version}
Requires: glib2-devel
Requires: device-mapper-devel
Requires: systemd-devel
Requires: dmraid-devel
Requires: xfsprogs
Requires: dosfstools
%description devel
This package provides header files, pkg-config modules and API documentation needed for
development with the LibBlockDev library.
%package -n python2-%{name}
Summary: Python2 gobject-introspection bindings for the LibBlockDev library
Group: Development/Libraries/Python
Requires: %{libname} >= %{version}
Requires: python2-gobject
%description -n python2-%{name}
This package contains enhancements to the gobject-introspection bindings for
LibBlockDev in Python2.
%package -n python3-%{name}
Summary: Python3 gobject-introspection bindings for the LibBlockDev library
Group: Development/Libraries/Python
Requires: %{libname} >= %{version}
Requires: python3-gobject
%description -n python3-%{name}
This package contains enhancements to the gobject-introspection bindings for
LibBlockDev in Python3.
%prep
%autosetup -p1
%build
%configure \
--disable-static \
--enable-introspection \
--with-bcache \
--with-btrfs \
--with-crypto \
--with-dm \
--with-fs \
--with-gtk-doc \
--with-kbd \
--with-loop \
--with-lvm \
--with-lvm_dbus \
--with-mdraid \
--with-mpath \
--with-part \
--with-swap
%make_build
%install
%make_install
find %{buildroot} -name "*.la" -print -type f -delete
%if !%{with python2}
rm -rf %{buildroot}/gi/overrides/
%endif
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%files
%dir %{_sysconfdir}/libblockdev
%dir %{_sysconfdir}/libblockdev/conf.d
%config %{_sysconfdir}/libblockdev/conf.d/00-default.cfg
%config %{_sysconfdir}/libblockdev/conf.d/10-lvm-dbus.cfg
%files -n %{libname}
%license LICENSE
%{_libdir}/libblockdev.so.%{somajor}*
# List all plugins to keep track of them
%{_libdir}/libbd_btrfs.so.%{somajor}*
%{_libdir}/libbd_crypto.so.%{somajor}*
%{_libdir}/libbd_dm.so.%{somajor}*
%{_libdir}/libbd_fs.so.%{somajor}*
%{_libdir}/libbd_kbd.so.%{somajor}*
%{_libdir}/libbd_loop.so.%{somajor}*
%{_libdir}/libbd_lvm.so.%{somajor}*
%{_libdir}/libbd_lvm-dbus.so.%{somajor}*
%{_libdir}/libbd_mdraid.so.%{somajor}*
%{_libdir}/libbd_mpath.so.%{somajor}*
%{_libdir}/libbd_part.so.%{somajor}*
%{_libdir}/libbd_part_err.so.%{somajor}*
%{_libdir}/libbd_swap.so.%{somajor}*
%{_libdir}/libbd_utils.so.%{somajor}*
%files -n typelib-1_0-BlockDev-2_0
%{_libdir}/girepository-1.0/BlockDev-2.0.typelib
%files devel
%doc features.rst specs.rst
%doc %{_datadir}/gtk-doc/html/libblockdev
%{_libdir}/libblockdev.so
%{_libdir}/libbd_btrfs.so
%{_libdir}/libbd_crypto.so
%{_libdir}/libbd_dm.so
%{_libdir}/libbd_fs.so
%{_libdir}/libbd_kbd.so
%{_libdir}/libbd_loop.so
%{_libdir}/libbd_lvm.so
%{_libdir}/libbd_lvm-dbus.so
%{_libdir}/libbd_mdraid.so
%{_libdir}/libbd_mpath.so
%{_libdir}/libbd_part.so
%{_libdir}/libbd_part_err.so
%{_libdir}/libbd_swap.so
%{_libdir}/libbd_utils.so
%{_libdir}/pkgconfig/blockdev.pc
%{_libdir}/pkgconfig/blockdev-utils.pc
%{_datadir}/gir-1.0/BlockDev-2.0.gir
%dir %{_includedir}/blockdev
%dir %{_includedir}/blockdev/fs
%{_includedir}/blockdev/blockdev.h
%{_includedir}/blockdev/module.h
%{_includedir}/blockdev/plugins.h
%{_includedir}/blockdev/btrfs.h
%{_includedir}/blockdev/crypto.h
%{_includedir}/blockdev/dev_utils.h
%{_includedir}/blockdev/dm.h
%{_includedir}/blockdev/exec.h
%{_includedir}/blockdev/extra_arg.h
%{_includedir}/blockdev/fs.h
%{_includedir}/blockdev/fs/ext.h
%{_includedir}/blockdev/fs/generic.h
%{_includedir}/blockdev/fs/mount.h
%{_includedir}/blockdev/fs/ntfs.h
%{_includedir}/blockdev/fs/vfat.h
%{_includedir}/blockdev/fs/xfs.h
%{_includedir}/blockdev/kbd.h
%{_includedir}/blockdev/loop.h
%{_includedir}/blockdev/lvm.h
%{_includedir}/blockdev/mdraid.h
%{_includedir}/blockdev/mpath.h
%{_includedir}/blockdev/part.h
%{_includedir}/blockdev/sizes.h
%{_includedir}/blockdev/swap.h
%{_includedir}/blockdev/utils.h
%if %{with python2}
%files -n python2-%{name}
%dir %{python2_sitearch}/gi
%dir %{python2_sitearch}/gi/overrides
%{python2_sitearch}/gi/overrides/BlockDev.py
%endif
%files -n python3-%{name}
%dir %{python3_sitearch}/gi
%dir %{python3_sitearch}/gi/overrides
%{python3_sitearch}/gi/overrides/BlockDev.py
%changelog