I have developed some C++ apps on my Ubuntu desktop. I want to create installation packages so that I can install them on a Ubuntu server.
Can anyone provide guidelines on how to create an Ubuntu server package?
I have developed some C++ apps on my Ubuntu desktop. I want to create installation packages so that I can install them on a Ubuntu server.
Can anyone provide guidelines on how to create an Ubuntu server package?
Ubuntu uses the Debian package format (.deb). The resulting package can target an architecture (such as i386, AMD64, etc) or be architecture independent.
Then you can install the resulting package with 'dpkg -i packagefile.deb' as root.
Now more to the point: I suggest you to look for information about how to make a Debian package. I'm sure there are plenty of good reference sites out there and also tools, such as this one: http://debcreator.cmsoft.net/
The easiest way is to create an "install" section in your makefile which will install the program, then run checkinstall
. You may need to install it with aptitude install checkinstall
.
checkinstall runs make install
, finds out what was changed, then builds a package based on it.
To do the install section in a makefile, just put the commands it would take to install your program. Here's an example of a 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's like cp
and lets you specify permissions, but I don't know the syntax well enough.
You'd also need a section for each .o file that says how to compile it (probably gcc -c filename.cpp
).