Hello community,

here is the log from the commit of package scpm for openSUSE:Factory checked in 
at 2014-05-02 14:03:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/scpm (Old)
 and      /work/SRC/openSUSE:Factory/.scpm.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "scpm"

Changes:
--------
--- /work/SRC/openSUSE:Factory/scpm/scpm.changes        2012-09-13 
00:06:54.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.scpm.new/scpm.changes   2014-05-02 
14:03:13.000000000 +0200
@@ -1,0 +2,8 @@
+Thu Apr 17 03:30:37 UTC 2014 - [email protected]
+
+- Use -fvisiblity-inlines-hidden
+- scpm-md5.patch: This is one of the remaining two packages
+  that still require abandonware library "mhash", replace
+  its usage with cryptopp so we can drop the package in question.
+
+-------------------------------------------------------------------

New:
----
  scpm-md5.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ scpm.spec ++++++
--- /var/tmp/diff_new_pack.6fGbKJ/_old  2014-05-02 14:03:14.000000000 +0200
+++ /var/tmp/diff_new_pack.6fGbKJ/_new  2014-05-02 14:03:14.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package scpm
 #
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -23,8 +23,8 @@
 BuildRequires:  graphviz-gnome
 BuildRequires:  libjpeg-devel
 BuildRequires:  libpng-devel
-BuildRequires:  mhash-devel
 BuildRequires:  xz
+BuildRequires:  pkgconfig(cryptopp)
 %if 0%{suse_version} > 1220
 BuildRequires:  makeinfo
 %endif
@@ -44,6 +44,7 @@
 Patch7:         scpm-no_using_in_header.patch
 Patch8:         scpm-constification.patch
 Patch9:         scpm-doc_config.patch
+Patch10:        scpm-md5.patch
 Requires:       diffutils
 Requires:       textutils
 Requires(post): awk
@@ -88,9 +89,9 @@
 %patch7
 %patch8
 %patch9
-
+%patch10 -p1
 %build
-export CXXFLAGS="%{optflags}"
+export CXXFLAGS="%{optflags} -fvisibility-inlines-hidden"
 echo -e "#!/bin/bash\n$(which %__cxx) \"\$@\"" >g++
 chmod 755 g++
 export PATH=`pwd`:$PATH

++++++ scpm-md5.patch ++++++
--- scpm-1.1.7.orig/src/main/modlib.cc
+++ scpm-1.1.7/src/main/modlib.cc
@@ -21,79 +21,44 @@
 #include <cstdlib>
 #include <cstdio>
 #include <string>
-#include <mhash.h>
 #include <fcntl.h>
 #include <iostream>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
 
+#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
+#include <cryptopp/md5.h>
+#include <cryptopp/files.h>
+#include <cryptopp/filters.h>
+#include <cryptopp/hex.h>
+
 using namespace std;
+using namespace CryptoPP::Weak1;
+using namespace CryptoPP;
 
 #define module_name "modlib"
 
 string Modlib::GetMD5sum( string filename )
 {
-       int c;
-       int fd;
-       MHASH td;
-       unsigned char buffer[4096];
-       unsigned char *hash;
-       static char hash_string[33];
-       string hash_s;
-
-       td = mhash_init(MHASH_MD5);
-       
-       if (td == MHASH_FAILED) return("__unknown");
-
-       if ( (fd=open( filename.c_str(), O_RDONLY )) == -1 ) {
-               return("__unknown");
-       }
-       
-       while ( (c=read(fd, &buffer, 4096)) >0) {
-               mhash(td, &buffer, c);
-       }
-       
-       hash = (unsigned char *) mhash_end(td);
-
-       for ( unsigned int i = 0; i < mhash_get_block_size(MHASH_MD5); i++) {
-               sprintf(&hash_string[i*2], "%.2x", hash[i]);
-       }
-       
-       close(fd);
 
-       hash_s = hash_string;
+    MD5 hash;
+    byte buffer[2 * MD5::DIGESTSIZE];
+
+    FileSource f(filename.c_str(), true,
+             new HashFilter(hash,
+             new HexEncoder(new ArraySink(buffer,2 * MD5::DIGESTSIZE), 
false)));
 
-       return hash_s;
+    return string((const char*)buffer,2 * MD5::DIGESTSIZE);
 }
 
 string Modlib::GetMD5sum( istream &input )
 {
-       int c;
-       MHASH td;
-       unsigned char buffer[4096];
-       unsigned char *hash;
-       static char hash_string[33];
-       string hash_s;
-
-       td = mhash_init(MHASH_MD5);
-       
-       if (td == MHASH_FAILED) return("__unknown");
-
-       while ( input.get( (char*)buffer, 4096, '\0' ) ) {
-               c = input.gcount();
-               mhash(td, &buffer, c);
-       }
-       
-       hash = (unsigned char *) mhash_end(td);
-
-       for ( unsigned int i = 0; i < mhash_get_block_size(MHASH_MD5); i++) {
-               sprintf(&hash_string[i*2], "%.2x", hash[i]);
-       }
-
+    MD5 hash;
+    byte buffer[2 * MD5::DIGESTSIZE];
+    FileSource f(input, true, new HashFilter(hash, new HexEncoder(new 
ArraySink(buffer,2 * MD5::DIGESTSIZE), false)));
+    return string((const char*)buffer,2 * MD5::DIGESTSIZE);
 
-       hash_s = hash_string;
-       return hash_s;
 }
 
 int Modlib::CallHandler( string resource_type, string resource_name,
--- scpm-1.1.7.orig/src/libscpm/Makefile
+++ scpm-1.1.7/src/libscpm/Makefile
@@ -8,7 +8,7 @@ libscpm-schemes.so:     libscpm-schemes.c
                        gcc -g -o libscpm-schemes.so -I../../include -shared 
libscpm-schemes.c
 
 libscpm.so.$(LIBVERSION):      ../main ../modules ../scdb
-               g++ -shared -fPIC -o libscpm.so.$(LIBVERSION) -Xlinker 
--whole-archive ../main/libmain.a ../modules/libmodules.a ../scdb/libscdb.a 
-Xlinker -lmhash -Xlinker -call_shared -Xlinker --no-whole-archive 
-Wl,-soname,libscpm.so.$(APIVERSION)
+               g++ $(CXXFLAGS) -shared -fPIC -o libscpm.so.$(LIBVERSION) 
-Xlinker --whole-archive ../main/libmain.a ../modules/libmodules.a 
../scdb/libscdb.a -Xlinker -lcryptopp -Xlinker -call_shared -Xlinker 
--no-whole-archive -Wl,-soname,libscpm.so.$(APIVERSION)
                ln -sf libscpm.so.$(LIBVERSION) libscpm.so
 clean:
                rm -f libscpm.so.$(LIBVERSION) libscpm.o libscpm++.so 
libscpm-schemes.so libscpm.so
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to