Debian packages are currently released as part of Apertium, so this page is not so relevant any more

HFST: Debian Releasing on HFST computer

Back-end libraries

We currently include OpenFst and foma back-ends in the debian release. SFST is excluded because it uses =hash_map=s and =hash_set=s that are not a part of standard c++. Their implementation is platform-dependent and they are not portable. Future solution would be to use unorderd_map and unordered_set, but that requires switch -std=c++0x when compiling, which causes problems when using OpenFst.

The tool hfst-xfst requires --with-readline if we wish to use automatic completion of commands and command history in interactive mode, but it will make the debian release depend on libreadline library. Currently the debian release doesn't use readline.

Making the debian package (64-bit and 32-bit releases)

Update and copy files

Make sure that there is a fresh tarball of HFST hfst-x.y.z.tar.gz in directory hfst3, i.e. make dist has been run. Go to directory debian. Copy hfst-x.y.z.tar.gz there and extract it (to directory hfst-x.y.z).

If you want to include hfst-ospell in the Debian release, extract a fresh hfstospell tarball to the same directory.

Go to debian/debian-test and edit files debian/DEBIAN/control, debian/DEBIAN/shlibs, debian/usr/share/doc/hfst-dev/changelog.Debian and debian/usr/share/doc/hfst-dev/copyright and commit these changes to trunk. Note that if you include hfst-ospell in the relase, you need to list

tinyxml2, libarchive (>= 3) 
as dependencies and
libhfstospell 4
in shlibs.

Go to directory debian/debian-swig and edit files debian/DEBIAN/control, debian/usr/share/doc/HFSTPY-DEV/changelog.Debian and debian/usr/share/doc/HFSTPY-DEV/copyright and commit these changes to trunk.

Go to debian and run

./ --hfstdir hfst-x.y.z

to copy all relevant files to the 32-bit system of hfst machine. The above script will copy directories debian-test, debian-swig and hfst-x.y.z under /mnt/i386/home/username/debian-release/debian/ (and delete old contents of /mnt/i386/home/username/debian-release). Note that you must copy hfstospell and directory manually.

Open a new terminal window for making a 32-bit release and execute in it

sudo chroot /mnt/i386/
cd /home/username/debian-release/

Make the release

In both windows, execute in directory debian

./ --hfst-srcdir hfst-x.y.z --hfst-instdir hfst-installation
(./ --ospell-srcdir hfstospell-x.y.z --ospell-instdir ospell-installation)

The above script will call make with the right configurations in directory hfst-x.y.z and install hfst to hfst-installation (and the same for hfstospell). You can comment the hfst-ospell.1 parts from if help2man does not work properly. Make sure that there are no local directories named in the scripts in hfst-installation with grep USERNAME.

Then run

./ debian-test debian-test-copy &&
./ debian-swig debian-swig-copy

to make a copy of debian-test and debian-swig without the .svn files. Continue with

cd debian-test-copy && ./ --hfst-dir /full-path-to/debian/hfst-installation/ (--ospell-dir /full-path-to/debian/ospell-installation) &&
cd ../debian-swig-copy && ./ --python2 --hfst-dir /full-path-to/debian/hfst-x.y.z/swig/  && 
./make-debian-package --python3 --hfst-dir /full-path-to/debian/hfst-x.y.z/swig/

At the end, you will have files hfst-dev_Y.Z-1_ARCH.deb, hfstpy2-dev_Y.Z-1_ARCH.deb and hfstpy3-dev_Y.Z-1_ARCH.deb where ARCH is amd64 or i386. Copy these files to sourceforge.

scp FILENAME username,

Warnings, errors and issues that must be handled

32-bit side of the HFST machine

Python 3.1.3 is the default python3. version 3.2.5 must be called as python3.2. It is manually compiled with option --with-wide-unicode.

Package making

The script leaks errors of type elf_open: Exec format error when testing if programs are strippable.

Unicode package

For --unicode-backend=icu, the package libicu-dev (on debian and ubuntu) must be listed as a depend.

dpkg-shlibdeps: error: no dependency information found for /usr/local/lib/ (used by debian/usr/bin/hfst-omor-evaluate).

Can we leave this tool out from the package?

