How to compile and install source code in OpenShift?

I am trying to install "whois" in OpenShift on the Internet, I cannot install with yum due to permissions

\> yum install whois error: cannot open Packages database in /var/lib/rpm CRITICAL:yum.main: Error: rpmdb open failed 

I do not know alternative ways to install the package, so consider the possibility of compiling the source code.

make is available.

 \> make -version GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This program built for x86_64-redhat-linux-gnu 

so how can i compile the source code via ssh on openshift? Thank you very much!

Edit: I can make package, but cant install package.

Update: Adds environment variables and related data.

$PATH

 [app-domain.rhcloud.com whois-5.2.7]\> echo $PATH /var/lib/openshift/{{ directory_hash }}/python//virtenv/bin:/var/lib/openshift/{{ directory_hash }}/python//bin:/opt/rh/python27/root/usr/bin:/bin:/usr/bin:/usr/sbin 

install

 [app-domain.rhcloud.com whois-5.2.7]\> which install /var/lib/openshift/{{ directory_hash }}/python/bin/install 

Error message during make install

 [app-domain.rhcloud.com whois-5.2.7]\> make install BASEDIR=./destdir/ install -d ./destdir//usr/bin/ /var/lib/openshift/{{ directory_hash }}/python//bin/install: line 10: version: unbound variable make: *** [install-whois] Error 1 

Error message during make /path/to/install

 [app-domain.rhcloud.com whois-5.2.7]\> make /var/lib/openshift/{{ directory_hash }}/python/bin/install BASEDIR=./destdir/ make: Nothing to be done for `/var/lib/openshift/{{ directory_hash }}/python/bin/install'. 
+5
source share
2 answers

Update: The indicated $PATH environment variable assumes that the install command is likely to be overtaken by the python install command. This is why the make command does not work when trying to install binaries.

You have two solutions.

  • temporarily remove the python path from the $PATH variable. It will be restored to its original value when entering OpenShift the next time:

    export PATH=/bin:/usr/bin:/usr/sbin

  • edit the Makefile and po/Makefile and set the fixed path to the install command to /usr/bin/install . Line in Makefile s:

    INSTALL = install

    should read:

    INSTALL = /usr/bin/install


To solve permissions issues when installing on /usr , you will need to install whois in a custom directory. This example sets it to the destdir subdirectory.

 $ wget http://ftp.debian.org/debian/pool/main/w/whois/whois_5.2.7.tar.xz $ tar xf whois_5.2.7.tar.xz $ cd whois-5.2.7/ $ mkdir destdir $ make $ make install BASEDIR=./destdir/ $ ./destdir/usr/bin/whois --version Version 5.2.7. Report bugs to < md+whois@linux.it >. 
+1
source

First you should get the whois source code:

 wget http://ftp.debian.org/debian/pool/main/w/whois/whois_5.2.7.tar.xz 

Then it must be removed:

 tar -xf whois_5.2.7.tar.xz 

Now you have the source directory, so the last step is to compile it with make.

I think that all this can be done via SSH on OpenShift.

+1
source

All Articles