urpmi.patch 5.6 KB

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