[opengrm-ngram] New upstream release. Drop upstreamed -getpid patch. Hardcode HAVE_GSL into the headers so consumers

Jerry James jjames at fedoraproject.org
Fri Sep 6 14:39:48 UTC 2013


commit 068d2ee01abe6ab5333a784fb8fff4828e442c80
Author: Jerry James <jamesjer at betterlinux.com>
Date:   Fri Sep 6 08:39:14 2013 -0600

    New upstream release.
    Drop upstreamed -getpid patch.
    Hardcode HAVE_GSL into the headers so consumers do the right thing.

 .gitignore                  |    2 +-
 opengrm-ngram-getpid.patch  |   10 ----------
 opengrm-ngram-warning.patch |   22 +++++++++++-----------
 opengrm-ngram.spec          |   20 ++++++++++++++------
 sources                     |    4 ++--
 5 files changed, 28 insertions(+), 30 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 1c0b112..f0f2af5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,2 @@
-/opengrm-ngram-1.0.3.tar.gz
 /opengrm-ngram-man.tar.xz
+/opengrm-ngram-1.1.0.tar.gz
diff --git a/opengrm-ngram-warning.patch b/opengrm-ngram-warning.patch
index 8919b4e..f976bdd 100644
--- a/opengrm-ngram-warning.patch
+++ b/opengrm-ngram-warning.patch
@@ -1,5 +1,5 @@
---- ./src/bin/ngramapply.cc.orig	2012-03-26 07:45:53.000000000 -0600
-+++ ./src/bin/ngramapply.cc	2012-12-18 09:05:55.252919497 -0700
+--- ./src/bin/ngramapply.cc.orig	2013-08-12 15:14:39.000000000 -0600
++++ ./src/bin/ngramapply.cc	2013-09-05 13:11:36.000000000 -0600
 @@ -63,8 +63,10 @@ int main(int argc, char **argv) {
      type = EPS;
    else if (FLAGS_bo_arc_type == "lexicographic")
@@ -12,9 +12,9 @@
  
    // TODO(rws): This is temporary to avoid issues having to do with
    // symbol table compatibility. At some point we need to sanitize all
---- ./src/lib/ngram-output.cc.orig	2012-03-09 12:37:08.000000000 -0700
-+++ ./src/lib/ngram-output.cc	2012-12-18 09:06:26.268384488 -0700
-@@ -479,14 +479,11 @@ void NGramOutput::RandNGramModel(int64 s
+--- ./src/lib/ngram-output.cc.orig	2013-08-12 15:14:39.000000000 -0600
++++ ./src/lib/ngram-output.cc	2013-09-05 13:11:36.000000000 -0600
+@@ -520,14 +520,11 @@ void NGramOutput::RandNGramModel(int64 s
    for (int i = 0; i < 1000; ++i)  // a bit of burn-in
      rand(); // TODO(riley): huh?
    for (int sample = 0; sample < samples; ++sample) {
@@ -30,9 +30,9 @@
        st = GetAndShowSymbol(st, p, r, &hi_state,
  			    &first_printed, show_backoff);
      }
---- ./src/include/ngram/ngram-input.h.orig	2012-03-09 12:47:04.000000000 -0700
-+++ ./src/include/ngram/ngram-input.h	2012-12-18 09:05:55.253919512 -0700
-@@ -271,6 +271,7 @@ class NGramInput {
+--- ./src/include/ngram/ngram-input.h.orig	2013-08-12 15:14:38.000000000 -0600
++++ ./src/include/ngram/ngram-input.h	2013-09-05 13:11:36.000000000 -0600
+@@ -280,6 +280,7 @@ class NGramInput {
         return barc.nextstate;
       } else {
         LOG(FATAL) << "NGramInput: Lower order prefix n-gram not found: ";
@@ -40,7 +40,7 @@
       }
     }
  
-@@ -295,6 +296,7 @@ class NGramInput {
+@@ -304,6 +305,7 @@ class NGramInput {
         return ngram_counter->NGramStartState();
       } else if (endsym) {  // end symbol </s>
         LOG(FATAL) << "NGramInput: stop symbol occurred in n-gram prefix";
@@ -48,7 +48,7 @@
       } else {
         ssize_t arc_id = ngram_counter->FindArc(st, label);
         return ngram_counter->NGramNextState(arc_id);
-@@ -477,6 +479,7 @@ class NGramInput {
+@@ -489,6 +491,7 @@ class NGramInput {
       }
       if (!matcher.Find(0)) {
         LOG(FATAL) << "NGramInput: No backoff probability";
@@ -56,7 +56,7 @@
       }
       for (; !matcher.Done(); matcher.Next()) {
         StdArc arc = matcher.Value();
-@@ -485,6 +488,7 @@ class NGramInput {
+@@ -497,6 +500,7 @@ class NGramInput {
         }
       }
       LOG(FATAL) << "NGramInput: No backoff arc found";
diff --git a/opengrm-ngram.spec b/opengrm-ngram.spec
index 4cd9688..bbdd96e 100644
--- a/opengrm-ngram.spec
+++ b/opengrm-ngram.spec
@@ -1,6 +1,6 @@
 Name:           opengrm-ngram
-Version:        1.0.3
-Release:        3%{?dist}
+Version:        1.1.0
+Release:        1%{?dist}
 Summary:        Library for making and modifying n-gram language models
 
 License:        ASL 2.0
@@ -13,8 +13,6 @@ Source1:        %{name}-man.tar.xz
 # This patch will not be sent upstream, as it is gcc-specific.  Squelch
 # warnings that may indicate miscompiled code.
 Patch0:         %{name}-warning.patch
-# Patch sent upstream 18 Dec 2012.  Get a missing prototype for getpid().
-Patch1:         %{name}-getpid.patch
 
 BuildRequires:  gsl-devel
 BuildRequires:  openfst-devel
@@ -50,7 +48,6 @@ NGram library functionality.
 %setup -q
 %setup -q -T -D -a 1
 %patch0
-%patch1
 
 %build
 %configure CXXFLAGS="%{optflags} -DHAVE_GSL" LIBS="-lfst -lgsl"
@@ -59,7 +56,7 @@ NGram library functionality.
 # -Wl,--as-needed after all the libraries.
 sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
     -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
-    -e 's|CC="g..|& -Wl,--as-needed|' \
+    -e 's|CC=.g..|& -Wl,--as-needed|' \
     -i libtool
 
 make %{?_smp_mflags}
@@ -79,6 +76,12 @@ for f in *.1; do
 done
 cd ..
 
+# Let users know that we use GSL
+sed '/Faster multinomial sampling/a#define HAVE_GSL' \
+  %{buildroot}%{_includedir}/ngram/ngram-randgen.h > foo
+touch -r %{buildroot}%{_includedir}/ngram/ngram-randgen.h foo
+mv -f foo %{buildroot}%{_includedir}/ngram/ngram-randgen.h
+
 %check
 LD_LIBRARY_PATH=$PWD/src/lib/.libs make check
 
@@ -99,6 +102,11 @@ LD_LIBRARY_PATH=$PWD/src/lib/.libs make check
 %{_mandir}/man1/*
 
 %changelog
+* Fri Sep  6 2013 Jerry James <loganjerry at gmail.com> - 1.1.0-1
+- New upstream release
+- Drop upstreamed -getpid patch
+- Hardcode HAVE_GSL into the headers so consumers do the right thing
+
 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.0.3-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 
diff --git a/sources b/sources
index 3309189..038ffbd 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-03bc3e03b7106b3f135a65838324e7a9  opengrm-ngram-1.0.3.tar.gz
-fc429541e290ac9bd66c4391bf23430f  opengrm-ngram-man.tar.xz
+b0bf2c0a875ebc0ebf287b2872b3154c  opengrm-ngram-1.1.0.tar.gz
+9d61d533903f8232d9f39355b0962a5b  opengrm-ngram-man.tar.xz


More information about the scm-commits mailing list