diff --git a/Makefile.linux b/Makefile.linux index 330e2d7..8a62832 100644 --- a/Makefile.linux +++ b/Makefile.linux @@ -4,9 +4,9 @@ BINDIR=${PREFIX}/bin MANDIR=${PREFIX}/share/man build: - ${CC} ${CFLAGS} -D__unused= -D_GNU_SOURCE -D__USE_FILE_OFFSET64 \ + ${CC} ${CFLAGS} -D__cpdup_unused= -D_GNU_SOURCE -D__USE_FILE_OFFSET64 \ -DNOMD5 -c *.c - ${CC} ${CFLAGS} -D__unused= -D_GNU_SOURCE -D__USE_FILE_OFFSET64 \ + ${CC} ${CFLAGS} -D__cpdup_unused= -D_GNU_SOURCE -D__USE_FILE_OFFSET64 \ -DNOMD5 *.o -o cpdup install: diff --git a/cpdup-1.11-explicit_sizes.patch b/cpdup-1.11-explicit_sizes.patch new file mode 100644 index 0000000..42819ae --- /dev/null +++ b/cpdup-1.11-explicit_sizes.patch @@ -0,0 +1,85 @@ +--- cpdup-1.11/hcproto.c.explicit_sizes 2008-05-22 19:34:41.000000000 -0400 ++++ cpdup-1.11/hcproto.c 2008-06-11 14:40:46.000000000 -0400 +@@ -336,7 +336,7 @@ + struct HCHead *head; + struct HCLeaf *item; + struct dirent *den; +- int desc = 0; ++ size_t desc = 0; + + if (hc == NULL || hc->host == NULL) + return(opendir(path)); +@@ -355,7 +355,7 @@ + } + } + if (hcc_get_descriptor(hc, desc, HC_DESC_DIR)) { +- fprintf(stderr, "hc_opendir: remote reused active descriptor %d\n", ++ fprintf(stderr, "hc_opendir: remote reused active descriptor %zd\n", + desc); + return(NULL); + } +@@ -406,12 +406,12 @@ + return(readdir(dir)); + + trans = hcc_start_command(hc, HC_READDIR); +- hcc_leaf_int32(trans, LC_DESCRIPTOR, (int)dir); ++ hcc_leaf_int32(trans, LC_DESCRIPTOR, (size_t)dir); + if ((head = hcc_finish_command(trans)) == NULL) + return(NULL); + if (head->error) + return(NULL); /* XXX errno */ +- den = hcc_get_descriptor(hc, (int)dir, HC_DESC_DIR); ++ den = hcc_get_descriptor(hc, (size_t)dir, HC_DESC_DIR); + if (den == NULL) + return(NULL); /* XXX errno */ + if (den->d_name) +@@ -476,13 +476,13 @@ + + if (hc == NULL || hc->host == NULL) + return(closedir(dir)); +- den = hcc_get_descriptor(hc, (int)dir, HC_DESC_DIR); ++ den = hcc_get_descriptor(hc, (size_t)dir, HC_DESC_DIR); + if (den) { + free(den); +- hcc_set_descriptor(hc, (int)dir, NULL, HC_DESC_DIR); ++ hcc_set_descriptor(hc, (size_t)dir, NULL, HC_DESC_DIR); + + trans = hcc_start_command(hc, HC_CLOSEDIR); +- hcc_leaf_int32(trans, LC_DESCRIPTOR, (int)dir); ++ hcc_leaf_int32(trans, LC_DESCRIPTOR, (size_t)dir); + if ((head = hcc_finish_command(trans)) == NULL) + return(-1); + if (head->error) +--- cpdup-1.11/cpdup.c.explicit_sizes 2008-05-24 13:21:36.000000000 -0400 ++++ cpdup-1.11/cpdup.c 2008-06-11 14:49:59.000000000 -0400 +@@ -304,7 +304,7 @@ + * make any required connections. + */ + if (src && (ptr = strchr(src, ':')) != NULL) { +- asprintf(&SrcHost.host, "%*.*s", ptr - src, ptr - src, src); ++ asprintf(&SrcHost.host, "%*.*s", (int)(ptr - src), (int)(ptr - src), src); + src = ptr + 1; + if (UseCpFile) { + fprintf(stderr, "The cpignore options are not currently supported for remote sources\n"); +@@ -318,7 +318,7 @@ + exit(1); + } + if (dst && (ptr = strchr(dst, ':')) != NULL) { +- asprintf(&DstHost.host, "%*.*s", ptr - dst, ptr - dst, dst); ++ asprintf(&DstHost.host, "%*.*s", (int)(ptr - dst), (int)(ptr - dst), dst); + dst = ptr + 1; + if (UseFSMIDOpt) { + fprintf(stderr, "The FSMID options are not currently supported for remote targets\n"); +--- cpdup-1.11/fsmid.c.explicit_sizes 2008-05-22 19:05:08.000000000 -0400 ++++ cpdup-1.11/fsmid.c 2008-06-11 15:07:50.000000000 -0400 +@@ -35,8 +35,8 @@ + + for (node = FSMIDBase; node; node = node->fid_Next) { + if (node->fid_Accessed && node->fid_Code) { +- fprintf(fo, "%016llx %d %s\n", +- node->fid_Code, ++ fprintf(fo, "%016llx %zd %s\n", ++ (long long unsigned)node->fid_Code, + strlen(node->fid_Name), + node->fid_Name + ); diff --git a/cpdup-1.11-unused.patch b/cpdup-1.11-unused.patch new file mode 100644 index 0000000..bfd1d5d --- /dev/null +++ b/cpdup-1.11-unused.patch @@ -0,0 +1,148 @@ +--- cpdup-1.11/hcproto.c.unused 2008-06-11 15:08:19.000000000 -0400 ++++ cpdup-1.11/hcproto.c 2008-06-11 15:44:51.000000000 -0400 +@@ -143,7 +143,7 @@ + } + + static int +-rc_hello(hctransaction_t trans, struct HCHead *head __unused) ++rc_hello(hctransaction_t trans, struct HCHead *head __cpdup_unused) + { + char hostbuf[256]; + +@@ -879,7 +879,7 @@ + } + + static int +-rc_remove(hctransaction_t trans __unused, struct HCHead *head) ++rc_remove(hctransaction_t trans __cpdup_unused, struct HCHead *head) + { + struct HCLeaf *item; + const char *path = NULL; +@@ -900,7 +900,7 @@ + * MKDIR + */ + int +-hc_mkdir(struct HostConf *hc __unused, const char *path, mode_t mode) ++hc_mkdir(struct HostConf *hc __cpdup_unused, const char *path, mode_t mode) + { + hctransaction_t trans; + struct HCHead *head; +@@ -919,7 +919,7 @@ + } + + static int +-rc_mkdir(hctransaction_t trans __unused, struct HCHead *head) ++rc_mkdir(hctransaction_t trans __cpdup_unused, struct HCHead *head) + { + struct HCLeaf *item; + const char *path = NULL; +@@ -962,7 +962,7 @@ + } + + static int +-rc_rmdir(hctransaction_t trans __unused, struct HCHead *head) ++rc_rmdir(hctransaction_t trans __cpdup_unused, struct HCHead *head) + { + struct HCLeaf *item; + const char *path = NULL; +@@ -1003,7 +1003,7 @@ + } + + static int +-rc_chown(hctransaction_t trans __unused, struct HCHead *head) ++rc_chown(hctransaction_t trans __cpdup_unused, struct HCHead *head) + { + struct HCLeaf *item; + const char *path = NULL; +@@ -1052,7 +1052,7 @@ + } + + static int +-rc_lchown(hctransaction_t trans __unused, struct HCHead *head) ++rc_lchown(hctransaction_t trans __cpdup_unused, struct HCHead *head) + { + struct HCLeaf *item; + const char *path = NULL; +@@ -1100,7 +1100,7 @@ + } + + static int +-rc_chmod(hctransaction_t trans __unused, struct HCHead *head) ++rc_chmod(hctransaction_t trans __cpdup_unused, struct HCHead *head) + { + struct HCLeaf *item; + const char *path = NULL; +@@ -1145,7 +1145,7 @@ + } + + static int +-rc_mknod(hctransaction_t trans __unused, struct HCHead *head) ++rc_mknod(hctransaction_t trans __cpdup_unused, struct HCHead *head) + { + struct HCLeaf *item; + const char *path = NULL; +@@ -1193,7 +1193,7 @@ + } + + static int +-rc_link(hctransaction_t trans __unused, struct HCHead *head) ++rc_link(hctransaction_t trans __cpdup_unused, struct HCHead *head) + { + struct HCLeaf *item; + const char *name1 = NULL; +@@ -1238,7 +1238,7 @@ + } + + static int +-rc_chflags(hctransaction_t trans __unused, struct HCHead *head) ++rc_chflags(hctransaction_t trans __cpdup_unused, struct HCHead *head) + { + struct HCLeaf *item; + const char *path = NULL; +@@ -1394,7 +1394,7 @@ + } + + static int +-rc_symlink(hctransaction_t trans __unused, struct HCHead *head) ++rc_symlink(hctransaction_t trans __cpdup_unused, struct HCHead *head) + { + struct HCLeaf *item; + const char *name1 = NULL; +@@ -1438,7 +1438,7 @@ + } + + static int +-rc_rename(hctransaction_t trans __unused, struct HCHead *head) ++rc_rename(hctransaction_t trans __cpdup_unused, struct HCHead *head) + { + struct HCLeaf *item; + const char *name1 = NULL; +@@ -1483,7 +1483,7 @@ + } + + static int +-rc_utimes(hctransaction_t trans __unused, struct HCHead *head) ++rc_utimes(hctransaction_t trans __cpdup_unused, struct HCHead *head) + { + struct HCLeaf *item; + struct timeval times[2]; +--- cpdup-1.11/hclink.c.unused 2008-05-24 13:21:36.000000000 -0400 ++++ cpdup-1.11/hclink.c 2008-06-11 15:44:30.000000000 -0400 +@@ -77,7 +77,7 @@ + } + + static int +-rc_badop(hctransaction_t trans __unused, struct HCHead *head) ++rc_badop(hctransaction_t trans __cpdup_unused, struct HCHead *head) + { + head->error = EOPNOTSUPP; + return(0); +@@ -353,7 +353,7 @@ + } + + void +-hcc_free_trans(struct HostConf *hc __unused) ++hcc_free_trans(struct HostConf *hc __cpdup_unused) + { + /* nop */ + } diff --git a/cpdup.spec b/cpdup.spec index 5796deb..e4f887d 100644 --- a/cpdup.spec +++ b/cpdup.spec @@ -1,6 +1,6 @@ Name: cpdup Version: 1.11 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Filesystem mirroring utility Group: Applications/Archiving @@ -8,13 +8,10 @@ License: BSD URL: http://apollo.backplane.com/FreeSrc/ Source0: http://apollo.backplane.com/FreeSrc/cpdup-%{version}.tgz Source1: Makefile.linux +Patch0: cpdup-1.11-explicit_sizes.patch +Patch1: cpdup-1.11-unused.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -# bz# 435508: cpdup not 64-bit clean -ExcludeArch: x86_64 -# bz# 435508 -ExcludeArch: ppc64 - #BuildRequires: #Requires: @@ -33,6 +30,8 @@ destination directory with a file. %prep %setup -q -n %{name} +%patch0 -p1 -b .explicit_sizes +%patch1 -p1 -b .unused rm md5.c @@ -52,13 +51,16 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) -%doc +%doc BACKUPS %{_bindir}/* %{_mandir}/man1/* %changelog +* Wed Jun 11 2008 Michel Alexandre Salim - 1.11-2 +- Fix build problems with GLIBC on 64-bit archs + * Thu Jun 5 2008 Michel Alexandre Salim - 1.11-1 - Update to 1.11