From bbe35d292dfa982679630968763adf29406b1e38 Mon Sep 17 00:00:00 2001 From: "Jason E. Hale" Date: Tue, 19 Jan 2021 19:51:31 +0000 Subject: Move archivers/libunrar5 -> archivers/libunrar6 due to new major version. Update renamed port to 6.0.3. Bump PORTREVISION on consumers and adjust to use new port origin. --- archivers/Makefile | 2 +- archivers/libunrar5/Makefile | 52 ---------- archivers/libunrar5/distinfo | 3 - archivers/libunrar5/files/patch-os.hpp | 13 --- archivers/libunrar5/files/patch-rijndael.cpp | 136 --------------------------- archivers/libunrar5/files/patch-rijndael.hpp | 24 ----- archivers/libunrar5/pkg-descr | 6 -- archivers/libunrar6/Makefile | 52 ++++++++++ archivers/libunrar6/distinfo | 3 + archivers/libunrar6/files/patch-os.hpp | 13 +++ archivers/libunrar6/files/patch-rijndael.cpp | 136 +++++++++++++++++++++++++++ archivers/libunrar6/files/patch-rijndael.hpp | 24 +++++ archivers/libunrar6/pkg-descr | 6 ++ 13 files changed, 235 insertions(+), 235 deletions(-) delete mode 100644 archivers/libunrar5/Makefile delete mode 100644 archivers/libunrar5/distinfo delete mode 100644 archivers/libunrar5/files/patch-os.hpp delete mode 100644 archivers/libunrar5/files/patch-rijndael.cpp delete mode 100644 archivers/libunrar5/files/patch-rijndael.hpp delete mode 100644 archivers/libunrar5/pkg-descr create mode 100644 archivers/libunrar6/Makefile create mode 100644 archivers/libunrar6/distinfo create mode 100644 archivers/libunrar6/files/patch-os.hpp create mode 100644 archivers/libunrar6/files/patch-rijndael.cpp create mode 100644 archivers/libunrar6/files/patch-rijndael.hpp create mode 100644 archivers/libunrar6/pkg-descr (limited to 'archivers') diff --git a/archivers/Makefile b/archivers/Makefile index 6ed475daf60b..b1ab7b528ca2 100644 --- a/archivers/Makefile +++ b/archivers/Makefile @@ -66,7 +66,7 @@ SUBDIR += libpar2 SUBDIR += librtfcomp SUBDIR += libunrar - SUBDIR += libunrar5 + SUBDIR += libunrar6 SUBDIR += libzip SUBDIR += linux-c7-lz4 SUBDIR += lizard diff --git a/archivers/libunrar5/Makefile b/archivers/libunrar5/Makefile deleted file mode 100644 index 4174bf524fba..000000000000 --- a/archivers/libunrar5/Makefile +++ /dev/null @@ -1,52 +0,0 @@ -# $FreeBSD$ - -PORTNAME= libunrar5 -PORTVERSION= 5.9.4 -CATEGORIES= archivers -MASTER_SITES= http://www.rarlab.com/rar/ -DISTNAME= unrarsrc-${PORTVERSION} - -MAINTAINER= jhale@FreeBSD.org -COMMENT= RAR archive extraction library - -LICENSE= UNRAR -LICENSE_NAME= UnRAR License -LICENSE_FILE= ${WRKSRC}/license.txt -LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept - -USES= compiler:c++11-lang gmake -USE_LDCONFIG= yes - -ALL_TARGET= lib -MAKEFILE= makefile -MAKE_ARGS= AR="${AR}" \ - CXX="${CXX}" \ - CXXFLAGS="${CXXFLAGS} -fPIC" \ - LDFLAGS="-Wl,-soname,${SONAME} -pthread ${LDFLAGS}" \ - STRIP="${STRIP_CMD}" -SONAME= libunrar.so.5 -WRKSRC= ${WRKDIR}/unrar - -CONFLICTS_INSTALL= libunrar-3* libunrar4-4* - -OPTIONS_DEFINE= OPENSSL_AES -OPTIONS_DEFAULT= OPENSSL_AES - -OPENSSL_AES_DESC= Use OpenSSL implementation of AES -OPENSSL_AES_CPPFLAGS= -DOPENSSL_AES -I${OPENSSLINC} -OPENSSL_AES_LDFLAGS= -L${OPENSSLLIB} -lcrypto -OPENSSL_AES_USES= ssl - -PLIST_FILES= lib/libunrar.a \ - lib/libunrar.so \ - lib/${SONAME} \ - include/libunrar5/dll.hpp - -do-install: - ${INSTALL_DATA} ${WRKSRC}/libunrar.a ${STAGEDIR}${PREFIX}/lib/libunrar.a - ${INSTALL_LIB} ${WRKSRC}/libunrar.so ${STAGEDIR}${PREFIX}/lib/${SONAME} - ${RLN} ${STAGEDIR}${PREFIX}/lib/${SONAME} ${STAGEDIR}${PREFIX}/lib/${SONAME:R} - @${MKDIR} ${STAGEDIR}${PREFIX}/include/libunrar5 - ${INSTALL_DATA} ${WRKSRC}/dll.hpp ${STAGEDIR}${PREFIX}/include/libunrar5/dll.hpp - -.include diff --git a/archivers/libunrar5/distinfo b/archivers/libunrar5/distinfo deleted file mode 100644 index 0d73da0fe8d8..000000000000 --- a/archivers/libunrar5/distinfo +++ /dev/null @@ -1,3 +0,0 @@ -TIMESTAMP = 1599876733 -SHA256 (unrarsrc-5.9.4.tar.gz) = 3d010d14223e0c7a385ed740e8f046edcbe885e5c22c5ad5733d009596865300 -SIZE (unrarsrc-5.9.4.tar.gz) = 229921 diff --git a/archivers/libunrar5/files/patch-os.hpp b/archivers/libunrar5/files/patch-os.hpp deleted file mode 100644 index dff506575c08..000000000000 --- a/archivers/libunrar5/files/patch-os.hpp +++ /dev/null @@ -1,13 +0,0 @@ ---- os.hpp.orig 2017-04-28 17:28:46 UTC -+++ os.hpp -@@ -150,6 +150,10 @@ - #include - - -+#ifdef OPENSSL_AES -+#include -+#endif // OPENSSL_AES -+ - #ifdef S_IFLNK - #define SAVE_LINKS - #endif diff --git a/archivers/libunrar5/files/patch-rijndael.cpp b/archivers/libunrar5/files/patch-rijndael.cpp deleted file mode 100644 index 93d60494b85c..000000000000 --- a/archivers/libunrar5/files/patch-rijndael.cpp +++ /dev/null @@ -1,136 +0,0 @@ ---- rijndael.cpp.orig 2018-06-24 15:10:31 UTC -+++ rijndael.cpp -@@ -7,6 +7,8 @@ - ***************************************************************************/ - #include "rar.hpp" - -+#ifndef OPENSSL_AES -+ - #ifdef USE_SSE - #include - #endif -@@ -56,6 +58,7 @@ inline void Copy128(byte *dest,const byt - #endif - } - -+#endif // OPENSSL_AES - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // API -@@ -63,14 +66,41 @@ inline void Copy128(byte *dest,const byt - - Rijndael::Rijndael() - { -+#ifndef OPENSSL_AES - if (S[0]==0) - GenerateTables(); -+#endif // OPENSSL_AES - CBCMode = true; // Always true for RAR. - } - - - void Rijndael::Init(bool Encrypt,const byte *key,uint keyLen,const byte * initVector) - { -+#ifdef OPENSSL_AES -+ const EVP_CIPHER *cipher; -+ switch(keyLen) -+ { -+ case 128: -+ cipher = EVP_aes_128_cbc(); -+ break; -+ case 192: -+ cipher = EVP_aes_192_cbc(); -+ break; -+ case 256: -+ cipher = EVP_aes_256_cbc(); -+ break; -+ } -+ -+#if OPENSSL_VERSION_NUMBER < 0x10100000L -+ EVP_CIPHER_CTX_init(&ctx); -+ EVP_CipherInit_ex(&ctx, cipher, NULL, key, initVector, Encrypt); -+ EVP_CIPHER_CTX_set_padding(&ctx, 0); -+#else -+ EVP_CIPHER_CTX_init(ctx); -+ EVP_CipherInit_ex(ctx, cipher, NULL, key, initVector, Encrypt); -+ EVP_CIPHER_CTX_set_padding(ctx, 0); -+#endif -+#else // OPENSSL_AES - #ifdef USE_SSE - // Check SSE here instead of constructor, so if object is a part of some - // structure memset'ed before use, this variable is not lost. -@@ -111,6 +141,7 @@ void Rijndael::Init(bool Encrypt,const b - - if(!Encrypt) - keyEncToDec(); -+#endif // OPENSSL_AES - } - - void Rijndael::blockEncrypt(const byte *input,size_t inputLen,byte *outBuffer) -@@ -118,6 +149,15 @@ void Rijndael::blockEncrypt(const byte * - if (inputLen <= 0) - return; - -+#ifdef OPENSSL_AES -+ int outLen; -+#if OPENSSL_VERSION_NUMBER < 0x10100000L -+ EVP_CipherUpdate(&ctx, outBuffer, &outLen, input, inputLen); -+#else -+ EVP_CipherUpdate(ctx, outBuffer, &outLen, input, inputLen); -+#endif -+ return; -+#else // OPENSSL_AES - size_t numBlocks = inputLen/16; - #ifdef USE_SSE - if (AES_NI) -@@ -176,6 +216,7 @@ void Rijndael::blockEncrypt(const byte * - input += 16; - } - Copy128(m_initVector,prevBlock); -+#endif // OPENSSL_AES - } - - -@@ -217,6 +258,15 @@ void Rijndael::blockDecrypt(const byte * - if (inputLen <= 0) - return; - -+#ifdef OPENSSL_AES -+ int outLen; -+#if OPENSSL_VERSION_NUMBER < 0x10100000L -+ EVP_CipherUpdate(&ctx, outBuffer, &outLen, input, inputLen); -+#else -+ EVP_CipherUpdate(ctx, outBuffer, &outLen, input, inputLen); -+#endif -+ return; -+#else // OPENSSL_AES - size_t numBlocks=inputLen/16; - #ifdef USE_SSE - if (AES_NI) -@@ -279,6 +329,8 @@ void Rijndael::blockDecrypt(const byte * - } - - memcpy(m_initVector,iv,16); -+ -+#endif // OPENSSL_AES - } - - -@@ -314,7 +366,7 @@ void Rijndael::blockDecryptSSE(const byt - } - #endif - -- -+#ifndef OPENSSL_AES - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // ALGORITHM - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -@@ -454,7 +506,7 @@ void Rijndael::GenerateTables() - U1[b][0]=U2[b][1]=U3[b][2]=U4[b][3]=T5[i][0]=T6[i][1]=T7[i][2]=T8[i][3]=FFmul0e(b); - } - } -- -+#endif // OPENSSL_AES - - #if 0 - static void TestRijndael(); diff --git a/archivers/libunrar5/files/patch-rijndael.hpp b/archivers/libunrar5/files/patch-rijndael.hpp deleted file mode 100644 index e85656700db5..000000000000 --- a/archivers/libunrar5/files/patch-rijndael.hpp +++ /dev/null @@ -1,24 +0,0 @@ ---- rijndael.hpp.orig 2018-06-24 15:10:31 UTC -+++ rijndael.hpp -@@ -16,6 +16,13 @@ - class Rijndael - { - private: -+#ifdef OPENSSL_AES -+#if OPENSSL_VERSION_NUMBER < 0x10100000L -+ EVP_CIPHER_CTX ctx; -+#else -+ EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); -+#endif -+#else // OPENSSL_AES - #ifdef USE_SSE - void blockEncryptSSE(const byte *input,size_t numBlocks,byte *outBuffer); - void blockDecryptSSE(const byte *input, size_t numBlocks, byte *outBuffer); -@@ -25,6 +32,7 @@ class Rijndael - void keySched(byte key[_MAX_KEY_COLUMNS][4]); - void keyEncToDec(); - void GenerateTables(); -+#endif // OPENSSL_AES - - // RAR always uses CBC, but we may need to turn it off when calling - // this code from other archive formats with CTR and other modes. diff --git a/archivers/libunrar5/pkg-descr b/archivers/libunrar5/pkg-descr deleted file mode 100644 index 084c2a82388b..000000000000 --- a/archivers/libunrar5/pkg-descr +++ /dev/null @@ -1,6 +0,0 @@ -The UnRAR library is a minor part of the RAR archiver and contains -the RAR uncompression algorithm. UnRAR requires a very small amount -of memory to operate. It can be used by other programs to extract -RAR archives. - -WWW: https://www.rarlab.com/ diff --git a/archivers/libunrar6/Makefile b/archivers/libunrar6/Makefile new file mode 100644 index 000000000000..f63f917f8237 --- /dev/null +++ b/archivers/libunrar6/Makefile @@ -0,0 +1,52 @@ +# $FreeBSD$ + +PORTNAME= libunrar6 +PORTVERSION= 6.0.3 +CATEGORIES= archivers +MASTER_SITES= http://www.rarlab.com/rar/ +DISTNAME= unrarsrc-${PORTVERSION} + +MAINTAINER= jhale@FreeBSD.org +COMMENT= RAR archive extraction library + +LICENSE= UNRAR +LICENSE_NAME= UnRAR License +LICENSE_FILE= ${WRKSRC}/license.txt +LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept + +USES= compiler:c++11-lang gmake +USE_LDCONFIG= yes + +ALL_TARGET= lib +MAKEFILE= makefile +MAKE_ARGS= AR="${AR}" \ + CXX="${CXX}" \ + CXXFLAGS="${CXXFLAGS} -fPIC" \ + LDFLAGS="-Wl,-soname,${SONAME} -pthread ${LDFLAGS}" \ + STRIP="${STRIP_CMD}" +SONAME= libunrar.so.6 +WRKSRC= ${WRKDIR}/unrar + +CONFLICTS_INSTALL= libunrar-3* + +OPTIONS_DEFINE= OPENSSL_AES +OPTIONS_DEFAULT= OPENSSL_AES + +OPENSSL_AES_DESC= Use OpenSSL implementation of AES +OPENSSL_AES_CPPFLAGS= -DOPENSSL_AES -I${OPENSSLINC} +OPENSSL_AES_LDFLAGS= -L${OPENSSLLIB} -lcrypto +OPENSSL_AES_USES= ssl + +PLIST_FILES= lib/libunrar.a \ + lib/libunrar.so \ + lib/${SONAME} \ + include/${PORTNAME}/dll.hpp + +do-install: + ${INSTALL_DATA} ${WRKSRC}/libunrar.a ${STAGEDIR}${PREFIX}/lib/libunrar.a + ${INSTALL_LIB} ${WRKSRC}/libunrar.so ${STAGEDIR}${PREFIX}/lib/${SONAME} + ${RLN} ${STAGEDIR}${PREFIX}/lib/${SONAME} ${STAGEDIR}${PREFIX}/lib/${SONAME:R} + @${MKDIR} ${STAGEDIR}${PREFIX}/include/${PORTNAME} + ${INSTALL_DATA} ${WRKSRC}/dll.hpp ${STAGEDIR}${PREFIX}/include/${PORTNAME}/dll.hpp + +.include diff --git a/archivers/libunrar6/distinfo b/archivers/libunrar6/distinfo new file mode 100644 index 000000000000..fe98c4e5d6af --- /dev/null +++ b/archivers/libunrar6/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1611078397 +SHA256 (unrarsrc-6.0.3.tar.gz) = 1def53392d879f9e304aa6eac1339cf41f9bce1111a2f5845071665738c4aca0 +SIZE (unrarsrc-6.0.3.tar.gz) = 232331 diff --git a/archivers/libunrar6/files/patch-os.hpp b/archivers/libunrar6/files/patch-os.hpp new file mode 100644 index 000000000000..dff506575c08 --- /dev/null +++ b/archivers/libunrar6/files/patch-os.hpp @@ -0,0 +1,13 @@ +--- os.hpp.orig 2017-04-28 17:28:46 UTC ++++ os.hpp +@@ -150,6 +150,10 @@ + #include + + ++#ifdef OPENSSL_AES ++#include ++#endif // OPENSSL_AES ++ + #ifdef S_IFLNK + #define SAVE_LINKS + #endif diff --git a/archivers/libunrar6/files/patch-rijndael.cpp b/archivers/libunrar6/files/patch-rijndael.cpp new file mode 100644 index 000000000000..93d60494b85c --- /dev/null +++ b/archivers/libunrar6/files/patch-rijndael.cpp @@ -0,0 +1,136 @@ +--- rijndael.cpp.orig 2018-06-24 15:10:31 UTC ++++ rijndael.cpp +@@ -7,6 +7,8 @@ + ***************************************************************************/ + #include "rar.hpp" + ++#ifndef OPENSSL_AES ++ + #ifdef USE_SSE + #include + #endif +@@ -56,6 +58,7 @@ inline void Copy128(byte *dest,const byt + #endif + } + ++#endif // OPENSSL_AES + + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // API +@@ -63,14 +66,41 @@ inline void Copy128(byte *dest,const byt + + Rijndael::Rijndael() + { ++#ifndef OPENSSL_AES + if (S[0]==0) + GenerateTables(); ++#endif // OPENSSL_AES + CBCMode = true; // Always true for RAR. + } + + + void Rijndael::Init(bool Encrypt,const byte *key,uint keyLen,const byte * initVector) + { ++#ifdef OPENSSL_AES ++ const EVP_CIPHER *cipher; ++ switch(keyLen) ++ { ++ case 128: ++ cipher = EVP_aes_128_cbc(); ++ break; ++ case 192: ++ cipher = EVP_aes_192_cbc(); ++ break; ++ case 256: ++ cipher = EVP_aes_256_cbc(); ++ break; ++ } ++ ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ EVP_CIPHER_CTX_init(&ctx); ++ EVP_CipherInit_ex(&ctx, cipher, NULL, key, initVector, Encrypt); ++ EVP_CIPHER_CTX_set_padding(&ctx, 0); ++#else ++ EVP_CIPHER_CTX_init(ctx); ++ EVP_CipherInit_ex(ctx, cipher, NULL, key, initVector, Encrypt); ++ EVP_CIPHER_CTX_set_padding(ctx, 0); ++#endif ++#else // OPENSSL_AES + #ifdef USE_SSE + // Check SSE here instead of constructor, so if object is a part of some + // structure memset'ed before use, this variable is not lost. +@@ -111,6 +141,7 @@ void Rijndael::Init(bool Encrypt,const b + + if(!Encrypt) + keyEncToDec(); ++#endif // OPENSSL_AES + } + + void Rijndael::blockEncrypt(const byte *input,size_t inputLen,byte *outBuffer) +@@ -118,6 +149,15 @@ void Rijndael::blockEncrypt(const byte * + if (inputLen <= 0) + return; + ++#ifdef OPENSSL_AES ++ int outLen; ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ EVP_CipherUpdate(&ctx, outBuffer, &outLen, input, inputLen); ++#else ++ EVP_CipherUpdate(ctx, outBuffer, &outLen, input, inputLen); ++#endif ++ return; ++#else // OPENSSL_AES + size_t numBlocks = inputLen/16; + #ifdef USE_SSE + if (AES_NI) +@@ -176,6 +216,7 @@ void Rijndael::blockEncrypt(const byte * + input += 16; + } + Copy128(m_initVector,prevBlock); ++#endif // OPENSSL_AES + } + + +@@ -217,6 +258,15 @@ void Rijndael::blockDecrypt(const byte * + if (inputLen <= 0) + return; + ++#ifdef OPENSSL_AES ++ int outLen; ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ EVP_CipherUpdate(&ctx, outBuffer, &outLen, input, inputLen); ++#else ++ EVP_CipherUpdate(ctx, outBuffer, &outLen, input, inputLen); ++#endif ++ return; ++#else // OPENSSL_AES + size_t numBlocks=inputLen/16; + #ifdef USE_SSE + if (AES_NI) +@@ -279,6 +329,8 @@ void Rijndael::blockDecrypt(const byte * + } + + memcpy(m_initVector,iv,16); ++ ++#endif // OPENSSL_AES + } + + +@@ -314,7 +366,7 @@ void Rijndael::blockDecryptSSE(const byt + } + #endif + +- ++#ifndef OPENSSL_AES + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // ALGORITHM + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +@@ -454,7 +506,7 @@ void Rijndael::GenerateTables() + U1[b][0]=U2[b][1]=U3[b][2]=U4[b][3]=T5[i][0]=T6[i][1]=T7[i][2]=T8[i][3]=FFmul0e(b); + } + } +- ++#endif // OPENSSL_AES + + #if 0 + static void TestRijndael(); diff --git a/archivers/libunrar6/files/patch-rijndael.hpp b/archivers/libunrar6/files/patch-rijndael.hpp new file mode 100644 index 000000000000..e85656700db5 --- /dev/null +++ b/archivers/libunrar6/files/patch-rijndael.hpp @@ -0,0 +1,24 @@ +--- rijndael.hpp.orig 2018-06-24 15:10:31 UTC ++++ rijndael.hpp +@@ -16,6 +16,13 @@ + class Rijndael + { + private: ++#ifdef OPENSSL_AES ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ EVP_CIPHER_CTX ctx; ++#else ++ EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); ++#endif ++#else // OPENSSL_AES + #ifdef USE_SSE + void blockEncryptSSE(const byte *input,size_t numBlocks,byte *outBuffer); + void blockDecryptSSE(const byte *input, size_t numBlocks, byte *outBuffer); +@@ -25,6 +32,7 @@ class Rijndael + void keySched(byte key[_MAX_KEY_COLUMNS][4]); + void keyEncToDec(); + void GenerateTables(); ++#endif // OPENSSL_AES + + // RAR always uses CBC, but we may need to turn it off when calling + // this code from other archive formats with CTR and other modes. diff --git a/archivers/libunrar6/pkg-descr b/archivers/libunrar6/pkg-descr new file mode 100644 index 000000000000..084c2a82388b --- /dev/null +++ b/archivers/libunrar6/pkg-descr @@ -0,0 +1,6 @@ +The UnRAR library is a minor part of the RAR archiver and contains +the RAR uncompression algorithm. UnRAR requires a very small amount +of memory to operate. It can be used by other programs to extract +RAR archives. + +WWW: https://www.rarlab.com/ -- cgit v1.2.3