Explorar o código

pastime: fix building

Ralf S. Engelschall %!s(int64=23) %!d(string=hai) anos
pai
achega
823f97a93e
Modificáronse 3 ficheiros con 63 adicións e 7 borrados
  1. 12 0
      htdig/htdig.patch
  2. 43 0
      htdig/htdig.patch.pl
  3. 8 7
      htdig/htdig.spec

+ 12 - 0
htdig/htdig.patch

@@ -171,3 +171,15 @@
  
  #if !defined(DBL_MAX) && defined(MAXFLOAT)
  # define DBL_MAX MAXFLOAT
+--- htsearch/htsearch.cc.orig	Fri Feb 23 01:31:35 2001
++++ htsearch/htsearch.cc	Fri Jun 13 09:09:20 2003
+@@ -315,8 +315,7 @@
+     String      doc_index = config["doc_index"];
+     if (access((char*)doc_index, R_OK) < 0)
+     {
+-        reportError(form("Unable to read document index file '%s'\nDid you run h
+-tmerge?",
++        reportError(form("Unable to read document index file '%s'\nDid you run htmerge?",
+                          doc_index.get()));
+     }     
+ 

+ 43 - 0
htdig/htdig.patch.pl

@@ -0,0 +1,43 @@
+##
+##  C/C++ multiline string literal breaking utility
+##
+
+use IO;
+
+#   read in C/C++ source
+my $file = $ARGV[0];
+my $io = new IO::File "<$file";
+my $src = '';
+$src .= $_ while <$io>;
+$io->close;
+
+#   process C/C++ source
+my $done = ''; my $this = ''; my $todo = $src;
+my $inside = 0;
+while ($todo =~ m/([\\"i]|\r?\n)/s) {
+    $done .= $`; $this = $&; $todo = $';
+    my $char = $1;
+    if ($char eq '\\') {
+        #   escaped character
+        $this .= substr($todo, 0, 1);
+        $todo =  substr($todo, 1);
+    }
+    elsif ($char eq '"') {
+        #   toggle "inside string" mode
+        $inside = !($inside);
+    }
+    elsif ($char =~ m|^\r?\n$|s) {
+        #   in "inside string" mode, break string
+        if ($inside) {
+            $this = "\\n\"" . $this . "\"";
+        }
+    }
+    $done .= $this;
+}
+$src = $done;
+
+#   write out C/C++ source
+$io = new IO::File ">$file";
+$io->print($src);
+$io->close;
+

+ 8 - 7
htdig/htdig.spec

@@ -33,16 +33,17 @@ Distribution: OpenPKG [PLUS]
 Group:        Web
 License:      GPL
 Version:      3.2.0b3
-Release:      20030117
+Release:      20030613
 
 #   list of sources
 Source0:      http://www.htdig.org/files/htdig-%{version}.tar.gz
+Source1:      htdig.patch.pl
 Patch0:       htdig.patch
 
 #   build information
 Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
-BuildPreReq:  OpenPKG, openpkg >= 20021204, make, flex, zlib, gcc
+BuildPreReq:  OpenPKG, openpkg >= 20021204, make, flex, zlib, gcc, perl
 PreReq:       OpenPKG, openpkg >= 20021204
 AutoReq:      no
 AutoReqProv:  no
@@ -61,14 +62,14 @@ AutoReqProv:  no
 %prep
     %setup -q
     %patch -p0
+    %{l_prefix}/bin/perl %{SOURCE htdig.patch.pl} htcommon/defaults.cc
 
 %build
     CC="%{l_cc}" \
-    CXX="%{l_cxx}" \
-    CFLAGS="%{l_cflags -O} -Wno-deprecated" \
-    CPPFLAGS="%{l_cppflags} -Wno-deprecated" \
-    CXXFLAGS="%{l_cxxflags -O} -Wno-deprecated" \
-    CXXFLAGS="%{l_cxxflags -O} -Wno-deprecated" \
+    CXX="%{l_cxx} -Wno-deprecated" \
+    CPPFLAGS="%{l_cppflags}" \
+    CFLAGS="%{l_cflags -O}" \
+    CXXFLAGS="%{l_cxxflags -O}" \
     ./configure \
         --prefix=%{l_prefix} \
         --with-config-dir=%{l_prefix}/etc/htdig \