How to Build Ubuntu Package for Graphviz

I’m trying to build my own graphviz package using latest stable source as .deb for Ubuntu. The official instructions for packaging contain an error in the basic example so are not usable currently.

I only want the bare minimum dependencies to support Radare2, so just libgd and libpango. The build and install process used below works flawlessly using standard make install. But the checkinstall process that replaces make install results in a package that fails with an error after the package is installed on a new VM.

/usr/local/bin/dot: error while loading shared libraries: libgvc.so.6: cannot open shared object file: No such file or directory

I do see what the problem is here, but I am unsure how to correct for this in the packaging process.

I’m trying checkinstall:
https://help.ubuntu.com/community/CheckInstall

Using the following process for building the package:

apt install build-essential libgd-dev libpango1.0-dev checkinstall
wget https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/2.49.3/graphviz-2.49.3.tar.gz
tar -zxvf graphviz-2.49.3.tar.gz
cd graphviz-2.49.3
./configure
make
checkinstall

Inside checkinstall these are the settings:

Should I create a default set of package docs? No
Description:
Graphviz with minimum dependencies required for Radare2 (libgd and libpango).

Maintainer: [ root@example[.]com ]
Summary: [ Graphviz with minimum dependencies required for Radare2 (libgd and libpango). ]
Name: [ graphviz ]
Version: [ 2.49.3 ]
Release: [ 1 ]
License: [ GPL ]
Group: [ checkinstall ]
Architecture: [ amd64 ]
Source location: [ https[://]gitlab[.]com/api/v4/projects/4207231/packages/generic/graphviz-releases/2.49.3/graphviz-2.49.3.tar.gz ]
Requires: [ libgd3,libpango1.0-0 ]
Provides: [ graphviz ]

Some of the files created by the installation are inside the build
directory: /root/graphviz-2.49.3
Should I exclude them from the package? Yes

If you just want to build Graphviz for your own personal use (not to distribute the .deb), you may want to follow the procedure in the developers guide minus the autogen.sh step which is only necessary if you’re building from a repository checkout. It lets you install Graphviz to a custom directory. You’ll then need to use the env prefix in the section after that for running it, but you can wrap this up in a script.

Thanks! I’m working on a project that will deploy to a large number of worker VMs. The speed of using a .deb package is ideal, but I will likely need to script a build from source until I sort out packaging.

Ah I see. In that case, you probably want to look at the steps ci/build.sh does.