42 lines
1.2 KiB
Bash
Executable File
42 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Author : vincent.benoit@scle.fr
|
|
# Date : 07/2022
|
|
# Version : 1.0
|
|
# Brief : création des packages necessaires pour le backend ScleSignRESTful
|
|
#
|
|
###########################################################################
|
|
|
|
create_deb() {
|
|
dirname=configurateurback-$1
|
|
/usr/bin/mkdir -p bdist_deb/$dirname
|
|
cd bdist_deb/$dirname
|
|
/usr/bin/dh_make -t $2/misc/template -n -y -i -d
|
|
/usr/bin/find $2/3rdparty -type f -exec /usr/bin/cp -a {} . \;
|
|
/usr/bin/find $2/certs/pub -type f -exec /usr/bin/cp -a {} . \;
|
|
/usr/bin/find $2/template -type f -exec /usr/bin/cp -a {} . \;
|
|
/usr/bin/cp -a $2/run_prod.py .
|
|
/usr/bin/dpkg-buildpackage -b -uc -us -rfakeroot
|
|
cd ..
|
|
if [ $? == "0" ] && [ ! -d "$2/dist" ]; then
|
|
/usr/bin/mkdir -p $2/dist
|
|
/usr/bin/find . -type f -name "*.deb" -exec /usr/bin/cp -a {} $2/dist \;
|
|
fi
|
|
}
|
|
|
|
create_wheel() {
|
|
cd $1
|
|
/usr/bin/python3 setup.py bdist_wheel --universal
|
|
}
|
|
|
|
echo "*** Remove old dirs ***"
|
|
/usr/bin/rm -rf bdist_deb build dist ScleSignRESTful.egg-info
|
|
echo "*** read version ***"
|
|
vers=`/usr/bin/cat ConfBack/VERSION`
|
|
rootpath=`pwd`
|
|
echo "*** Create Debian Misc Package ***"
|
|
create_deb "$vers" "$rootpath"
|
|
echo "*** Create Python Package ***"
|
|
create_wheel "$rootpath"
|
|
echo "*** that's All Folks ...***"
|