Blob Blame History Raw
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}

%global module  javaobj
%global readme  README.rst

%global date    20131228
%global commit  b8ae821d4fa7fa6d7f5ac2eac5432ebc32a3d554
%global scommit %(c=%{commit}; echo ${c:0:7})

Name:           python-%{module}
Version:        0
Release:        0.6.%{date}git%{scommit}%{?dist}
Summary:        Python module for serializing and deserializing Java objects
License:        ASL 2.0
URL:            https://code.google.com/p/%{name}
Source0:        https://github.com/tcalmant/%{name}/archive/%{scommit}/%{name}-%{scommit}.tar.gz 

BuildArch:      noarch
# FIXME python3 support
BuildRequires:  python2-devel >= 2.6
BuildRequires:  python-setuptools

# deps for tests
BuildRequires:  maven-local
BuildRequires:  xorg-x11-server-Xvfb

%description
%{name} is a python library that provides functions for reading
(and writing as WIP) of Java objects serialized or will be deserialized by
ObjectOutputStream. This form of object representation is a standard data
interchange format in Java.

%{module} module exposes an API familiar to users of the standard
library marshal, pickle and json modules.

Features
    Java object instance unmarshaling
    Java class itself unmarshaling
    Primitive values unmarshaling
    Automatic conversion of Java Collections to python ones 
    (HashMap => dict, ArrayList => list, etc) 

See also the PyPi module at: https://pypi.python.org/pypi/%{module}

This project was forked somehow at GitHub. Fedora distributes those sources.
See the %{readme} file for details.


%prep
%setup -qn%{name}-%{commit}
# mock sth. for swing/awt
sed -i -e "s|'mvn'|'xvfb-run', 'xmvn', '-o'|" tests/tests.py


%build
%{__python2} setup.py build


%check
pushd tests
%{__python2} tests.py
# remove temporary builds
rm -r java/target java/test*.ser
popd


%install
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}

 
%files
%license LICENSE
%doc %{readme} tests/
%{python2_sitelib}/%{module}*


%changelog
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.6.20131228gitb8ae821
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Wed Jan 28 2015 Raphael Groner <projects.rg [AT] smart.ms> - 0-0.5.20131228gitb8ae821
- introduce license macro

* Tue Jan 06 2015 Raphael Groner <projects.rg [AT] smart.ms> - 0-0.4.20131228gitb8ae821
- BR python2

* Fri Dec 19 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0-0.3.20142011svn31
- use date of last commit (instead of checkout/export)
- use GitHub (forked?)
- remove sed fiddling
- distribute tests folder as documentation samples

* Sat Nov 22 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0-0.2.20142011svn31
- fix swing/awt test

* Thu Nov 20 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0-0.1.20142011svn31
- initial