forked from RoboSense-LiDAR/rslidar_sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_debian.sh
executable file
·47 lines (36 loc) · 1.49 KB
/
create_debian.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
35
36
37
38
39
40
41
42
43
44
45
46
47
#! /usr/bin/env bash
## install the python-bloom fakeroot
function install_pkg()
{
pkg_found=$(dpkg -l | grep ${1})
if [[ $? -eq 0 ]]
then
echo "${1} already installed."
else
echo "Install ${1} ..."
sudo apt-get install ${1} -y
fi
}
install_pkg python-bloom
install_pkg fakeroot
echo -e "\n\033[1;32m ~~ (1). Delete old debian folders in the directory...\033[0m"
rm -rf debian/ obj-x86_64-linux-gnu/
echo -e "\n\033[1;32m ~~ (2). Delete any backup files...\033[0m"
find . -type f -name '*~' -delete
echo -e "\n\033[1;32m ~~ (3). Create debian packages...\033[0m\n"
bloom-generate rosdebian --os-name ubuntu --os-version `echo $(lsb_release -sc)` --ros-distro `echo ${ROS_DISTRO}`
# sed 's#dh_shlibdeps*#dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info#g' debian/rules
## when dpkg-shlibdeps: error: no dependency information found for
## adding bellow code to debian/rules
##
## override_dh_shlibdeps:
## dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
## It is necessary to insert a TAB instead of spaces before "dh_shlibdeps ..."
target_string=$(grep "dh_shlibdeps " debian/rules)
replace_string=" dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info"
sed -i "s#${target_string}#${replace_string}#g" debian/rules
fakeroot debian/rules binary
echo -e "\n\033[1;32m ~~ (4). Delete old debian folders in the directory...\033[0m"
rm -rf debian/ obj-x86_64-linux-gnu/
echo -e "\n\033[1;32m ~~ (5). Delete any backup files...\033[0m"
find . -type f -name '*~' -delete