From a884f36fcb07d0907177b92ba7c92644cb14c16b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Kervella?= Date: Mon, 21 May 2018 14:48:58 +0000 Subject: [PATCH] Utilise des fichiers de requirements --- apt_requirements.txt | 16 +++++++++++++ install_re2o.sh | 30 ++++++++---------------- requirements.txt => pip_requirements.txt | 3 +-- 3 files changed, 27 insertions(+), 22 deletions(-) create mode 100644 apt_requirements.txt rename requirements.txt => pip_requirements.txt (59%) diff --git a/apt_requirements.txt b/apt_requirements.txt new file mode 100644 index 00000000..18f81b78 --- /dev/null +++ b/apt_requirements.txt @@ -0,0 +1,16 @@ +python3-django +python3-dateutil +texlive-latex-base +texlive-fonts-recommended +python3-djangorestframework +python3-django-reversion +python3-pip +libsasl2-dev libldap2-dev +libssl-dev +python3-crypto +python3-git +javascript-common +libjs-jquery +libjs-jquery-ui +libjs-jquery-timepicker +libjs-bootstrap diff --git a/install_re2o.sh b/install_re2o.sh index 55866db8..6168ec08 100755 --- a/install_re2o.sh +++ b/install_re2o.sh @@ -3,6 +3,12 @@ SETTINGS_LOCAL_FILE='re2o/settings_local.py' SETTINGS_EXAMPLE_FILE='re2o/settings_local.example.py' +APT_REQ_FILE="apt_requirements.txt" +PIP_REQ_FILE="pip_requirements.txt" + +LDIF_DB_FILE="install_utils/db.ldiff" +LDIF_SCHEMA_FILE="install_utils/schema.ldiff" + VALUE= # global value used to return values by some functions @@ -61,24 +67,8 @@ install_requirements() { ### echo "Setting up the required packages ..." - apt-get -y install \ - python3-django \ - python3-dateutil \ - texlive-latex-base \ - texlive-fonts-recommended \ - python3-djangorestframework \ - python3-django-reversion \ - python3-pip \ - libsasl2-dev libldap2-dev \ - libssl-dev \ - python3-crypto \ - python3-git \ - javascript-common \ - libjs-jquery \ - libjs-jquery-ui \ - libjs-jquery-timepicker \ - libjs-bootstrap - pip3 install django-bootstrap3 django-ldapdb==0.9.0 django-macaddress + cat $APT_REQ_FILE | xargs apt-get -y install + pip3 install -r $PIP_REQ_FILE echo "Setting up the required packages: Done" } @@ -194,8 +184,8 @@ install_ldap() { echo "Hash of the password: $hashed_ldap_passwd" echo "Building the LDAP config files ..." - sed 's|dc=example,dc=net|'"$domain"'|g' install_utils/db.ldiff | sed 's|FILL_IT|'"$hashed_ldap_passwd"'|g' > /tmp/db - sed 's|dc=example,dc=net|'"$domain"'|g' install_utils/schema.ldiff | sed 's|FILL_IT|'"$hashed_ldap_passwd"'|g' > /tmp/schema + sed 's|dc=example,dc=net|'"$domain"'|g' $LDIF_DB_FILE | sed 's|FILL_IT|'"$hashed_ldap_passwd"'|g' > /tmp/db + sed 's|dc=example,dc=net|'"$domain"'|g' $LDIF_SCHEMA_FILE | sed 's|FILL_IT|'"$hashed_ldap_passwd"'|g' > /tmp/schema echo "Building the LDAP config files: Done" echo "Stopping slapd service ..." diff --git a/requirements.txt b/pip_requirements.txt similarity index 59% rename from requirements.txt rename to pip_requirements.txt index 32957784..0960c796 100644 --- a/requirements.txt +++ b/pip_requirements.txt @@ -1,4 +1,3 @@ django-bootstrap3 +django-ldapdb==0.9.0 django-macaddress -python-dateutil -pycrypto