This tutorial is a quick way to understand how to add a script or something else to the Makefile installation process. This is solely for those who are building rpm/deb packages and want to add extra stuff in the installation package.
So inside your Makefile directory add the file you would like to see in the final installation:
For example:
[root@softether vpnserver_package]# ls script*
script_i_want_to_add.sh
Now edit Makefile to properly add the script to the final package.
[root@softether vpnserver_package]# vim Makefile
Look for the install and uninstall part and add the lines you need.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install: | |
cp vpncmd/vpncmd /usr/bin/ | |
cp vpncmd/ham* /usr/bin/ | |
cp -r vpnserver /usr/local/ | |
chmod 755 vpnserver | |
cp vpnserver.init /etc/init.d/vpnserver | |
cp vpn_server.config /usr/local/vpnserver/ | |
chmod 755 /etc/init.d/vpnserver | |
/sbin/chkconfig –add vpnserver | |
### adding install line here | |
cp script_i_want_to_add.sh /usr/bin | |
uninstall: | |
rm -rf /usr/local/vpnserver | |
#rm -f /etc/init.d/vpnserver | |
/sbin/chkconfig –del vpnserver | |
rm /usr/bin/hamco* | |
rm /usr/bin/vpncmd | |
### adding uninstall line here | |
rm /usr/bin/changevhub |
And that’s it. This script will then be accessible in the final stage of the installation, under /usr/bin/ folder which is the PATH folder.