W: hfst-dev: package-name-doesnt-match-sonames libfoma0 libfst0 libhfst12 libhfstlexc0 libhfstospell1 libsfst0


W: hfst-dev: new-package-should-close-itp-bug

"This package appears to be the first packaging of a new upstream software package (there is only one changelog entry and the Debian revision is 1), but it does not close any bugs. The initial upload of a new package should close the corresponding ITP bug for that package."

This warning can be ignored if the package is not intended for Debian or if it is a split of an existing Debian package.

See for details.


W: hfst-dev: script-with-language-extension usr/bin/

When scripts are installed into a directory in the system PATH, the script name should not include an extension such as .sh or .pl 
that denotes the scripting language currently used to implement it. The implementation language may change; if it does, 
leaving the name the same would be confusing and changing it would be disruptive.

Could we change the name of the script to hfst-foma-wrapper?

W: hfst-dev: manpage-has-useless-whatis-entry

The whatis entry for this manual page (the brief description found in the NAME section) is of the form:

     program - manual page for program

This conveys no information about what the program is for and is repetitive. The short description should contain 
brief information about what the program is for to aid in searching with apropos and similar programs.

If this manpage was generated by help2man, use the -n option to provide a more meaningful description.

W: hfst-dev: manpage-has-errors-from-man

This man page provokes warnings or errors from man.

"cannot adjust" or "can't break" are trouble with paragraph filling, usually related to long lines. 
Adjustment can be helped by left justifying, breaks can be helped with hyphenation, 
see "Manipulating Filling and Adjusting" and "Manipulating Hyphenation" in the manual.

"can't find numbered character" usually means latin1 etc in the input, and this warning indicates characters will be missing from the output. 
You can change to escapes like \[:a] described on the groff_char man page.

Other warnings are often formatting typos, like missing quotes around a string argument to .IP. 
These are likely to result in lost or malformed output. See the groff_man (or groff_mdoc if using mdoc) man page for information on macros.

This test uses man's --warnings option to enable groff warnings that catch common mistakes, such as putting . or ' characters 
at the start of a line when they are intended as literal text rather than groff commands. 
This can be fixed either by reformatting the paragraph so that these characters are not at the start of a line, 
or by adding a zero-width space (\&) immediately before them.

At worst, warning messages can be disabled with the .warn directive, see "Debugging" in the groff manual.

To test this for yourself you can use the following command:

     LC_ALL=en_US.UTF-8 MANWIDTH=80 man --warnings -E UTF-8 -l <file> >/dev/null

W: hfst-dev: binary-without-manpage

Each binary in /usr/bin, /usr/sbin, /bin, /sbin or /usr/games should have a manual page

Note that though the man program has the capability to check for several program names in the NAMES section, 
each of these programs should have its own manual page (a symbolic link to the appropriate manual page is sufficient) 
because other manual page viewers such as xman or tkman don't support this.

If the name of the man page differs from the binary by case, man may be able to find it anyway; 
however, it is still best practice to make the case of the man page match the case of the binary.

If the man pages are provided by another package on which this package depends, 
lintian may not be able to determine that man pages are available. 
In this case, after confirming that all binaries do have man pages after this package and its dependencies are installed, 
please add a lintian override.

Installing from Apertium

The stable debian packages are distributed as a part of Apertium in

The command

lsb_release -a
might be helpful when finding out the right package. It will e.g. print something like

 No LSB modules are available.
 Distributor ID: Ubuntu
 Description:    Ubuntu 12.04.4 LTS
 Release:        12.04
 Codename:       precise

In the example case, the line Codename shows that the right package is of form *~precise_*.deb.

The command file /usr/bin/file is one way to check whether your system is 64-bit or 32-bit. It will print something like:

/usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked ...

In the case above, a package ending in amd64 is the right choice.

There are three kinds of packages:

name description dependencies on other hfst packages
hfst hfst command line tools and their man pages libhfst39
libhfst39-dev header files of hfst library libhfst39
libhfst39 the hfst library none

Installing the packages is done with dpkg:

 dpkg --install libhfst39_***.deb
 dpkg --install libhfst-dev_3.8.1***.deb
 dpkg --install hfst_***.deb

-- ErikAxelson - 2012-02-03
Topic revision: r34 - 2015-06-11 - ErikAxelson
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback