%global octpkg jsonlab
%global upstream_version 1.2
Name: octave-%{octpkg}
Version: 1.2.0
Release: 2%{?dist}
Summary: JSON/UBJSON encoder and a decoder in the native matlab/octave language
License: GPLv3+ or BSD
URL: http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?jsonlab
Source0: https://github.com/fangq/jsonlab/archive/v%{upstream_version}/%{octpkg}-%{upstream_version}.tar.gz
BuildArch: noarch
BuildRequires: octave-devel
Requires: octave
Requires(post): octave
Requires(postun): octave
%description
JSONlab is a free and open-source implementation of a JSON/UBJSON encoder and
a decoder in the native MATLAB language. It can be used to convert a MATLAB
data structure (array, struct, cell, struct array and cell array) into
JSON/UBJSON formatted string, or decode a JSON/UBJSON file into MATLAB data.
JSONlab supports both MATLAB and GNU Octave (a free MATLAB clone).
%prep
%autosetup -n %{octpkg}-%{upstream_version}
rm -rf examples/.svn/
cp LICENSE_GPLv3.txt COPYING
cat > DESCRIPTION << EOF
Name: %{octpkg}
Version: %{version}
Date: %(date +"%Y-%d-%m")
Title: %{summary}
Author: Qianqian Fang <fangq@nmr.mgh.harvard.edu>
Maintainer: Qianqian Fang <fangq@nmr.mgh.harvard.edu>
Description: JSONlab is a free and open-source implementation of a JSON/UBJSON encoder and
a decoder in the native MATLAB language. It can be used to convert a MATLAB
data structure (array, struct, cell, struct array and cell array) into
JSON/UBJSON formatted string, or decode a JSON/UBJSON file into MATLAB data.
JSONlab supports both MATLAB and GNU Octave (a free MATLAB clone).
Categories: JSON
EOF
cat > INDEX << EOF
jsonlab >> JSONLab
JSONLab
jsonopt
loadjson
loadubjson
mergestruct
savejson
saveubjson
struct2jdata
varargin2struct
EOF
mkdir -p inst/
mv *.m inst/
%build
%octave_pkg_build
%install
%octave_pkg_install
%post
%octave_cmd pkg rebuild
%preun
%octave_pkg_preun
%postun
%octave_cmd pkg rebuild
%files
%license LICENSE_GPLv3.txt LICENSE_BSD.txt
%doc examples
%dir %{octpkgdir}
%{octpkgdir}/*.m
%doc %{octpkgdir}/doc-cache
%{octpkgdir}/packinfo
%changelog
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Tue Dec 6 2016 Orion Poplawski <orion@cora.nwra.com> - 1.2.0-1
- Update to 1.2.0
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Dec 02 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.1.0-2
- Remove svn files from doc
* Wed Nov 04 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.1.0-1
- Initial package