urpmi.patch 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. Index: URPM-3.01/Makefile.PL
  2. --- URPM-3.01/Makefile.PL.orig 2007-12-10 12:15:00 +0100
  3. +++ URPM-3.01/Makefile.PL 2007-12-11 19:39:03 +0100
  4. @@ -1,69 +1,7 @@
  5. use strict;
  6. use ExtUtils::MakeMaker;
  7. -# where to find the rpm utility
  8. -
  9. -my $rpm_path = $ENV{RPM_PATH}; # this overrides
  10. -
  11. -unless (defined $rpm_path) {
  12. - for (qw(/bin/rpm /usr/bin/rpm)) {
  13. - if (-x) {
  14. - $rpm_path = $_;
  15. - last;
  16. - }
  17. - }
  18. -}
  19. -
  20. -defined $rpm_path or die "Can't find rpm on this system\n";
  21. -
  22. -my $version = `LC_ALL=C $rpm_path --version`;
  23. -chomp $version;
  24. -$version =~ s/RPM version //;
  25. -my $pversion = eval "v$version";
  26. -$pversion ge v4.2 or die "Unable to build URPM with too old (or undetected) rpm version $version\n";
  27. -
  28. -# to generate the ChangeLog depending on the checkout layout
  29. -my $commonusername = "../common/";
  30. --d $commonusername or do {
  31. - $commonusername = "../../common/";
  32. - -d $commonusername or do {
  33. - $commonusername = "../../../common/";
  34. - -d $commonusername or $commonusername = "";
  35. - };
  36. -};
  37. -
  38. -sub MY::postamble {
  39. - <<"**MM**";
  40. -.PHONY: ChangeLog
  41. -
  42. -ChangeLog:
  43. - LC_ALL=C svn2cl --accum --strip-prefix=soft/rpm/perl-URPM/trunk --authors ${commonusername}username.xml
  44. - rm -f *.bak
  45. -**MM**
  46. -}
  47. -
  48. -my @rpmflags;
  49. -if ($pversion ge v4.4.90 && $pversion lt v4.5) {
  50. - # rpm.org version
  51. - push @rpmflags, '-DRPM_ORG';
  52. -} else {
  53. - # rpm5.org version
  54. - if ($pversion ge v4.4.5) {
  55. - push @rpmflags, '-DRPM_CALLBACK_LONGLONG';
  56. - }
  57. - if ($pversion ge v4.4.6) {
  58. - push @rpmflags, '-DRPM_446';
  59. - }
  60. - if ($pversion ge v4.4.8) {
  61. - push @rpmflags, '-DRPM_448';
  62. - }
  63. - if ($pversion ge v4.5) {
  64. - push @rpmflags, '-DRPM_450';
  65. - }
  66. -}
  67. -my $ccflags = join(' ', '-Wall -fno-strict-aliasing', @rpmflags);
  68. -
  69. -print "Found RPM version $version (compiling with flags: $ccflags)\n";
  70. +my $ccflags = '-fno-strict-aliasing';
  71. WriteMakefile(
  72. NAME => 'URPM',
  73. @@ -72,8 +10,8 @@
  74. },
  75. CCFLAGS => $ccflags,
  76. VERSION_FROM => 'URPM.pm',
  77. - LIBS => [ '-lrpm -lrpmio -lrpmdb -lrpmbuild -lpopt -lz' ],
  78. - INC => '-I/usr/include/rpm',
  79. + LIBS => [ `openpkg rpm-config --ldflags --libs` ],
  80. + INC => `openpkg rpm-config --cflags --cppflags`,
  81. dist => { COMPRESS => "bzip2", SUFFIX => ".bz2" },
  82. realclean => { FILES => "t/RPMS/noarch/*" },
  83. );
  84. Index: URPM-3.01/URPM.xs
  85. --- URPM-3.01/URPM.xs.orig 2007-12-11 11:01:06 +0100
  86. +++ URPM-3.01/URPM.xs 2007-12-11 19:38:21 +0100
  87. @@ -22,7 +22,7 @@
  88. #include <fcntl.h>
  89. #include <unistd.h>
  90. #include <zlib.h>
  91. -#include <libintl.h>
  92. +#include <glob.h>
  93. #undef Fflush
  94. #undef Mkdir
  95. @@ -297,6 +297,9 @@
  96. static int has_suggests;
  97. int is_suggests(int_32 flags) {
  98. +#ifndef RPMSENSE_MISSINGOK
  99. +#define RPMSENSE_MISSINGOK 0
  100. +#endif
  101. int is = flags & RPMSENSE_MISSINGOK;
  102. if (is) has_suggests = is;
  103. return is;
  104. Index: rpmtools-5.3.2/Makefile.PL
  105. --- rpmtools-5.3.2/Makefile.PL.orig 2007-06-22 16:31:50 +0200
  106. +++ rpmtools-5.3.2/Makefile.PL 2007-12-11 19:38:21 +0100
  107. @@ -35,8 +35,8 @@
  108. RPMTOOLSVERSION => $rpmtools_version,
  109. FROMC => 'parsehdlist rpm2header #rpm-find-leaves',
  110. FROMCC => '#gendepslist2 hdlist2names hdlist2files hdlist2prereq hdlist2groups',
  111. - LIBRPM => '-lrpm -lrpmio -lrpmdb -lrpmbuild -lz -lbz2 -lpopt',
  112. - INCRPM => '-I/usr/include/rpm',
  113. + LIBRPM => `openpkg rpm-config --ldflags --libs`,
  114. + INCRPM => `openpkg rpm-config --cflags --cppflags`,
  115. },
  116. depend => {
  117. clean_subdirs => 'cleanc',
  118. @@ -49,7 +49,7 @@
  119. C => [],
  120. OBJECT => '',
  121. CCFLAGS => '-Wall',
  122. - OPTIMIZE => '-O3 -fomit-frame-pointer -fno-exceptions -pipe -s -ffast-math -fexpensive-optimizations',
  123. + OPTIMIZE => '-O2',
  124. INC => '',
  125. LIBS => [ '' ],
  126. INSTALLDIRS => 'vendor',
  127. Index: rpmtools-5.3.2/parsehdlist.c
  128. --- rpmtools-5.3.2/parsehdlist.c.orig 2007-06-22 13:46:09 +0200
  129. +++ rpmtools-5.3.2/parsehdlist.c 2007-12-11 19:38:21 +0100
  130. @@ -7,6 +7,7 @@
  131. #include <unistd.h>
  132. #include <signal.h>
  133. #include <errno.h>
  134. +#include <rpm/glob.h>
  135. #include <rpm/rpmlib.h>
  136. #include <rpm/header.h>
  137. #include <stdio.h>
  138. Index: rpmtools-5.3.2/rpm2header.c
  139. --- rpmtools-5.3.2/rpm2header.c.orig 2007-06-15 09:24:49 +0200
  140. +++ rpmtools-5.3.2/rpm2header.c 2007-12-11 19:38:21 +0100
  141. @@ -5,7 +5,8 @@
  142. #include <sys/stat.h>
  143. #include <fcntl.h>
  144. #include <unistd.h>
  145. -#include <rpmlib.h>
  146. +#include <rpm/glob.h>
  147. +#include <rpm/rpmlib.h>
  148. #include <rpm/rpmts.h>
  149. #define FILENAME_TAG 1000000
  150. Index: urpmi-4.10.18/Makefile.PL
  151. --- urpmi-4.10.18/Makefile.PL.orig 2007-12-04 14:50:05 +0100
  152. +++ urpmi-4.10.18/Makefile.PL 2007-12-11 19:38:21 +0100
  153. @@ -60,6 +60,7 @@
  154. my $po = $with_po ? ' installpo' : '';
  155. my $gui = $with_gui ? ' installgurpmi2' : '';
  156. $inherited =~ s/^install ::/$& installconfigfiles installstatedir$po$gui/gm;
  157. + $inherited =~ s/^pure_install ::/$& installconfigfiles installstatedir$po$gui/gm;
  158. $inherited;
  159. }
  160. @@ -101,10 +102,10 @@
  161. install -m 644 inst.list skip.list \$(SYSCONFDIR)/urpmi
  162. installstatedir:
  163. - install -d \$(LOCALSTATEDIR)/urpmi
  164. - install -d \$(DESTDIR)/var/cache/urpmi/partial
  165. - install -d \$(DESTDIR)/var/cache/urpmi/headers
  166. - install -d \$(DESTDIR)/var/cache/urpmi/rpms
  167. + install -d \$(LOCALSTATEDIR)/urpmi/lib
  168. + install -d \$(DESTDIR)/\$(PREFIX)/var/urpmi/cache/partial
  169. + install -d \$(DESTDIR)/\$(PREFIX)/var/urpmi/cache/headers
  170. + install -d \$(DESTDIR)/\$(PREFIX)/var/urpmi/cache/rpms
  171. installgurpmi2: pure_install
  172. ln -s -f consolehelper \$(DESTINSTALLSCRIPT)/gurpmi2
  173. @@ -146,8 +147,8 @@
  174. INST_MAN5DIR => 'blib/man5',
  175. INST_MAN8DIR => 'blib/man8',
  176. # We could read those values from rpm macros.
  177. - SYSCONFDIR => '$(DESTDIR)/etc',
  178. - LOCALSTATEDIR => '$(DESTDIR)/var/lib',
  179. + SYSCONFDIR => '$(DESTDIR)$(PREFIX)/etc',
  180. + LOCALSTATEDIR => '$(DESTDIR)$(PREFIX)/var',
  181. },
  182. EXE_FILES => [ @bin_scripts, @sbin_scripts ],
  183. PMLIBDIRS => [ qw(urpm) ],
  184. Index: urpmi-4.10.18/urpm/sys.pm
  185. --- urpmi-4.10.18/urpm/sys.pm.orig 2007-10-02 14:01:03 +0200
  186. +++ urpmi-4.10.18/urpm/sys.pm 2007-12-11 19:38:21 +0100
  187. @@ -114,7 +114,7 @@
  188. }
  189. sub proc_mounts() {
  190. - my @l = cat_('/proc/mounts') or warn "Can't read /proc/mounts: $!\n";
  191. + my @l = (-f '/proc/mounts' ? cat_('/proc/mounts') : ());
  192. @l;
  193. }