0

I would like to package Nagios 4 on Ubuntu. Installation from source involves multiple make commands and a configure command.

wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.3.4.tar.gz
tar xzf nagioscore.tar.gz
cd /tmp/nagioscore-nagios-4.3.4/
./configure --with-httpd-conf=/etc/apache2/sites-enabled
make all
make install
make install-init
make install-commandmode
make install-config
make install-webconf 

How do I make a deb or apt package out of this?

I tried following the Ubuntu instructions http://packaging.ubuntu.com/html/packaging-new-software.html When I run the bzr dh-make package version package.tar.gz, I get the following error

bzr: ERROR: Either run the command from an existing branch of upstream, or move nagioscore-nagios-4.3.4 aside and a new branch will be created there.
David Foerster
  • 36,264
  • 56
  • 94
  • 147
pdna
  • 103
  • Can you post a link to the set of instructions your followed, and exactly what you did that produced this error? – darksky Oct 20 '17 at 23:11
  • How To Package is an enormous topic, filling whole websites (http://mentors.debian.net , http://packaging.ubuntu.com). AskUbuntu is more appropriate for a more limited question. – user535733 Oct 20 '17 at 23:21
  • @darksky I updated the question with procedure. I get an error in the 'starting a package' part – pdna Oct 20 '17 at 23:41
  • @DavidFoerster thanks! I will try that. I do not know if that would work for multiple make commands. – pdna Oct 21 '17 at 15:10
  • @DavidFoerster that checkinstall solution partially solved my problem. It only performs a make install. The other make install commands generate config files which I can copy over. – pdna Oct 22 '17 at 01:55

1 Answers1

-2

From https://help.ubuntu.com/community/CompilingEasyHowTo:

If you got this far, you've done the hardest part already. Now all you need to do is run the command

make which does the actual building (compiling) of the program. 

If it's a large program or if you've got a very slow computer, go and get a cup of coffee or something. If you have a multi-core processor you can also set the variable CONCURRENCY_LEVEL to the number of processors/cores you have to speed things up a little.

When it's done, install the program. You probably want to use sudo checkinstall which puts the program in the package manager for clean, easy removal later. This replaces the old sudo make install command.

karel
  • 114,770
Nonny Moose
  • 2,255