urpmi.patch 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. Index: URPM-3.07/Makefile.PL
  2. --- URPM-3.07/Makefile.PL.orig 2007-12-10 12:15:00 +0100
  3. +++ URPM-3.07/Makefile.PL 2008-01-12 10:38:25 +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.07/URPM.xs
  85. --- URPM-3.07/URPM.xs.orig 2008-01-08 12:13:16 +0100
  86. +++ URPM-3.07/URPM.xs 2008-01-12 10:38:25 +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. @@ -65,6 +65,10 @@
  96. #include <rpm/rpmbuild.h>
  97. #include <rpm/rpmlog.h>
  98. +#ifndef RPMSENSE_MISSINGOK
  99. +#define RPMSENSE_MISSINGOK 0
  100. +#endif
  101. +
  102. struct s_Package {
  103. char *info;
  104. char *requires;
  105. Index: rpmtools-5.3.5/Makefile.PL
  106. --- rpmtools-5.3.5/Makefile.PL.orig 2007-12-18 15:17:25 +0100
  107. +++ rpmtools-5.3.5/Makefile.PL 2008-01-12 10:38:25 +0100
  108. @@ -35,8 +35,8 @@
  109. RPMTOOLSVERSION => $rpmtools_version,
  110. FROMC => 'parsehdlist rpm2header #rpm-find-leaves',
  111. FROMCC => '#gendepslist2 hdlist2names hdlist2files hdlist2prereq hdlist2groups',
  112. - LIBRPM => '-lrpm -lrpmio -lrpmdb -lrpmbuild -lz -lbz2 -lpopt',
  113. - INCRPM => '-I/usr/include/rpm',
  114. + LIBRPM => `openpkg rpm-config --ldflags --libs`,
  115. + INCRPM => `openpkg rpm-config --cflags --cppflags`,
  116. },
  117. depend => {
  118. clean_subdirs => 'cleanc',
  119. @@ -49,7 +49,7 @@
  120. C => [],
  121. OBJECT => '',
  122. CCFLAGS => '-Wall',
  123. - OPTIMIZE => '-O3 -fomit-frame-pointer -fno-exceptions -pipe -s -ffast-math -fexpensive-optimizations',
  124. + OPTIMIZE => '-O2',
  125. INC => '',
  126. LIBS => [ '' ],
  127. INSTALLDIRS => 'vendor',
  128. Index: rpmtools-5.3.5/parsehdlist.c
  129. --- rpmtools-5.3.5/parsehdlist.c.orig 2007-06-22 13:46:09 +0200
  130. +++ rpmtools-5.3.5/parsehdlist.c 2008-01-12 10:38:25 +0100
  131. @@ -7,6 +7,7 @@
  132. #include <unistd.h>
  133. #include <signal.h>
  134. #include <errno.h>
  135. +#include <rpm/glob.h>
  136. #include <rpm/rpmlib.h>
  137. #include <rpm/header.h>
  138. #include <stdio.h>
  139. Index: rpmtools-5.3.5/rpm2header.c
  140. --- rpmtools-5.3.5/rpm2header.c.orig 2007-12-17 13:50:16 +0100
  141. +++ rpmtools-5.3.5/rpm2header.c 2008-01-12 10:38:25 +0100
  142. @@ -5,7 +5,8 @@
  143. #include <sys/stat.h>
  144. #include <fcntl.h>
  145. #include <unistd.h>
  146. -#include <rpmlib.h>
  147. +#include <rpm/glob.h>
  148. +#include <rpm/rpmlib.h>
  149. #include <rpm/rpmts.h>
  150. #define FILENAME_TAG 1000000
  151. Index: urpmi-5.0/Makefile.PL
  152. --- urpmi-5.0/Makefile.PL.orig 2007-12-04 14:50:05 +0100
  153. +++ urpmi-5.0/Makefile.PL 2008-01-12 10:38:25 +0100
  154. @@ -60,6 +60,7 @@
  155. my $po = $with_po ? ' installpo' : '';
  156. my $gui = $with_gui ? ' installgurpmi2' : '';
  157. $inherited =~ s/^install ::/$& installconfigfiles installstatedir$po$gui/gm;
  158. + $inherited =~ s/^pure_install ::/$& installconfigfiles installstatedir$po$gui/gm;
  159. $inherited;
  160. }
  161. @@ -101,10 +102,10 @@
  162. install -m 644 inst.list skip.list \$(SYSCONFDIR)/urpmi
  163. installstatedir:
  164. - install -d \$(LOCALSTATEDIR)/urpmi
  165. - install -d \$(DESTDIR)/var/cache/urpmi/partial
  166. - install -d \$(DESTDIR)/var/cache/urpmi/headers
  167. - install -d \$(DESTDIR)/var/cache/urpmi/rpms
  168. + install -d \$(LOCALSTATEDIR)/urpmi/lib
  169. + install -d \$(DESTDIR)/\$(PREFIX)/var/urpmi/cache/partial
  170. + install -d \$(DESTDIR)/\$(PREFIX)/var/urpmi/cache/headers
  171. + install -d \$(DESTDIR)/\$(PREFIX)/var/urpmi/cache/rpms
  172. installgurpmi2: pure_install
  173. ln -s -f consolehelper \$(DESTINSTALLSCRIPT)/gurpmi2
  174. @@ -146,8 +147,8 @@
  175. INST_MAN5DIR => 'blib/man5',
  176. INST_MAN8DIR => 'blib/man8',
  177. # We could read those values from rpm macros.
  178. - SYSCONFDIR => '$(DESTDIR)/etc',
  179. - LOCALSTATEDIR => '$(DESTDIR)/var/lib',
  180. + SYSCONFDIR => '$(DESTDIR)$(PREFIX)/etc',
  181. + LOCALSTATEDIR => '$(DESTDIR)$(PREFIX)/var',
  182. },
  183. EXE_FILES => [ @bin_scripts, @sbin_scripts ],
  184. PMLIBDIRS => [ qw(urpm) ],
  185. Index: urpmi-5.0/urpm/sys.pm
  186. --- urpmi-5.0/urpm/sys.pm.orig 2007-10-02 14:01:03 +0200
  187. +++ urpmi-5.0/urpm/sys.pm 2008-01-12 10:38:25 +0100
  188. @@ -114,7 +114,7 @@
  189. }
  190. sub proc_mounts() {
  191. - my @l = cat_('/proc/mounts') or warn "Can't read /proc/mounts: $!\n";
  192. + my @l = (-f '/proc/mounts' ? cat_('/proc/mounts') : ());
  193. @l;
  194. }