File konkretcmpi.spec of Package konkretcmpi
#
# spec file for package konkretcmpi
#
# Copyright (c) 2013 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: konkretcmpi
Version: 0.9.0_35_g9729565
Release: 0
BuildRequires: cmake
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: python-devel
BuildRequires: sblim-cmpi-devel
BuildRequires: swig
Url: https://github.com/rnovacek/konkretcmpi
# Increment the version every time the source code changes.
Summary: A tool for developing CMPI providers in the C programming language
License: MIT
Group: Development/Libraries/C and C++
# This is necessary to build the RPM as a non-root user.
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# "yes" is the default, but we put it here explicitly to avoid someone
# setting it to "no"
Requires: cim-schema >= 2.17
Requires: cim-server
Requires: cmake
Requires: sblim-cmpi-devel
#Source0: https://github.com/rnovacek/konkretcmpi/archive/%{version}/konkretcmpi-%{version}.tar.gz
Source0: konkretcmpi-%{version}.tar.gz
%description
An open-source tool for rapidly developing CMPI providers in the C
programming language. KonkretCMPI makes CMPI provider development
easier by generating type-safe concrete CIM interfaces from MOF
definitions and by providing default implementations for many of the
provider operations.
%package devel
Requires: %{name} = %{version}
Summary: Development files for konkretcmpi
Group: Development/Libraries/C and C++
%description devel
Development files for konkretcmpi
%package python
Summary: Python bindings for konkretcmpi
Group: Development/Libraries/Python
Requires: %{name} = %{version}-%{release}
%if 0%{?suse_version}
%{!?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: %define py_requires Requires: python}
%{py_requires}
%else
Requires: python2
%endif
%description python
This package contains python binding for konkretcmpi.
%prep
# Untar the sources.
%setup -n konkretcmpi-%{version}
%build
rm -rf build
mkdir build
pushd build
# --with-schema=%{_datadir}/mof/cim-current
cmake \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_VERBOSE_MAKEFILE=TRUE \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS_RELEASE:STRING="$RPM_OPT_FLAGS -fstack-protector" \
-DCMAKE_CXX_FLAGS_RELEASE:STRING="$RPM_OPT_FLAGS -fstack-protector" \
-DCMAKE_SKIP_RPATH=1 \
-DPACKAGE_ARCHITECTURE=`uname -m` \
-DEXPLICIT_TARGET="$EXPLICIT_TARGET" \
-DLIB=%{_lib} \
-DWITH_PYTHON=ON \
..
popd
make %{?_smp_mflags} -C build
%install
make DESTDIR=$RPM_BUILD_ROOT install/fast -C build
# Don't package .la object
rm -rf $RPM_BUILD_ROOT/usr/lib*/libkonkret.la
%clean
%{__rm} -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_libdir}/libkonkret.so.*
%{_libdir}/libkonkretmof.so.*
%files devel
%defattr(-,root,root)
%dir %{_includedir}/konkret
%{_includedir}/konkret/*.h
%{_libdir}/libkonkret.so
%{_libdir}/libkonkretmof.so
%{_bindir}/konkret
%{_bindir}/konkretreg
%{_datadir}/cmake/Modules/*
%files python
%defattr(-,root,root)
%{python_sitearch}/*.so
%{python_sitearch}/*.py*
%changelog