- fix build with gcc-4.3

This commit is contained in:
Stanislav Ievlev 2008-12-12 16:40:05 +03:00
parent dcb817f3ff
commit d20fc76a4d
2 changed files with 211 additions and 3 deletions

View File

@ -0,0 +1,205 @@
diff -Naur apt-0.5.15lorg2.orig/apt-pkg/contrib/cdromutl.cc apt-0.5.15lorg2/apt-pkg/contrib/cdromutl.cc
--- apt-0.5.15lorg2.orig/apt-pkg/contrib/cdromutl.cc 2008-12-12 16:11:53 +0300
+++ apt-0.5.15lorg2/apt-pkg/contrib/cdromutl.cc 2008-12-12 16:21:25 +0300
@@ -35,6 +35,7 @@
#include <unistd.h>
#include <stdio.h>
#include <mntent.h>
+#include <cstdlib>
/*}}}*/
// IsMounted - Returns true if the mount point is mounted /*{{{*/
diff -Naur apt-0.5.15lorg2.orig/apt-pkg/contrib/error.cc apt-0.5.15lorg2/apt-pkg/contrib/error.cc
--- apt-0.5.15lorg2.orig/apt-pkg/contrib/error.cc 2008-09-01 22:42:04 +0400
+++ apt-0.5.15lorg2/apt-pkg/contrib/error.cc 2008-12-12 16:21:25 +0300
@@ -26,6 +26,7 @@
#include <string>
#include <stdarg.h>
#include <unistd.h>
+#include <cstring>
#include "config.h"
/*}}}*/
diff -Naur apt-0.5.15lorg2.orig/apt-pkg/contrib/fileutl.cc apt-0.5.15lorg2/apt-pkg/contrib/fileutl.cc
--- apt-0.5.15lorg2.orig/apt-pkg/contrib/fileutl.cc 2008-09-01 22:42:04 +0400
+++ apt-0.5.15lorg2/apt-pkg/contrib/fileutl.cc 2008-12-12 16:21:25 +0300
@@ -30,6 +30,8 @@
#include <sys/wait.h>
#include <signal.h>
#include <errno.h>
+#include <cstdlib>
+#include <cstring>
// CNC:2003-02-14 - Ralf Corsepius told RH8 with GCC 3.2.1 fails
// compiling without moving this header to here.
diff -Naur apt-0.5.15lorg2.orig/apt-pkg/contrib/md5.h apt-0.5.15lorg2/apt-pkg/contrib/md5.h
--- apt-0.5.15lorg2.orig/apt-pkg/contrib/md5.h 2008-09-01 22:42:04 +0400
+++ apt-0.5.15lorg2/apt-pkg/contrib/md5.h 2008-12-12 16:21:25 +0300
@@ -28,6 +28,7 @@
#endif
#include <string>
+#include <cstring>
using std::string;
diff -Naur apt-0.5.15lorg2.orig/apt-pkg/contrib/mmap.cc apt-0.5.15lorg2/apt-pkg/contrib/mmap.cc
--- apt-0.5.15lorg2.orig/apt-pkg/contrib/mmap.cc 2008-09-01 22:42:04 +0400
+++ apt-0.5.15lorg2/apt-pkg/contrib/mmap.cc 2008-12-12 16:21:25 +0300
@@ -35,6 +35,7 @@
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
+#include <cstring>
/*}}}*/
// MMap::MMap - Constructor /*{{{*/
diff -Naur apt-0.5.15lorg2.orig/apt-pkg/contrib/progress.cc apt-0.5.15lorg2/apt-pkg/contrib/progress.cc
--- apt-0.5.15lorg2.orig/apt-pkg/contrib/progress.cc 2008-09-01 22:42:04 +0400
+++ apt-0.5.15lorg2/apt-pkg/contrib/progress.cc 2008-12-12 16:21:25 +0300
@@ -19,6 +19,7 @@
#include <iostream>
#include <stdio.h>
+#include <cstring>
/*}}}*/
using namespace std;
diff -Naur apt-0.5.15lorg2.orig/apt-pkg/contrib/sha1.h apt-0.5.15lorg2/apt-pkg/contrib/sha1.h
--- apt-0.5.15lorg2.orig/apt-pkg/contrib/sha1.h 2008-09-01 22:42:04 +0400
+++ apt-0.5.15lorg2/apt-pkg/contrib/sha1.h 2008-12-12 16:21:25 +0300
@@ -19,6 +19,7 @@
#endif
#include <string>
+#include <cstring>
using std::string;
diff -Naur apt-0.5.15lorg2.orig/apt-pkg/contrib/strutl.h apt-0.5.15lorg2/apt-pkg/contrib/strutl.h
--- apt-0.5.15lorg2.orig/apt-pkg/contrib/strutl.h 2008-09-01 22:42:04 +0400
+++ apt-0.5.15lorg2/apt-pkg/contrib/strutl.h 2008-12-12 16:21:25 +0300
@@ -25,6 +25,7 @@
#include <vector>
#include <iostream>
#include <time.h>
+#include <cstring>
using std::string;
using std::vector;
diff -Naur apt-0.5.15lorg2.orig/apt-pkg/contrib/system.h apt-0.5.15lorg2/apt-pkg/contrib/system.h
--- apt-0.5.15lorg2.orig/apt-pkg/contrib/system.h 2008-09-01 22:42:04 +0400
+++ apt-0.5.15lorg2/apt-pkg/contrib/system.h 2008-12-12 16:21:25 +0300
@@ -27,8 +27,8 @@
// GNU C++ has a min/max operator <coolio>
#if defined(__GNUG__)
-#define MIN(A,B) ((A) <? (B))
-#define MAX(A,B) ((A) >? (B))
+#define MIN(A,B) std::min(A,B)
+#define MAX(A,B) std::max(A,B)
#endif
/* Templates tend to mess up existing code that uses min/max because of the
diff -Naur apt-0.5.15lorg2.orig/apt-pkg/indexfile.cc apt-0.5.15lorg2/apt-pkg/indexfile.cc
--- apt-0.5.15lorg2.orig/apt-pkg/indexfile.cc 2008-09-01 22:42:04 +0400
+++ apt-0.5.15lorg2/apt-pkg/indexfile.cc 2008-12-12 16:21:25 +0300
@@ -14,6 +14,7 @@
#include <apt-pkg/indexfile.h>
#include <apt-pkg/error.h>
+#include <cstring>
/*}}}*/
// Global list of Item supported
diff -Naur apt-0.5.15lorg2.orig/apt-pkg/init.cc apt-0.5.15lorg2/apt-pkg/init.cc
--- apt-0.5.15lorg2.orig/apt-pkg/init.cc 2008-12-12 16:11:54 +0300
+++ apt-0.5.15lorg2/apt-pkg/init.cc 2008-12-12 16:21:25 +0300
@@ -20,6 +20,8 @@
// CNC:2003-03-17
#include <apt-pkg/luaiface.h>
+#include <cstring>
+#include <cstdlib>
/*}}}*/
#define Stringfy_(x) # x
diff -Naur apt-0.5.15lorg2.orig/apt-pkg/pkgcachegen.h apt-0.5.15lorg2/apt-pkg/pkgcachegen.h
--- apt-0.5.15lorg2.orig/apt-pkg/pkgcachegen.h 2008-09-01 22:42:04 +0400
+++ apt-0.5.15lorg2/apt-pkg/pkgcachegen.h 2008-12-12 16:21:25 +0300
@@ -59,7 +59,7 @@
public:
// CNC:2003-02-27 - We need this in rpmListParser.
- bool NewPackage(pkgCache::PkgIterator &Pkg,string Pkg);
+ bool NewPackage(pkgCache::PkgIterator &PkgI,string Pkg);
unsigned long WriteUniqString(const char *S,unsigned int Size);
inline unsigned long WriteUniqString(string S) {return WriteUniqString(S.c_str(),S.length());};
diff -Naur apt-0.5.15lorg2.orig/apt-pkg/pkgrecords.cc apt-0.5.15lorg2/apt-pkg/pkgrecords.cc
--- apt-0.5.15lorg2.orig/apt-pkg/pkgrecords.cc 2008-12-12 16:11:53 +0300
+++ apt-0.5.15lorg2/apt-pkg/pkgrecords.cc 2008-12-12 16:21:25 +0300
@@ -18,6 +18,7 @@
#include <apt-pkg/configuration.h>
#include <apti18n.h>
+#include <cstring>
/*}}}*/
// Records::pkgRecords - Constructor /*{{{*/
diff -Naur apt-0.5.15lorg2.orig/apt-pkg/pkgsystem.cc apt-0.5.15lorg2/apt-pkg/pkgsystem.cc
--- apt-0.5.15lorg2.orig/apt-pkg/pkgsystem.cc 2008-09-01 22:42:04 +0400
+++ apt-0.5.15lorg2/apt-pkg/pkgsystem.cc 2008-12-12 16:21:25 +0300
@@ -16,6 +16,7 @@
#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/policy.h>
+#include <cstring>
/*}}}*/
pkgSystem *_system = 0;
diff -Naur apt-0.5.15lorg2.orig/apt-pkg/rpm/rpmmisc.h apt-0.5.15lorg2/apt-pkg/rpm/rpmmisc.h
--- apt-0.5.15lorg2.orig/apt-pkg/rpm/rpmmisc.h 2008-09-01 22:42:04 +0400
+++ apt-0.5.15lorg2/apt-pkg/rpm/rpmmisc.h 2008-12-12 16:21:39 +0300
@@ -4,6 +4,7 @@
#ifdef WITH_GNU_HASH_MAP
#include <ext/hash_map>
+#include <cstring>
using namespace __gnu_cxx;
diff -Naur apt-0.5.15lorg2.orig/apt-pkg/rpm/rpmpackagedata.h apt-0.5.15lorg2/apt-pkg/rpm/rpmpackagedata.h
--- apt-0.5.15lorg2.orig/apt-pkg/rpm/rpmpackagedata.h 2008-12-12 16:11:53 +0300
+++ apt-0.5.15lorg2/apt-pkg/rpm/rpmpackagedata.h 2008-12-12 16:22:03 +0300
@@ -8,6 +8,7 @@
#include <map>
#include <vector>
#include <regex.h>
+#include <cstring>
using namespace std;
diff -Naur apt-0.5.15lorg2.orig/apt-pkg/rpm/rpmpm.cc apt-0.5.15lorg2/apt-pkg/rpm/rpmpm.cc
--- apt-0.5.15lorg2.orig/apt-pkg/rpm/rpmpm.cc 2008-12-12 16:11:54 +0300
+++ apt-0.5.15lorg2/apt-pkg/rpm/rpmpm.cc 2008-12-12 16:21:25 +0300
@@ -33,6 +33,7 @@
#include <errno.h>
#include <stdio.h>
#include <iostream>
+#include <cstring>
#if RPM_VERSION >= 0x040100
#include <rpm/rpmdb.h>
diff -Naur apt-0.5.15lorg2.orig/apt-pkg/rpm/rpmrecords.cc apt-0.5.15lorg2/apt-pkg/rpm/rpmrecords.cc
--- apt-0.5.15lorg2.orig/apt-pkg/rpm/rpmrecords.cc 2008-12-12 16:11:54 +0300
+++ apt-0.5.15lorg2/apt-pkg/rpm/rpmrecords.cc 2008-12-12 16:21:25 +0300
@@ -25,6 +25,8 @@
#include <apti18n.h>
+#include <cstring>
+
// RecordParser::rpmRecordParser - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */

