File libstorage.spec of Package libstorage

#
# spec file for package libstorage
#
# Copyright (c) 2011 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/
#

# norootforbuild


Name:           libstorage
Version:        2.20.7
Release:        1
License:        GPL
Group:          System/Libraries
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source:         libstorage-%{version}.tar.bz2
Source1:        libstorage-rpmlintrc

Prefix:         /usr

BuildRequires:  blocxx-devel boost-devel dejagnu doxygen gcc-c++ libxml2-devel python-devel swig

Requires:       parted >= 2.2 mdadm device-mapper lvm2 dmraid multipath-tools cryptsetup
Requires:       coreutils udev util-linux >= 2.16 grep lsscsi
%ifarch s390 s390x
Requires:       s390-tools
%endif

PreReq:         %fillup_prereq
Obsoletes:      yast2-storage-lib
Provides:       yast2-storage-lib
Summary:        Library for storage management

%description
This package contains libstorage, a library for storage management.

Authors:
--------
    Thomas Fehr <fehr@suse.de>
    Arvin Schnell <aschnell@suse.de>

%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}}
./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/lock/libstorage

%{find_lang} libstorage

rm -f $RPM_BUILD_ROOT/%{python_sitearch}/_libstorage.a  
rm -f $RPM_BUILD_ROOT/%{python_sitearch}/_libstorage.la

%clean
rm -rf "$RPM_BUILD_ROOT"

%files -f libstorage.lang
%defattr(-,root,root)
%{_libdir}/libstorage.so.*
%dir /var/lock/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
/sbin/ldconfig
%{fillup_only -an storage}

%postun
/sbin/ldconfig

%package devel
License:        GPL
Requires:       libstorage = %version
Requires:       gcc-c++ libstdc++-devel boost-devel blocxx-devel libxml2-devel
Summary:        Header files and documentation for libstorage
Group:          Development/Languages/C and C++

%description devel
This package contains header files and documentation for developing with
libstorage.

Authors:
--------
    Thomas Fehr <fehr@suse.de>
    Arvin Schnell <aschnell@suse.de>

%files 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 python
License:        GPL
Requires:       libstorage = %version
Summary:        Python bindings for libstorage
Group:          System/Libraries

%description python
This package contains Python bindings for libstorage.

Authors:
--------
    Arvin Schnell <aschnell@suse.de>

%files python
%defattr(-,root,root)
%{python_sitelib}/libstorage.py*
%attr(755,root,root) %{python_sitearch}/_libstorage.so

%package testsuite
License:        GPL
Requires:       libstorage = %version
Summary:        testsuite for libstorage
Group:          Development/Tools/Other

%description 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
openSUSE Build Service is sponsored by