2018-01-19 00:23:24 +01:00
#
# spec file for package libblockdev
#
2018-02-22 17:44:30 +01:00
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
2018-01-19 00:23:24 +01:00
#
# 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/
#
2018-03-06 01:19:26 +01:00
%bcond_with python2
%define somajor 2
%define libname %{name}%{somajor}
2018-01-19 00:23:24 +01:00
Name : libblockdev
Summary : A library for low-level manipulation with block devices
2018-03-06 01:19:26 +01:00
License : LGPL-2.1-only
2018-01-19 00:23:24 +01:00
Group : Development/Libraries/C and C++
2018-02-22 17:44:30 +01:00
Version : 2.16
2018-01-19 00:23:24 +01:00
Release : 0
2018-03-06 01:19:26 +01:00
URL : https://github.com/storaged-project/libblockdev
2018-02-22 17:44:30 +01:00
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
2018-01-19 00:23:24 +01:00
BuildRequires : dmraid-devel
2018-02-22 17:44:30 +01:00
BuildRequires : gobject-introspection-devel >= 1.3.0
BuildRequires : gtk-doc
%{?with_python2:BuildRequires: python-devel}
BuildRequires : python3-base
2018-01-19 00:23:24 +01:00
BuildRequires : python3-devel
2018-02-22 17:44:30 +01:00
# There is a s390x plugin that, until vtoc.h is provided, can't be added.
#BuildRequires: s390-tools-devel
2018-01-19 00:23:24 +01:00
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
2018-03-06 01:19:26 +01:00
Requires : %{libname} >= %{version}
2018-01-19 00:23:24 +01:00
%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
2018-03-06 01:19:26 +01:00
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
2018-01-19 00:23:24 +01:00
%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++
2018-02-23 18:06:11 +01:00
Requires : %{libname} >= %{version}
2018-01-19 00:23:24 +01:00
Requires : glib2-devel
2018-03-06 01:19:26 +01:00
Requires : device-mapper-devel
Requires : systemd-devel
Requires : dmraid-devel
Requires : xfsprogs
Requires : dosfstools
2018-01-19 00:23:24 +01:00
%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
2018-02-23 18:06:11 +01:00
Requires : %{libname} >= %{version}
2018-01-19 00:23:24 +01:00
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
2018-02-23 18:06:11 +01:00
Requires : %{libname} >= %{version}
2018-01-19 00:23:24 +01:00
Requires : python3-gobject
%description -n python3-%{name}
This package contains enhancements to the gobject-introspection bindings for
LibBlockDev in Python3.
%prep
2018-02-22 17:44:30 +01:00
%autosetup -p1
2018-01-19 00:23:24 +01:00
%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 \
2018-02-22 17:44:30 +01:00
--with-swap
2018-01-19 00:23:24 +01:00
%make_build
%install
%make_install
find %{buildroot} -name " * . l a " -print -type f -delete
2018-02-22 17:44:30 +01:00
%if !%{with python2}
rm -rf %{buildroot} /gi/overrides/
%endif
2018-01-19 00:23:24 +01:00
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
2018-02-22 17:44:30 +01:00
%files
%dir %{_sysconfdir} /libblockdev
%dir %{_sysconfdir} /libblockdev/conf.d
%config %{_sysconfdir} /libblockdev/conf.d/00-default.cfg
2018-03-06 01:19:26 +01:00
%config %{_sysconfdir} /libblockdev/conf.d/10-lvm-dbus.cfg
2018-01-19 00:23:24 +01:00
%files -n %{libname}
%license LICENSE
%{_libdir} /libblockdev.so.%{somajor} *
2018-03-06 01:19:26 +01:00
# 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} *
2018-01-19 00:23:24 +01:00
%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
2018-03-06 01:19:26 +01:00
%{_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
2018-01-19 00:23:24 +01:00
%dir %{_includedir} /blockdev
2018-03-06 01:19:26 +01:00
%dir %{_includedir} /blockdev/fs
2018-01-19 00:23:24 +01:00
%{_includedir} /blockdev/blockdev.h
2018-02-22 17:44:30 +01:00
%{_includedir} /blockdev/module.h
2018-01-19 00:23:24 +01:00
%{_includedir} /blockdev/plugins.h
%{_includedir} /blockdev/btrfs.h
%{_includedir} /blockdev/crypto.h
2018-03-06 01:19:26 +01:00
%{_includedir} /blockdev/dev_utils.h
2018-01-19 00:23:24 +01:00
%{_includedir} /blockdev/dm.h
2018-03-06 01:19:26 +01:00
%{_includedir} /blockdev/exec.h
%{_includedir} /blockdev/extra_arg.h
2018-01-19 00:23:24 +01:00
%{_includedir} /blockdev/fs.h
2018-02-22 17:44:30 +01:00
%{_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
2018-01-19 00:23:24 +01:00
%{_includedir} /blockdev/kbd.h
%{_includedir} /blockdev/loop.h
%{_includedir} /blockdev/lvm.h
%{_includedir} /blockdev/mdraid.h
%{_includedir} /blockdev/mpath.h
%{_includedir} /blockdev/part.h
2018-03-06 01:19:26 +01:00
%{_includedir} /blockdev/sizes.h
%{_includedir} /blockdev/swap.h
%{_includedir} /blockdev/utils.h
2018-01-19 00:23:24 +01:00
2018-03-06 01:19:26 +01:00
%if %{with python2}
%files -n python2-%{name}
%dir %{python2_sitearch} /gi
%dir %{python2_sitearch} /gi/overrides
%{python2_sitearch} /gi/overrides/BlockDev.py
%endif
2018-01-19 00:23:24 +01:00
2018-03-06 01:19:26 +01:00
%files -n python3-%{name}
%dir %{python3_sitearch} /gi
%dir %{python3_sitearch} /gi/overrides
%{python3_sitearch} /gi/overrides/BlockDev.py
2018-01-19 00:23:24 +01:00
%changelog