fix: lief installation

* unnecessary steps removed
* irrelevant comment removed
* instructions updated to compile lief for python 3.6 instead of 2.7
* install lief in the folder where the other dependencies are so that it is detected by the diagnostics page
pull/4118/head
iwitz 2019-02-06 15:08:40 +01:00 committed by GitHub
parent 2f3002975f
commit dd2e6cc715
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 24 deletions

View File

@ -486,44 +486,31 @@ scl enable rh-python36 pip3 install pymisp
yum install devtoolset-7 cmake3
```
## 11.02/ Enable devtoolset-7
## 11.02/ Create the directory and download the source code
```bash
scl enable devtoolset-7 bash
cd /var/www/MISP/app/files/scripts
git clone --branch master --single-branch https://github.com/lief-project/LIEF.git lief
```
## 11.03/ Set env variable, create directories and download source code
## 11.03/ Compile lief and install it
```bash
mkdir -p /tmp/LIEF
mkdir -p /tmp/LIEF_INSTALL
export LIEF_TMP=/tmp/LIEF
export LIEF_INSTALL=/tmp/LIEF_INSTALL
export LIEF_BRANCH=master
cd $LIEF_TMP
git clone --branch $LIEF_BRANCH --single-branch https://github.com/lief-project/LIEF.git LIEF
```
## 11.04/ Compile lief and install
```bash
cd $LIEF_TMP/LIEF
mkdir -p build
cd /var/www/MISP/app/files/scripts/lief
mkdir build
cd build
scl enable devtoolset-7 'bash -c "cmake3 \
scl enable devtoolset-7 rh-python36 'bash -c "cmake3 \
-DLIEF_PYTHON_API=on \
-DLIEF_DOC=off \
-DCMAKE_INSTALL_PREFIX=$LIEF_INSTALL \
-DCMAKE_BUILD_TYPE=Release \
-DPYTHON_VERSION=2.7 \
-DPYTHON_VERSION=3.6 \
.."'
make -j3
cd api/python
scl enable rh-python36 python3 setup.py install || :
# you can ignore the error about finding suitable distribution
cd $LIEF_TMP/LIEF/build
make install
make package
# before you run setup.py it may be a good idea to switch off your Internet connection ; otherwise pip will try to fetch lief from Github which may cause issues later
scl enable rh-python36 'python3 setup.py install || :'
```
## 11.05/ Test lief installation, if no error, package installed
## 11.04/ Test lief installation, if no error, package installed
```bash
python
>> import lief