diff --git a/libgringotts-1.2.1-bzip2-algo-bigendian-sizefix.patch b/libgringotts-1.2.1-bzip2-algo-bigendian-sizefix.patch new file mode 100644 index 0000000..dc3f5e3 --- /dev/null +++ b/libgringotts-1.2.1-bzip2-algo-bigendian-sizefix.patch @@ -0,0 +1,37 @@ +--- libgringotts-1.2.1.orig/src/libgrg_crypt.c 2003-04-24 20:33:28.000000000 +0900 ++++ libgringotts-1.2.1/src/libgrg_crypt.c 2022-11-25 22:45:06.134497797 +0900 +@@ -347,10 +347,14 @@ decrypt_mem (const GRG_CTX gctx, const G + } + + if (gctx->comp_algo) //bz2 ++ { ++ unsigned int destLen = oDim; + err = BZ2_bzBuffToBuffDecompress ((unsigned char *) +- tmpData, (unsigned int *) &oDim, ++ tmpData, &destLen, + (unsigned char *) curdata, curlen, + USE_BZ2_SMALL_MEM, 0); ++ oDim = destLen; ++ } + else //zlib + err = uncompress (tmpData, &oDim, curdata, curlen); + +@@ -411,13 +415,16 @@ grg_encrypt_mem (const GRG_CTX gctx, con + + //compress the data + if (gctx->comp_algo) //bz2 ++ { ++ unsigned int destLen = compDim; + err = BZ2_bzBuffToBuffCompress (compData, +- (unsigned int *) +- &compDim, ++ &destLen, + (unsigned char *) + origData, uncDim, + gctx->comp_lvl * 3, 0, + 0); ++ compDim = destLen; ++ } + else + err = compress2 (compData, &compDim, origData, uncDim, + gctx->comp_lvl * 3); diff --git a/libgringotts-1.2.1.tar.bz2 b/libgringotts-1.2.1.tar.bz2 new file mode 100644 index 0000000..fe0e509 Binary files /dev/null and b/libgringotts-1.2.1.tar.bz2 differ diff --git a/libgringotts.spec b/libgringotts.spec new file mode 100644 index 0000000..9058f9e --- /dev/null +++ b/libgringotts.spec @@ -0,0 +1,117 @@ +Name: libgringotts +Version: 1.2.1 +Release: 1 +Summary: A backend for managing encrypted data files on the disk +Summary(pl): Zaplecze do zarządzania zaszyfrowanymi plikami danych na dysku + +License: GPL-2.0-or-later +URL: http://gringotts.shlomifish.org/ +Source0: http://download.berlios.de/gringotts/%{name}-%{version}.tar.bz2 +# Patch for bzip2 algo size fix for big endian +Patch0: libgringotts-1.2.1-bzip2-algo-bigendian-sizefix.patch + +BuildRequires: gcc +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libtool +BuildRequires: make + +BuildRequires: bzip2-devel +BuildRequires: libmcrypt-devel +BuildRequires: mhash-devel +BuildRequires: zlib-devel + + +%description +libGringotts is a small, easy-to-use, thread-safe C library + originally developed for Gringotts; its purpose is to +encapsulate data (generic: ASCII, but also binary data) +in an encrypted and compressed structure, to be written +in a file or used elseway. It makes use of strong +encryption algorithms, to ensure the data are as safe +as possible, and allow the user to have the complete +control over all the algorithms used in the process. + +%description -l pl +libGringotts to niewielka, łatwa w użyciu biblioteka +napisana w C, początkowo tworzona dla Gringotts. +Jej zadaniem jest przechowywanie danych +(głównie: ASCII, ale równiez binarnych) w zaszyfrowanej +i skompresowanej strukturze, zapisywanej np. w pliku. +Używa ona silnych algorytmów szyfrujących +dla maskymalnego bezpieczeństwa danych +oraz by zapewnić użytkownikowi pełną kontrolę nad nimi. + + +%package devel +Summary: Development files for libgringotts +Summary(pl): Pliki deweloperskie dla libgringotts +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +The libgringotts-devel package contains libraries and header files for +developing applications that use libgringotts. + +%description devel -l pl +Pakiet libgringotts-devel zawiera biblioteki i pliki nagłówków +niezbędne do tworzenia aplikacji, które używają libgringotts. + + +%prep +%setup -q +%patch0 -p1 -b .bigendian + +# For check +sed -i src/Makefile.am \ + -e 's|\(^[ \t][ \t]*\)@|\1|' \ + -e 's|test.c .libs/libgringotts.a|test.c -L.libs -lgringotts|' \ + -e 's|./libgrgtest|env LD_LIBRARY_PATH=.libs ./libgrgtest|' \ + %{nil} + +autoreconf -fi + +%build +%configure --disable-static +%make_build + +%install +%make_install + +find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' +# Clean up documentation directory +rm -rf $RPM_BUILD_ROOT%{_docdir} + +%check +# Some tests e.g. 8) Password quality test (strings) reads /dev/random +# so tests may fail randomly. +# Repeat tests several times to rescue such failure. +test_status=1 +for times in $(seq 1 3) ; do + make check || continue + test_status=0 + break +done +if test $test_status != 0 ; then exit 1 ; fi + +%ldconfig_scriptlets + +%files +%license COPYING +%doc AUTHORS +%doc ChangeLog +%doc NEWS +%doc README +%doc TODO + +%{_libdir}/%{name}.so.2{,.*} + +%files devel +%doc docs/manual.htm +%{_includedir}/libgringotts.h +%{_libdir}/%{name}.so +%{_libdir}/pkgconfig/%{name}.pc + + +%changelog +* Wed May 17 2023 wangtaozhi -1.2.1-1 +- Package init diff --git a/libgringotts.yaml b/libgringotts.yaml new file mode 100644 index 0000000..a22ff51 --- /dev/null +++ b/libgringotts.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: https://github.com/shlomif/gringotts +tag_prefix: "v" +separator: "."