checkinstall
Track the local installation of a software package, and produce a binary package which can be used with a system's native package manager. tldr-pages
On Linux
Linux
Create and install a package with default settings
sudo checkinstall --defaultIdentifyCreate a package but don't install it
sudo checkinstall --install=noIdentifyCreate a package without documentation
sudo checkinstall --nodocIdentifyCreate a package and set the name
sudo checkinstall --pkgname packageIdentifyCreate a package and specify where to save it
sudo checkinstall --pakdir path/to/directoryIdentify