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?
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
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With