Skip to content
Advertisement

C++ linux install executable file on deploy environment

Hello every one i need to deploy linux(centos) c++ project with make file or script. By one makefile or script install dependency and project executable binary. my dependency applications libboost-devel,gcc-g++ and pcre. my excuteble binary file is run_excute

Advertisement

Answer

Yip sure – put the below commands into a file. At the top of the file add:

JavaScript

Save the file – lets say you call it install; on the command line type:

JavaScript

Then to build and install your program type:

JavaScript

Alternatively, if you’ve got some time on your hands: http://www.rpm.org/max-rpm/ch-rpm-build.html


As an example the basic rpm build process for fedora is:

Step 1: setup your machine to do packaging:

JavaScript

Step 2: source and Makefile Place these in ~/rpmbuild/SOURCES

Step 3: Create a spec file In ~/rpmbuild/SPECS create file called myname.spec. It should contain something like:

JavaScript

Step 4: create the source and binary rpm

JavaScript

Step 5: use the rpm

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement