aboutsummaryrefslogtreecommitdiffstats
path: root/archivers/unrar
diff options
context:
space:
mode:
authorsunpoet <sunpoet@FreeBSD.org>2014-02-28 23:15:14 +0800
committersunpoet <sunpoet@FreeBSD.org>2014-02-28 23:15:14 +0800
commite156816f5533045bd997e523e6c49e4fe5ec8fd7 (patch)
tree43c10b207e676729aadc3cfb479e596b31701755 /archivers/unrar
parent736bca72ebfda3331faf1fd2116aceb1edca1def (diff)
downloadfreebsd-ports-gnome-e156816f5533045bd997e523e6c49e4fe5ec8fd7.tar.gz
freebsd-ports-gnome-e156816f5533045bd997e523e6c49e4fe5ec8fd7.tar.zst
freebsd-ports-gnome-e156816f5533045bd997e523e6c49e4fe5ec8fd7.zip
- Update to 5.01 (5.0.14)
- Use CONFLICTS_INSTALL instead off CONFLICTS - Respect LDFLAGS - Remove contiguous blank lines - Cosmetic change Thanks to: naddy, vanilla
Diffstat (limited to 'archivers/unrar')
-rw-r--r--archivers/unrar/Makefile15
-rw-r--r--archivers/unrar/distinfo4
-rw-r--r--archivers/unrar/files/patch-os.hpp8
-rw-r--r--archivers/unrar/files/patch-rijndael.cpp59
-rw-r--r--archivers/unrar/files/patch-rijndael.hpp28
5 files changed, 62 insertions, 52 deletions
diff --git a/archivers/unrar/Makefile b/archivers/unrar/Makefile
index 07e7526d1db9..d2d11bd9131f 100644
--- a/archivers/unrar/Makefile
+++ b/archivers/unrar/Makefile
@@ -2,13 +2,12 @@
# $FreeBSD$
PORTNAME= unrar
-PORTVERSION= 4.20
-PORTREVISION= 1
+PORTVERSION= 5.01
PORTEPOCH= 5
CATEGORIES+= archivers
MASTER_SITES= http://www.rarlab.com/rar/ \
LOCAL/sunpoet
-DISTNAME= unrarsrc-4.2.4
+DISTNAME= unrarsrc-5.0.14
MAINTAINER?= sunpoet@FreeBSD.org
COMMENT= Extract, view & test RAR archives
@@ -17,10 +16,11 @@ OPTIONS_DEFINE= DOCS OPENSSL_AES
OPTIONS_DEFAULT=OPENSSL_AES
OPENSSL_AES_DESC= Use OpenSSL implementation of AES
-CONFLICTS?= zh-unrar-[0-9].* unrar-iconv-[0-9].*
+CONFLICTS_INSTALL?= zh-unrar-[0-9].* unrar-iconv-[0-9].*
-MAKE_ARGS= STRIP=${STRIP_CMD} CXX="${CXX}"
-MAKEFILE= makefile.unix
+LDFLAGS+= -pthread
+MAKE_ARGS= CXX=${CXX} LDFLAGS="${LDFLAGS}" STRIP=${STRIP_CMD}
+MAKEFILE= makefile
USES+= gmake
WRKSRC= ${WRKDIR}/${PORTNAME}
@@ -30,9 +30,8 @@ PORTDOCS= license.txt readme.txt
SLAVEDIRS= archivers/unrar-iconv chinese/unrar
OPENSSL_AES_CPPFLAGS= -DOPENSSL_AES -I${OPENSSLINC}
-OPENSSL_AES_USE= OPENSSL=yes
OPENSSL_AES_LDFLAGS= -L${OPENSSLLIB} -lcrypto
-
+OPENSSL_AES_USE= OPENSSL=yes
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/unrar ${STAGEDIR}${PREFIX}/bin/
diff --git a/archivers/unrar/distinfo b/archivers/unrar/distinfo
index 550d5fcc8997..d4f43917f899 100644
--- a/archivers/unrar/distinfo
+++ b/archivers/unrar/distinfo
@@ -1,2 +1,2 @@
-SHA256 (unrarsrc-4.2.4.tar.gz) = 9432bf798e5f7123f3060f37b75b7c07f36f0091305f46473dcae9154f8cd686
-SIZE (unrarsrc-4.2.4.tar.gz) = 164641
+SHA256 (unrarsrc-5.0.14.tar.gz) = e276ea30a2dc9b8961a4268772e5b6caccaa984664e2d5255a43fcb0f5d59806
+SIZE (unrarsrc-5.0.14.tar.gz) = 209707
diff --git a/archivers/unrar/files/patch-os.hpp b/archivers/unrar/files/patch-os.hpp
index eab0a25276c8..41b0963d99b3 100644
--- a/archivers/unrar/files/patch-os.hpp
+++ b/archivers/unrar/files/patch-os.hpp
@@ -1,12 +1,12 @@
---- os.hpp.orig 2012-04-05 22:20:56.000000000 +0200
-+++ os.hpp 2012-04-05 22:21:36.000000000 +0200
-@@ -193,6 +193,10 @@
+--- os.hpp.orig 2013-12-01 16:10:14.000000000 +0800
++++ os.hpp 2014-02-04 08:46:43.448882590 +0800
+@@ -151,6 +151,10 @@
#include <utime.h>
#include <locale.h>
+#ifdef OPENSSL_AES
+#include <openssl/evp.h>
-+#endif
++#endif // OPENSSL_AES
+
#ifdef S_IFLNK
#define SAVE_LINKS
diff --git a/archivers/unrar/files/patch-rijndael.cpp b/archivers/unrar/files/patch-rijndael.cpp
index f135f246a7fd..a8fe66a95125 100644
--- a/archivers/unrar/files/patch-rijndael.cpp
+++ b/archivers/unrar/files/patch-rijndael.cpp
@@ -1,15 +1,15 @@
---- rijndael.cpp.orig 2012-01-09 14:46:08.000000000 +0100
-+++ rijndael.cpp 2012-04-05 23:36:23.000000000 +0200
+--- rijndael.cpp.orig 2013-12-01 16:10:14.000000000 +0800
++++ rijndael.cpp 2014-02-04 08:42:17.943981810 +0800
@@ -7,6 +7,8 @@
- **************************************************************************/
+ ***************************************************************************/
#include "rar.hpp"
+#ifndef OPENSSL_AES
+
- const int uKeyLenInBytes=16, m_uRounds=10;
-
static byte S[256],S5[256],rcon[30];
-@@ -54,6 +56,7 @@ inline void Copy128(byte *dest,const byt
+ static byte T1[256][4],T2[256][4],T3[256][4],T4[256][4];
+ static byte T5[256][4],T6[256][4],T7[256][4],T8[256][4];
+@@ -52,6 +54,7 @@
#endif
}
@@ -17,37 +17,50 @@
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// API
-@@ -61,13 +64,21 @@ inline void Copy128(byte *dest,const byt
+@@ -59,13 +62,34 @@
Rijndael::Rijndael()
{
+#ifndef OPENSSL_AES
if (S[0]==0)
GenerateTables();
-+#endif
++#endif // OPENSSL_AES
}
- void Rijndael::init(Direction dir,const byte * key,byte * initVector)
+ 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;
++ }
++
+ EVP_CIPHER_CTX_init(&ctx);
-+ EVP_CipherInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, initVector,
-+ dir == Decrypt ? 0 : 1);
++ EVP_CipherInit_ex(&ctx, cipher, NULL, key, initVector, Encrypt);
+ EVP_CIPHER_CTX_set_padding(&ctx, 0);
-+#else
- m_direction = dir;
-
- byte keyMatrix[_MAX_KEY_COLUMNS][4];
-@@ -82,6 +93,7 @@ void Rijndael::init(Direction dir,const
++#else // OPENSSL_AES
+ uint uKeyLenInBytes;
+ switch(keyLen)
+ {
+@@ -95,6 +119,7 @@
- if(m_direction == Decrypt)
+ if(!Encrypt)
keyEncToDec();
+#endif // OPENSSL_AES
}
-@@ -91,6 +103,11 @@ size_t Rijndael::blockDecrypt(const byte
+@@ -104,6 +129,11 @@
if (input == 0 || inputLen <= 0)
return 0;
@@ -55,11 +68,11 @@
+ int outLen;
+ EVP_CipherUpdate(&ctx, outBuffer, &outLen, input, inputLen);
+ return outLen;
-+#else
++#else // OPENSSL_AES
byte block[16], iv[4][4];
memcpy(iv,m_initVector,16);
-@@ -113,9 +130,11 @@ size_t Rijndael::blockDecrypt(const byte
+@@ -126,9 +156,11 @@
memcpy(m_initVector,iv,16);
return 16*numBlocks;
@@ -71,9 +84,11 @@
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ALGORITHM
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-@@ -296,3 +315,5 @@ void Rijndael::GenerateTables()
+@@ -309,6 +341,7 @@
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
diff --git a/archivers/unrar/files/patch-rijndael.hpp b/archivers/unrar/files/patch-rijndael.hpp
index 1a9eaa3804f4..816a0c91aad3 100644
--- a/archivers/unrar/files/patch-rijndael.hpp
+++ b/archivers/unrar/files/patch-rijndael.hpp
@@ -1,24 +1,20 @@
---- rijndael.hpp.orig 2012-01-09 14:46:08.000000000 +0100
-+++ rijndael.hpp 2012-04-05 22:42:56.000000000 +0200
-@@ -18,15 +18,21 @@ class Rijndael
- public:
- enum Direction { Encrypt , Decrypt };
+--- rijndael.hpp.orig 2013-12-01 16:10:14.000000000 +0800
++++ rijndael.hpp 2014-02-04 08:48:42.137144316 +0800
+@@ -16,6 +16,9 @@
+ class Rijndael
+ {
private:
-+#ifndef OPENSSL_AES
++#ifdef OPENSSL_AES
++ EVP_CIPHER_CTX ctx;
++#else // OPENSSL_AES
void keySched(byte key[_MAX_KEY_COLUMNS][4]);
void keyEncToDec();
void encrypt(const byte a[16], byte b[16]);
- void decrypt(const byte a[16], byte b[16]);
- void GenerateTables();
-+#endif
-
-+#ifdef OPENSSL_AES
-+ EVP_CIPHER_CTX ctx;
-+#else
- Direction m_direction;
+@@ -25,6 +28,7 @@
+ int m_uRounds;
byte m_initVector[MAX_IV_SIZE];
byte m_expandedKey[_MAX_ROUNDS+1][4][4];
-+#endif
++#endif // OPENSSL_AES
public:
Rijndael();
- void init(Direction dir,const byte *key,byte *initVector);
+ void Init(bool Encrypt,const byte *key,uint keyLen,const byte *initVector);