File python-dill.spec of Package python-dill

# spec file for package python-dill
# Copyright (c) 2014 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

Name:           python-dill
Version:        0.2.1
Release:        0
Summary:        Serialize all of python (almost)
License:        BSD-3-Clause
Group:          Development/Languages/Python
BuildRequires:  python-devel
BuildRequires:  python-objgraph >= 1.7.2
BuildRequires:  python-setuptools >= 0.6
Requires:       python-objgraph >= 1.7.2
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
BuildArch:      noarch

Dill extends python's 'pickle' module for serializing and de-serializing
python objects to the majority of the built-in python types. Serialization
is the process of converting an object to a byte stream, and the inverse
of which is converting a byte stream back to on python object hierarchy.

Dill provides the user the same interface as the 'pickle' module, and
also includes some additional features. In addition to pickling python
objects, dill provides the ability to save the state of an interpreter
session in a single command.  Hence, it would be feasable to save a
interpreter session, close the interpreter, ship the pickled file to
another computer, open a new interpreter, unpickle the session and
thus continue from the 'saved' state of the original interpreter

Dill can be used to store python objects to a file, but the primary
usage is to send python objects across the network as a byte stream.
Dill is quite flexible, and allows arbitrary user defined classes
and funcitons to be serialized.  Thus dill is not intended to be
secure against erroneously or maliciously constructed data. It is
left to the user to decide whether the data they unpickle is from
a trustworthy source.

Dill is part of pathos, a python framework for heterogeneous computing.
Dill is in the early development stages, and any user feedback is
highly appreciated. Contact Mike McKerns [mmckerns at caltech dot edu]
with comments, suggestions, and any bugs you may find.  A list of known
issues is maintained at

%setup -q -n dill-%{version}

python build

python install --prefix=%{_prefix} --root=%{buildroot}
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
for B in get_objgraph unpickle ; do
  mv %{buildroot}%{_bindir}/$ %{buildroot}%{_bindir}/$B-%{py_ver}
  touch %{buildroot}%{_sysconfdir}/alternatives/$B
  ln -sf %{_sysconfdir}/alternatives/$B %{buildroot}/%{_bindir}/$B

update-alternatives \
    --install %{_bindir}/get_objgraph get_objgraph %{_bindir}/get_objgraph-%{py_ver} 20 \
    --slave %{_bindir}/unpickle unpickle %{_bindir}/unpickle-%{py_ver}

if [ $1 -eq 0 ] ; then
    update-alternatives --remove get_objgraph %{_bindir}/get_objgraph-%{py_ver}

%ghost %{_sysconfdir}/alternatives/get_objgraph
%ghost %{_sysconfdir}/alternatives/unpickle