View File

@ -67,6 +67,7 @@ Patch55: apt-0.5.15lorg2-alt-manifest.patch
Patch56: apt-0.5.15lorg2-lorg-pkgcachegen-selfprov.patch
Patch57: apt-0.5.15lorg2-alt-genpkglist-no-fileflags.patch
Patch58: apt-0.5.15lorg2-lorg-cache-limit.patch
Patch59: apt-0.5.15lorg2-alt-gcc4.3.patch
# Normally not applied, but useful.
Patch101: apt-0.5.4cnc9-alt-getsrc-debug.patch
@ -106,7 +107,7 @@ Group: Development/C
Requires: libapt-devel = %version-%release, librpm-devel-static >= 4.0.4-alt28
%package utils
Summary: Utilities to create APT repositories (the indices)
Summary: Utilities to create APT repositaries (the indices)
Summary(ru_RU.KOI8-R): õÔÉÌÉÔÙ ÄÌÑ ÐÏÓÔÒÏÅÎÉÑ APT-ÒÅÐÏÚÉÔÏÒÉÅ× (ÉÎÄÅËÓÏ×)
Group: Development/Other
Requires: %name = %version-%release, mktemp >= 1:1.3.1, getopt
@ -161,7 +162,7 @@ package manipulation library, modified for RPM.
%risk_usage_en
%description utils
This package contains the utility programs that can prepare a repository of
This package contains the utility programs that can prepare a repositary of
RPMS binary and source packages for future access by APT (by generating
the indices): genbasedir, genpkglist, gensrclist.
@ -265,6 +266,7 @@ This package contains method 'rsync' for APT.
%patch56 -p1
%patch57 -p1
%patch58 -p1
%patch59 -p1
find -type f -name \*.orig -delete
@ -294,7 +296,8 @@ autoreconf -fisv
find -type f -print0 |
xargs -r0 grep -EZl '/var(/lib)?/state/apt' -- |
xargs -r0 %__subst -p 's,/var\(/lib\)\?/state/apt,%_localstatedir/%name,g' --
%make_build
#_make_build
%make
%install
mkdir -p %buildroot%_sysconfdir/%name/{%name.conf,sources.list,vendors.list}.d