diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..50ede66 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/easylzma-0.0.7.tar.gz +/zmat-0.9.tar.gz diff --git a/octave-zmat.spec b/octave-zmat.spec new file mode 100644 index 0000000..4b70df9 --- /dev/null +++ b/octave-zmat.spec @@ -0,0 +1,105 @@ +%global octpkg zmat + +Name: octave-%{octpkg} +Version: 0.9 +Release: 1%{?dist} +Summary: A portable data compression/decompression toolbox for MATLAB/Octave +License: GPLv3+ or BSD +URL: https://github.com/fangq/zmat +Source0: https://github.com/fangq/zmat/archive/v%{version}/%{octpkg}-%{version}.tar.gz +Source1: https://github.com/lloyd/easylzma/archive/0.0.7/easylzma-0.0.7.tar.gz +BuildRequires: octave-devel zlib cmake gcc-c++ + +Requires: octave zlib +Requires(post): octave +Requires(postun): octave + +%description +ZMat is a portable mex function to enable zlib/gzip/lzma/lzip/lz4/lz4hc +based data compression/decompression and base64 encoding/decoding support +in MATLAB and GNU Octave. It is fast and compact, can process a large +array within a fraction of a second. Among the 6 supported compression +methods, lz4 is the fastest for compression/decompression; lzma is the +slowest but has the highest compression ratio; zlib/gzip have the best +balance between speed and compression time. + +%prep +%autosetup -n %{octpkg}-%{version} -b 1 +rm -rf src/easylzma +cp -r ../easylzma-0.0.7 src/easylzma + +cp LICENSE.txt COPYING + +cat > DESCRIPTION << EOF +Name: %{octpkg} +Version: %{version} +Date: %(date +"%Y-%d-%m") +Title: %{summary} +Author: Qianqian Fang +Maintainer: Qianqian Fang +Description: ZMat is a portable mex function to enable zlib/gzip/lzma/lzip/lz4/lz4hc + based data compression/decompression and base64 encoding/decoding support + in MATLAB and GNU Octave. It is fast and compact, can process a large + array within a fraction of a second. Among the 6 supported compression + methods, lz4 is the fastest for compression/decompression; lzma is the + slowest but has the highest compression ratio; zlib/gzip have the best + balance between speed and compression time. + +Categories: Zip +EOF + +cat > INDEX << EOF +zmat >> ZMat +ZMat + zmat + zipmat +EOF + + +mkdir -p inst/ +mv *.m inst/ + +%build +cd src/easylzma +%cmake . +%make_build +mv easylzma-0.0.7 easylzma-0.0.8 +cd ../ +make clean +make oct +cd ../ +mv *.mex inst/ +rm -rf src +%octave_pkg_build + +%if 0%{?fedora} <=30 + %global octave_tar_suffix any-none +%endif + +%install +%octave_pkg_install + +%post +%octave_cmd pkg rebuild + +%preun +%octave_pkg_preun + +%postun +%octave_cmd pkg rebuild + +%files +%license LICENSE.txt +%doc example +%doc README.rst +%doc AUTHORS.txt +%doc ChangeLog.txt +%dir %{octpkgdir} +%{octpkgdir}/*.m +%{octpkgdir}/*.mex +%doc %{octpkgdir}/doc-cache +%{octpkgdir}/packinfo + +%changelog +* Tue Oct 01 2019 Qianqian Fang - 0.9-1 +- Initial package diff --git a/sources b/sources new file mode 100644 index 0000000..7e48f1a --- /dev/null +++ b/sources @@ -0,0 +1,2 @@ +SHA512 (easylzma-0.0.7.tar.gz) = 23bc2b6b88ae3bea389a04319effdf129477fed302ee719b9fadc7db1a79eec8c54fe9971e4d88dbbfb552371ce1dd308636f0e7fad2343a6cf26736c3261103 +SHA512 (zmat-0.9.tar.gz) = f205f14d9e6c9f528f0d2f42744f8760c0459ba436bf90bac67d86ad8336447b6abd3d1b456b996424f6c9abd7b2b2573b6b5f7e183a05c6fad649ab660916f1