diff options
author | Aaron M. Ucko <ucko@debian.org> | 2018-04-25 19:05:18 -0400 |
---|---|---|
committer | Aaron M. Ucko <ucko@debian.org> | 2018-04-25 19:44:03 -0400 |
commit | e5ffa05f49c88972fc7c2ede0585f08f300eaeb1 (patch) | |
tree | 33d0422264116da30bdd3ed2060e2962c6e661ec | |
parent | 56e4718818e8dc4ea5ba6348402fc7661863732a (diff) |
Initial Debian release (v0.0~git20150829.56e4718-1; closes #896712).debian/0.0_git20150829.56e4718-1
* Generally base on dh-make-golang's template (v0.0~git20180410.bcfd5bf-1)
and upstream's full history (all six commits of it).
* Produce two binary packages: golang-github-dataence-porter2-dev
(architecture all) for the library code, and suffixfsm (architecture
any) for the eponymous tool.
* .gitignore: Ignore obj-* (build tree) in addition to .pc (Quilt state).
* debian/*.docs: Install relevant README.md files.
* debian/.gitignore: Ignore generated files and directories under debian.
* debian/control: Base both binary packages' descriptions on the relevant
README.md files.
* debian/g-g-d-p-d.{dirs,links}: Make the library additionally available
under its old name, github.com/surgebase/porter2, for the sake of client
code that expects that name (notably, in recent ncbi-entrez-direct).
* debian/{man,suffixfsm.manpages}: Give suffixfsm a brief man page based
on its README.md.
* debian/patches: Formally port porter2_test.go from github.com/surge/glog
(not in Debian) to github.com/golang/glog, which should be close enough,
even if the port does entail having to substitute Infof for Debugf.
* debian/rules:
- Exclude cmd/compare -- no point in packaging rival implementations
just to demonstrate that they're slower!
- Install output.txt and voc.txt for use by porter2_test.go.
* debian/suffixfsm.examples: cmd/suffixfsm/step*.txt.
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | debian/.gitignore | 7 | ||||
-rw-r--r-- | debian/changelog | 5 | ||||
-rw-r--r-- | debian/compat | 1 | ||||
-rw-r--r-- | debian/control | 35 | ||||
-rw-r--r-- | debian/copyright | 30 | ||||
-rw-r--r-- | debian/gbp.conf | 2 | ||||
-rw-r--r-- | debian/golang-github-dataence-porter2-dev.dirs | 1 | ||||
-rw-r--r-- | debian/golang-github-dataence-porter2-dev.docs | 1 | ||||
-rw-r--r-- | debian/golang-github-dataence-porter2-dev.install | 1 | ||||
-rw-r--r-- | debian/golang-github-dataence-porter2-dev.links | 1 | ||||
-rw-r--r-- | debian/man/suffixfsm.1 | 15 | ||||
-rw-r--r-- | debian/patches/0001-porter2_test.go-Formally-port-from-surge-glog-to-gol.patch | 136 | ||||
-rw-r--r-- | debian/patches/series | 1 | ||||
-rwxr-xr-x | debian/rules | 7 | ||||
-rw-r--r-- | debian/source/format | 1 | ||||
-rw-r--r-- | debian/suffixfsm.docs | 1 | ||||
-rw-r--r-- | debian/suffixfsm.examples | 1 | ||||
-rw-r--r-- | debian/suffixfsm.install | 1 | ||||
-rw-r--r-- | debian/suffixfsm.manpages | 1 | ||||
-rw-r--r-- | debian/watch | 4 |
21 files changed, 255 insertions, 0 deletions
@@ -36,3 +36,6 @@ _testmain.go *.sublime-project *.sublime-workspace + +.pc +obj-* diff --git a/debian/.gitignore b/debian/.gitignore new file mode 100644 index 0000000..83619d5 --- /dev/null +++ b/debian/.gitignore @@ -0,0 +1,7 @@ +*.substvars +.debhelper +debhelper-build-stamp +files +golang-github-dataence-porter2-dev +suffixfsm +tmp diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..405e70d --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +golang-github-dataence-porter2 (0.0~git20150829.56e4718-1) unstable; urgency=medium + + * Initial release (Closes: #896712.) + + -- Aaron M. Ucko <ucko@debian.org> Wed, 25 Apr 2018 19:05:17 -0400 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..b4de394 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +11 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..ffd8bfd --- /dev/null +++ b/debian/control @@ -0,0 +1,35 @@ +Source: golang-github-dataence-porter2 +Section: devel +Priority: optional +Maintainer: Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org> +Uploaders: Aaron M. Ucko <ucko@debian.org> +Build-Depends: debhelper (>= 11), + dh-golang, + golang-any, + golang-glog-dev, + golang-github-stretchr-testify-dev +Standards-Version: 4.1.4 +Homepage: https://github.com/dataence/porter2 +Vcs-Browser: https://salsa.debian.org/med-team/packages/golang-github-dataence-porter2 +Vcs-Git: https://salsa.debian.org/med-team/packages/golang-github-dataence-porter2.git +XS-Go-Import-Path: github.com/dataence/porter2 +Testsuite: autopkgtest-pkg-go + +Package: golang-github-dataence-porter2-dev +Architecture: all +Depends: ${misc:Depends} +Description: native Go high-performance Porter2 stemmer for English + Porter2 implements the Porter2 stemmer for English. It is written + completely using finite state machines to do suffix comparison, + rather than slower string-based or tree-based approaches. + . + This package also arranges to support usage under its historical + upstream name, github.com/surgebase/porter2. + +Package: suffixfsm +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends} +Built-Using: ${misc:Built-Using} +Description: Go finite state machine generator for Porter2 stemmers + Suffixfsm generates Go finite state machines implementing the Porter2 + stemming algorithm, as found in golang-github-dataence-porter2-dev. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..afe97be --- /dev/null +++ b/debian/copyright @@ -0,0 +1,30 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: porter2 +Source: https://github.com/dataence/porter2 +Files-Excluded: + Godeps/_workspace + +Files: * +Copyright: 2014, 2015 Dataence, LLC <zhenjl@gmail.com> +License: Apache-2.0 + +Files: debian/* +Copyright: 2018 Aaron M. Ucko <ucko@debian.org> +License: Apache-2.0 +Comment: Debian packaging is licensed under the same terms as upstream + +License: Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian systems, the complete text of the Apache version 2.0 license + can be found in "/usr/share/common-licenses/Apache-2.0". diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 0000000..cec628c --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,2 @@ +[DEFAULT] +pristine-tar = True diff --git a/debian/golang-github-dataence-porter2-dev.dirs b/debian/golang-github-dataence-porter2-dev.dirs new file mode 100644 index 0000000..1987972 --- /dev/null +++ b/debian/golang-github-dataence-porter2-dev.dirs @@ -0,0 +1 @@ +usr/share/gocode/src/github.com/surgebase diff --git a/debian/golang-github-dataence-porter2-dev.docs b/debian/golang-github-dataence-porter2-dev.docs new file mode 100644 index 0000000..b43bf86 --- /dev/null +++ b/debian/golang-github-dataence-porter2-dev.docs @@ -0,0 +1 @@ +README.md diff --git a/debian/golang-github-dataence-porter2-dev.install b/debian/golang-github-dataence-porter2-dev.install new file mode 100644 index 0000000..a3da66d --- /dev/null +++ b/debian/golang-github-dataence-porter2-dev.install @@ -0,0 +1 @@ +usr/share/gocode diff --git a/debian/golang-github-dataence-porter2-dev.links b/debian/golang-github-dataence-porter2-dev.links new file mode 100644 index 0000000..63fb44d --- /dev/null +++ b/debian/golang-github-dataence-porter2-dev.links @@ -0,0 +1 @@ +usr/share/gocode/src/github.com/dataence/porter2 usr/share/gocode/src/github.com/surgebase/porter2 diff --git a/debian/man/suffixfsm.1 b/debian/man/suffixfsm.1 new file mode 100644 index 0000000..76f7d44 --- /dev/null +++ b/debian/man/suffixfsm.1 @@ -0,0 +1,15 @@ +.TH SUFFIXFSM 1 2018-04-25 DATAENCE "Dataence Porter2 User's Manual" +.SH NAME +suffixfsm \- generate a Go finite state machine for Porter2 stemming +.SH SYNOPSIS +\fBsuffixfsm\fP +\fIfilename\fP +.SH DESCRIPTION +\fBsuffixfsm\fP takes a list of suffixes, creates a tree, +and then generates a FSM based on the tree. + +The output (on standard output) is a skeleton Go function body. +.SH OPTIONS +.TP +\fIfilename\fP +Input suffix list. diff --git a/debian/patches/0001-porter2_test.go-Formally-port-from-surge-glog-to-gol.patch b/debian/patches/0001-porter2_test.go-Formally-port-from-surge-glog-to-gol.patch new file mode 100644 index 0000000..74347e9 --- /dev/null +++ b/debian/patches/0001-porter2_test.go-Formally-port-from-surge-glog-to-gol.patch @@ -0,0 +1,136 @@ +From: "Aaron M. Ucko" <ucko@debian.org> +Date: Tue, 24 Apr 2018 19:45:54 -0400 +Subject: porter2_test.go: Formally port from surge/glog to golang/glog. + +Replace Debugf, which golang/glog lacks, with Infof, which should be +close enough for this test's purposes. (There's no Debian package for +surge/glog, and no point in bothering to make one for one private test.) +--- + porter2_test.go | 28 ++++++++++++++-------------- + 1 file changed, 14 insertions(+), 14 deletions(-) + +diff --git a/porter2_test.go b/porter2_test.go +index d0d8df3..847f76f 100644 +--- a/porter2_test.go ++++ b/porter2_test.go +@@ -23,7 +23,7 @@ import ( + "testing" + + "github.com/stretchr/testify/assert" +- "github.com/surge/glog" ++ "github.com/golang/glog" + ) + + var ( +@@ -324,7 +324,7 @@ var ( + func TestEnglishStep0(t *testing.T) { + + for i, rs := range data0 { +- //glog.Debugf("rs=%q, expected=%q", string(rs), string(expect[i])) ++ //glog.Infof("rs=%q, expected=%q", string(rs), string(expect[i])) + assert.Equal(t, step0(rs), expect0[i]) + } + } +@@ -333,7 +333,7 @@ func TestEnglishStep1a(t *testing.T) { + + for i, rs := range data1a { + assert.Equal(t, step1a(rs), expect1a[i]) +- //glog.Debugf("rs=%q, expected=%q, got=%q", string(rs), string(expect1a[i]), string(s)) ++ //glog.Infof("rs=%q, expected=%q, got=%q", string(rs), string(expect1a[i]), string(s)) + } + } + +@@ -341,7 +341,7 @@ func TestEnglishStep1b(t *testing.T) { + + for i, rs := range data1b { + r1, _ := markR1R2(rs) +- //glog.Debugf("rs=%q, expected=%q, r1=%d", string(rs), string(expect1b[i]), r1) ++ //glog.Infof("rs=%q, expected=%q, r1=%d", string(rs), string(expect1b[i]), r1) + s := step1b(rs, r1) + assert.Equal(t, s, expect1b[i]) + } +@@ -350,7 +350,7 @@ func TestEnglishStep1b(t *testing.T) { + func TestEnglishStep1c(t *testing.T) { + + for i, rs := range data1c { +- //glog.Debugf("rs=%q, expected=%q, got=%q", string(rs), string(expect1c[i]), string(step1c(rs))) ++ //glog.Infof("rs=%q, expected=%q, got=%q", string(rs), string(expect1c[i]), string(step1c(rs))) + assert.Equal(t, step1c(rs), expect1c[i]) + } + } +@@ -360,7 +360,7 @@ func TestEnglishStep2(t *testing.T) { + for i, rs := range data2 { + r1, _ := markR1R2(rs) + s := step2(rs, r1) +- //glog.Debugf("rs=%q, expected=%q, got=%q, r1=%d", string(rs), string(expect2[i]), string(s), r1) ++ //glog.Infof("rs=%q, expected=%q, got=%q, r1=%d", string(rs), string(expect2[i]), string(s), r1) + assert.Equal(t, s, expect2[i]) + } + } +@@ -370,7 +370,7 @@ func TestEnglishStep3(t *testing.T) { + for i, rs := range data3 { + r1, r2 := markR1R2(rs) + s := step3(rs, r1, r2) +- //glog.Debugf("rs=%q, expected=%q, got=%q, r1=%d", string(rs), string(expect3[i]), string(s), r1) ++ //glog.Infof("rs=%q, expected=%q, got=%q, r1=%d", string(rs), string(expect3[i]), string(s), r1) + assert.Equal(t, s, expect3[i]) + } + } +@@ -380,7 +380,7 @@ func TestEnglishStep4(t *testing.T) { + for i, rs := range data4 { + _, r2 := markR1R2(rs) + s := step4(rs, r2) +- //glog.Debugf("rs=%q, expected=%q, got=%q, r1=%d, r2=%d", string(rs), string(expect4[i]), string(s), r1, r2) ++ //glog.Infof("rs=%q, expected=%q, got=%q, r1=%d, r2=%d", string(rs), string(expect4[i]), string(s), r1, r2) + assert.Equal(t, s, expect4[i]) + } + } +@@ -390,7 +390,7 @@ func TestEnglishStep5(t *testing.T) { + for i, rs := range data5 { + r1, r2 := markR1R2(rs) + s := step5(rs, r1, r2) +- //glog.Debugf("rs=%q, expected=%q, got=%q, r1=%d, r2=%d", string(rs), string(expect5[i]), string(s), r1, r2) ++ //glog.Infof("rs=%q, expected=%q, got=%q, r1=%d, r2=%d", string(rs), string(expect5[i]), string(s), r1, r2) + assert.Equal(t, s, expect5[i]) + } + } +@@ -398,7 +398,7 @@ func TestEnglishStep5(t *testing.T) { + func TestEnglishMarkR1R2(t *testing.T) { + for i, rs := range dataRegions { + r1, r2 := markR1R2(rs) +- //glog.Debugf("rs = %v, expected = %v, got = %v", rs, expectRegions[i], []int{r1, r2}) ++ //glog.Infof("rs = %v, expected = %v, got = %v", rs, expectRegions[i], []int{r1, r2}) + assert.Equal(t, expectRegions[i], []int{r1, r2}) + } + +@@ -408,7 +408,7 @@ func TestEnglishIsShortWord(t *testing.T) { + for s, v := range shortWords { + rs := []rune(s) + r1, _ := markR1R2(rs) +- //glog.Debugf("rs=%q, r1=%d", s, r1) ++ //glog.Infof("rs=%q, r1=%d", s, r1) + assert.Equal(t, v, isShortWord(rs, r1)) + } + } +@@ -417,7 +417,7 @@ func TestEnglishExceptions1(t *testing.T) { + + for k, v := range exceptions1 { + rs, ex := exception1([]rune(k)) +- //glog.Debugf("rs=%q, expected=%q, got=%q", k, v, string(rs)) ++ //glog.Infof("rs=%q, expected=%q, got=%q", k, v, string(rs)) + assert.True(t, ex) + assert.Equal(t, []rune(v), rs) + } +@@ -484,10 +484,10 @@ func TestEnglishVocOutput(t *testing.T) { + + word := inscan.Text() + expect := outscan.Text() +- //glog.Debugf("word=%q, expect=%q", word, expect) ++ //glog.Infof("word=%q, expect=%q", word, expect) + actual := Stem(word) + if actual != expect { +- glog.Debugf("word=%q, actual=%q != expect=%q", word, actual, expect) ++ glog.Infof("word=%q, actual=%q != expect=%q", word, actual, expect) + } + assert.Equal(t, expect, actual) + } diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..c69e9a6 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +0001-porter2_test.go-Formally-port-from-surge-glog-to-gol.patch diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..ca6ca1b --- /dev/null +++ b/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f + +export DH_GOLANG_EXCLUDES = cmd/compare +export DH_GOLANG_INSTALL_EXTRA = output.txt voc.txt + +%: + dh $@ --buildsystem=golang --with=golang diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/suffixfsm.docs b/debian/suffixfsm.docs new file mode 100644 index 0000000..6f2aa0f --- /dev/null +++ b/debian/suffixfsm.docs @@ -0,0 +1 @@ +cmd/suffixfsm/README.md diff --git a/debian/suffixfsm.examples b/debian/suffixfsm.examples new file mode 100644 index 0000000..b40888c --- /dev/null +++ b/debian/suffixfsm.examples @@ -0,0 +1 @@ +cmd/suffixfsm/step*.txt diff --git a/debian/suffixfsm.install b/debian/suffixfsm.install new file mode 100644 index 0000000..097140c --- /dev/null +++ b/debian/suffixfsm.install @@ -0,0 +1 @@ +usr/bin/suffixfsm diff --git a/debian/suffixfsm.manpages b/debian/suffixfsm.manpages new file mode 100644 index 0000000..f3fc506 --- /dev/null +++ b/debian/suffixfsm.manpages @@ -0,0 +1 @@ +debian/man/suffixfsm.1 diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..2d5dbfe --- /dev/null +++ b/debian/watch @@ -0,0 +1,4 @@ +version=3 +opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/golang-github-dataence-porter2-\$1\.tar\.gz/,\ +uversionmangle=s/(\d)[_\.\-\+]?(RC|rc|pre|dev|beta|alpha)[.]?(\d*)$/\$1~\$2\$3/ \ + https://github.com/dataence/porter2/tags .*/v?(\d\S*)\.tar\.gz |