Creating ubuntu server packages

I have developed several C ++ applications on my Ubuntu desktop. I want to create installation packages to install them on an Ubuntu server.

Can someone provide recommendations on how to create a Ubuntu server package?

+4
source share
2 answers

The easiest way is to create a "install" section in your makefile that installs the program, and then run checkinstall . You may need to install it using aptitude install checkinstall .

checkinstall runs make install , finds out what has been changed, then creates a package on it.


To make the installation section in a makefile, simply put the commands that you need to install your program. Here is an example program that creates a binary called "myprogram" and needs some configuration in / etc:

 # make example myprogram: main.o something_else.o gcc -o myprogram main.o something_else.o -llibrary_goes_here install: myprogram cp myprogram /usr/bin #install binary cp -R etc /etc/myprogram # copy "etc" folder to /etc/myprogram 

There's a command called install that likes cp and allows you to specify permissions, but I don't know the syntax well enough.

You will also need a section for each .o file that tells you how to compile it (possibly gcc -c filename.cpp ).

+5
source

Ubuntu uses the Debian package format (.deb). The resulting package can focus on architecture (for example, i386, AMD64, etc.) or be independent of architecture.

You can then install the resulting package named "dpkg -i packagefile.deb" as root.

Now, by the way, I suggest you find information on how to make a Debian package. I am sure that there are many good link sites, as well as tools like this one: http://debcreator.cmsoft.net/

+3
source

Source: https://habr.com/ru/post/1309717/


All Articles