-
Notifications
You must be signed in to change notification settings - Fork 245
/
build_viewer_debs.sh
executable file
·35 lines (30 loc) · 1.58 KB
/
build_viewer_debs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
# building DLT Viewer debian packages on Ubuntu 20.04 / Focal Fossa
# script created 19.6.2018, Gernot Wirschal
# updated 11.06.2024, Alexander Wenzel
set -e
rm -rf debtmp
DTLREV=`git rev-list --all --count`
DEBIAN_REVISION=${DTLREV}
PACKAGE_NAME=covesa-dlt-viewer
cp -r focal/debian .
sed -i '/#define PACKAGE_REVISION/c #define PACKAGE_REVISION "'$DTLREV'"' src/version.h
DLT_VERSION=`cat src/version.h | grep "PACKAGE_VERSION" | grep -v PACKAGE_VERSION_STATE | awk '{print $3}' | tr -d \" `
DLT_VERSION_STATE=`cat src/version.h | grep "PACKAGE_VERSION_STATE" | awk '{print $3}' | tr -d \" `
sed -i '/covesa-dlt-viewer/c covesa-dlt-viewer ('${DLT_VERSION}-${DEBIAN_REVISION}') '${DLT_VERSION_STATE}'; urgency=low' ./debian/changelog
sed -i '$ d' ./debian/changelog
date=$(date -Ru)
echo " -- Alexander Wenzel <[email protected]> $date" >> ./debian/changelog
echo "DLT_VERSION: ${DLT_VERSION}"
echo "DEBIAN_REVISION: ${DEBIAN_REVISION}"
echo "DLT_VERSION_STATE: ${DLT_VERSION_STATE}"
echo "PACKAGE_NAME: ${PACKAGE_NAME}"
mkdir -p ./debtmp/${PACKAGE_NAME}-${DLT_VERSION}-${DEBIAN_REVISION}
rsync -a --exclude=debtmp --exclude=*.sh --exclude=*.bat --exclude=cache --exclude=parser --exclude=bionic * debtmp/${PACKAGE_NAME}-${DLT_VERSION}
cd debtmp/${PACKAGE_NAME}-${DLT_VERSION}
echo "#############################################"
echo "Create tarball ../${PACKAGE_NAME}_${DLT_VERSION}-${DEBIAN_REVISION}.orig.tar.gz"
echo "#############################################"
tar -czf ../${PACKAGE_NAME}_${DLT_VERSION}-${DEBIAN_REVISION}.orig.tar.gz *
echo "y" | debuild -uc -us
#make -j8 install