File libstorage.spec of Package libstorage
#
# spec file for package libstorage
#
# Copyright (c) 2012 SUSE LINUX Products 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/
#
Name: libstorage
Version: 2.22.11
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: libstorage-%{version}.tar.bz2
Prefix: /usr
BuildRequires: boost-devel
BuildRequires: dejagnu
BuildRequires: doxygen
BuildRequires: gcc-c++
BuildRequires: libtool
BuildRequires: libxml2-devel
BuildRequires: python-devel
BuildRequires: ruby
BuildRequires: ruby-devel
BuildRequires: swig
Summary: Library for storage management
License: GPL-2.0
Group: System/Libraries
Url: http://en.opensuse.org/Portal:Libstorage
%description
This package contains libstorage, a library for storage management.
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%{!?py_requires: %global py_requires Requires: python}
%if 0%{?ruby_sitelib} == 0
%if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora} || 0%{?rhel}
%{!?ruby_sitelib: %global ruby_sitelib %(ruby -r rbconfig -e 'vd = Config::CONFIG["vendorlibdir"]; print(vd ? vd : Config::CONFIG["sitelibdir"])')}
%{!?ruby_sitearch: %global ruby_sitearch %(ruby -r rbconfig -e 'vad = Config::CONFIG["vendorarchdir"]; print(vad ? vad : Config::CONFIG["sitearchdir"])')}
%endif
%endif
%prep
%setup -n libstorage-%{version}
%build
export CFLAGS="$RPM_OPT_FLAGS -DNDEBUG"
export CXXFLAGS="$RPM_OPT_FLAGS -DNDEBUG"
aclocal
libtoolize --force --automake --copy
autoheader
automake --add-missing --copy
autoconf
%{?suse_update_config:%{suse_update_config -f}}
%if 0%{?fedora_version} || 0%{?centos_version}
CXXFLAGS="-I/usr/include/libxml2" \
%else
%if 0%{?rhel_version} >= 500 && 0%{?rhel_version} < 600
CXXFLAGS="-I/usr/include/libxml2 -I/usr/include/c++/4.1.1/tr1" \
%endif
%endif
./configure --libdir=%{_libdir} --prefix=%{prefix} --mandir=%{_mandir} --disable-silent-rules
make %{?jobs:-j%jobs}
%ifarch s390 s390x
sed -i -e 's/DEVICE_NAMES=".*"/DEVICE_NAMES="path"/' data/sysconfig.storage-libstorage
%endif
%check
LOCALEDIR=$RPM_BUILD_ROOT/usr/share/locale make check
%install
make install DESTDIR="$RPM_BUILD_ROOT"
install -d -m 755 $RPM_BUILD_ROOT/var/run/libstorage
touch $RPM_BUILD_ROOT/var/run/libstorage/lock
%{find_lang} libstorage
rm -f $RPM_BUILD_ROOT/%{python_sitearch}/_libstorage.a
rm -f $RPM_BUILD_ROOT/%{python_sitearch}/_libstorage.la
%if 0%{?suse_version}
%if "%{?rb_vendorarchdir}" != ""
rm -f $RPM_BUILD_ROOT/%{rb_vendorarchdir}/storage.la
%else
rm -f $RPM_BUILD_ROOT/%{rb_vendorarch}/storage.la
%endif
%endif
%if 0%{?mandriva_version}
rm $RPM_BUILD_ROOT/%{ruby_sitearchdir}/storage.la
%endif
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
rm $RPM_BUILD_ROOT/%{ruby_sitearch}/storage.la
%endif
%clean
rm -rf "$RPM_BUILD_ROOT"
%package -n libstorage4
Requires: coreutils
Requires: cryptsetup
Requires: device-mapper
Requires: dmraid
Requires: grep
Requires: lsscsi
Requires: lvm2
Requires: mdadm
Requires: multipath-tools
Requires: parted >= 2.2
Requires: udev
Requires: util-linux >= 2.16
%ifarch s390 s390x
Requires: s390-tools
%endif
%if 0%{?suse_version}
PreReq: %fillup_prereq
%endif
Obsoletes: yast2-storage-lib
Provides: yast2-storage-lib
Obsoletes: libstorage < 2.21.2
Provides: libstorage = %{version}
Summary: Library for storage management
Group: System/Libraries
%description -n libstorage4
This package contains libstorage, a library for storage management.
Authors:
--------
Thomas Fehr <fehr@suse.de>
Arvin Schnell <aschnell@suse.de>
%files -n libstorage4 -f libstorage.lang
%defattr(-,root,root)
%{_libdir}/libstorage.so.*
%ghost /var/run/libstorage
/var/adm/fillup-templates/sysconfig.storage-libstorage
%doc %dir %{prefix}/share/doc/packages/libstorage
%doc %{prefix}/share/doc/packages/libstorage/AUTHORS
%doc %{prefix}/share/doc/packages/libstorage/COPYING
%post -n libstorage4
/sbin/ldconfig
%if 0%{?suse_version}
%{fillup_only -an storage}
%endif
%postun -n libstorage4
/sbin/ldconfig
%package -n libstorage-devel
Requires: boost-devel
Requires: gcc-c++
Requires: libstdc++-devel
Requires: libstorage4 = %version
Requires: libxml2-devel
Summary: Header files and documentation for libstorage
Group: Development/Languages/C and C++
%description -n libstorage-devel
This package contains header files and documentation for developing with
libstorage.
Authors:
--------
Thomas Fehr <fehr@suse.de>
Arvin Schnell <aschnell@suse.de>
%files -n libstorage-devel
%defattr(-,root,root)
%{_libdir}/libstorage.la
%{_libdir}/libstorage.so
%{prefix}/include/storage
%doc %{prefix}/share/doc/packages/libstorage/autodocs
%doc %{prefix}/share/doc/packages/libstorage/examples
%package -n libstorage-python
Requires: libstorage4 = %version
%{py_requires}
Summary: Python bindings for libstorage
Group: System/Libraries
%description python
This package contains Python bindings for libstorage.
Authors:
--------
Arvin Schnell <aschnell@suse.de>
%files -n libstorage-python
%defattr(-,root,root)
%{python_sitelib}/libstorage.py*
%attr(755,root,root) %{python_sitearch}/_libstorage.so
%package -n libstorage-ruby
Requires: libstorage4 = %version
Summary: Ruby bindings for libstorage
Group: System/Libraries
%description ruby
This package contains Ruby bindings for libstorage.
Authors:
--------
Thomas Fehr <fehr@suse.de>
Arvin Schnell <aschnell@suse.de>
%files -n libstorage-ruby
%defattr(-,root,root)
%if 0%{?suse_version}
%if "%{?rb_vendorarchdir}" != ""
%{rb_vendorarchdir}/storage.so
%else
%{rb_vendorarch}/storage.so
%endif
%endif
%if 0%{?mandriva_version}
%{ruby_sitearchdir}/storage.so
%endif
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
%{ruby_sitearch}/storage.so
%endif
%package -n libstorage-testsuite
Requires: libstorage4 = %version
Summary: Testsuite for libstorage
Group: Development/Tools/Other
%description -n libstorage-testsuite
This package contains testsuite programs for libstorage.
Authors:
--------
Arvin Schnell <aschnell@suse.de>
%files testsuite
%defattr(-,root,root)
%dir /usr/lib/libstorage
/usr/lib/libstorage/testsuite-real
%changelog