43 lines
1.2 KiB
Bash
Executable File
43 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Author : vincent.benoit@benserv.fr
|
|
# Date : 11/2022
|
|
# Version : 1.0
|
|
# Brief : création du package Debian pour la configuration du systeme RPI
|
|
#
|
|
###########################################################################
|
|
|
|
create_deb() {
|
|
dirname=kinerpisys-$1
|
|
/usr/bin/mkdir -p bdist_deb/$dirname
|
|
cd bdist_deb/$dirname
|
|
debvers=`/usr/bin/cat /etc/debian_version`
|
|
echo "$debvers"
|
|
IFS='.'
|
|
read -ra vers <<< "$debvers"
|
|
if [ "$vers" == "10" ]; then
|
|
# Write compat file to deb template for Debian 10.x
|
|
cat > $2/template/compat << EOF
|
|
11
|
|
EOF
|
|
fi
|
|
/usr/bin/dh_make -t $2/template -n -y -i -d -c mit -e vincent.benoit@benserv.fr
|
|
/usr/bin/find $2/misc -type f -exec /usr/bin/cp -a {} . \;
|
|
/usr/bin/dpkg-buildpackage -b -uc -us -rfakeroot
|
|
/usr/bin/rm -f $2/template/compat
|
|
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
|
|
}
|
|
|
|
echo "*** Remove old dirs ***"
|
|
/usr/bin/rm -rf bdist_deb build dist
|
|
echo "*** read version ***"
|
|
vers=`/usr/bin/cat VERSION`
|
|
rootpath=`pwd`
|
|
echo "*** Create Debian Misc Package ***"
|
|
create_deb "$vers" "$rootpath"
|
|
echo "*** that's All Folks ...***"
|