Skip to content

Commit 44dcafb

Browse files
authored
Merge pull request #6 from foglamp/FOGL-1471
FOGL-1471 Debian control file fixes and other refactoring
2 parents 331717c + 216dcf9 commit 44dcafb

File tree

8 files changed

+70
-58
lines changed

8 files changed

+70
-58
lines changed

.gitignore

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1-
build/
2-
foglamp-x86_64/
3-
foglamp-armhf/
1+
# vi
2+
*.swp
3+
4+
# MacOS Finder
5+
.DS_Store
6+
._*
7+
8+
# IDE
9+
*.idea
10+
11+
# Build
12+
packages/Debian/build/

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Finally, run the ``make_deb`` command:
5858
The package root directory is : /home/foglamp/foglamp-pkg
5959
The FogLAMP directory is : /usr/local/foglamp
6060
The FogLAMP version is : 1.2
61-
The Package will be built in : /home/foglamp/foglamp-pkg/packages/Debian/build
61+
The package will be built in : /home/foglamp/foglamp-pkg/packages/Debian/build
6262
The architecture is set as : x86_64
6363
The package name is : foglamp-1.2-x86_64
6464
@@ -86,7 +86,7 @@ If you execute the ``make_deb`` command again, you will see:
8686
The package root directory is : /home/foglamp/foglamp-pkg
8787
The FogLAMP directory is : /usr/local/foglamp
8888
The FogLAMP version is : 1.2
89-
The Package will be built in : /home/foglamp/foglamp-pkg/packages/Debian/build
89+
The package will be built in : /home/foglamp/foglamp-pkg/packages/Debian/build
9090
The architecture is set as : x86_64
9191
The package name is : foglamp-1.2-x86_64
9292

make_deb

Lines changed: 47 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
##--------------------------------------------------------------------
44
## Copyright (c) 2018 OSIsoft, LLC
@@ -16,7 +16,7 @@
1616
## limitations under the License.
1717
##--------------------------------------------------------------------
1818
##
19-
## Author: Ivan Zoratti
19+
## Author: Ivan Zoratti, Ashish Jabble
2020
##
2121

2222

@@ -27,45 +27,54 @@ GIT_ROOT=`pwd` # The script must be executed from the root git directory
2727
architecture="none"
2828
usage="$(basename "$0") {x86|arm} [clean|cleanall]
2929
This script is used to create the Debian package of FogLAMP
30-
Arguments:
30+
Arguments:
3131
x86 - Build an x86_64 package
3232
arm - Build an armv7l package
3333
clean - Remove all the old versions saved in format .XXXX
3434
cleanall - Remove all the versions, including the last one"
3535

36-
for i in "$@"
37-
do
38-
case "$i" in
39-
x86)
40-
architecture="x86_64"
41-
shift
42-
;;
43-
arm)
44-
architecture="armhf"
45-
shift
46-
;;
47-
clean)
48-
echo -n "Cleaning the build folder from older versions..."
49-
find "${GIT_ROOT}/packages/Debian/build" -maxdepth 1 | grep '.*\.[0-9][0-9][0-9][0-9]' | xargs rm -rf
50-
echo "Done."
51-
shift
52-
;;
53-
cleanall)
54-
if [ -d "${GIT_ROOT}/packages/Debian/build" ]; then
55-
echo -n "Cleaning the build folder..."
56-
rm -rf ${GIT_ROOT}/packages/Debian/build/*
57-
echo "Done."
58-
else
59-
echo "No build folder, skipping cleanall"
60-
fi
61-
shift
62-
;;
63-
*)
64-
echo "${usage}"
65-
exit 1
66-
;;
67-
esac
68-
done
36+
if [ $# -gt 0 ]
37+
then
38+
for i in "$@"
39+
do
40+
case "$i" in
41+
x86)
42+
architecture="x86_64"
43+
shift
44+
;;
45+
arm)
46+
architecture="armhf"
47+
shift
48+
;;
49+
clean)
50+
echo -n "Cleaning the build folder from older versions..."
51+
find "${GIT_ROOT}/packages/Debian/build" -maxdepth 1 | grep '.*\.[0-9][0-9][0-9][0-9]' | xargs rm -rf
52+
echo "Done."
53+
shift
54+
;;
55+
cleanall)
56+
if [ -d "${GIT_ROOT}/packages/Debian/build" ]; then
57+
echo -n "Cleaning the build folder..."
58+
rm -rf ${GIT_ROOT}/packages/Debian/build/*
59+
echo "Done."
60+
else
61+
echo "No build folder, skipping cleanall"
62+
fi
63+
shift
64+
;;
65+
--help)
66+
echo "${usage}"
67+
exit 1
68+
;;
69+
*)
70+
echo "Unrecognized option: $i"
71+
exit 1
72+
;;
73+
esac
74+
done
75+
else
76+
echo "See help and select the architecture to use, *x86* or *arm*"
77+
fi
6978

7079
# If the architecture has not been defined, then the script is complete
7180
if [[ "$architecture" == "none" ]]; then
@@ -94,7 +103,7 @@ package_name="foglamp-${version}-${architecture}"
94103
echo "The package root directory is : ${GIT_ROOT}"
95104
echo "The FogLAMP directory is : ${FOGLAMP_ROOT}"
96105
echo "The FogLAMP version is : ${version}"
97-
echo "The Package will be built in : ${BUILD_ROOT}"
106+
echo "The package will be built in : ${BUILD_ROOT}"
98107
echo "The architecture is set as : ${architecture}"
99108
echo "The package name is : ${package_name}"
100109
echo
@@ -123,7 +132,7 @@ echo -n "Populating the package and updating version in control file..."
123132
cd "${package_name}"
124133
cp -R ${GIT_ROOT}/packages/Debian/common/* .
125134
cp -R ${GIT_ROOT}/packages/Debian/${architecture}/* .
126-
sed -i "s/Version: 0.0/Version: $version/g" DEBIAN/control
135+
sed -i "s/Version: 1.0.0/Version: $version/g" DEBIAN/control
127136
mkdir -p usr/local/foglamp
128137
cd usr/local/foglamp
129138
cp -R ${FOGLAMP_ROOT}/* .
@@ -166,4 +175,3 @@ echo "Building Complete."
166175

167176

168177
exit 0
169-

packages/Debian/armhf/DEBIAN/control

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Package: foglamp
2-
Version: 0.0
2+
Version: 1.0.0
33
Section: devel
44
Priority: optional
55
Architecture: armhf
6-
Depends: postgresql,postgresql-server-dev-9.6,libpq-dev,autoconf,libtool,jq,libboost-dev,libboost-system-dev,libboost-thread-dev,sqlite3,python-setuptools,python3.5-dev,python3-dbus,python3-pip
6+
Depends: autoconf,libtool,libboost-dev,libboost-system-dev,libboost-thread-dev,libpq-dev,postgresql,python3-pip,python3-setuptools,sqlite3
77
Conflicts:
88
Maintainer: Dianomic Systems, Inc. <[email protected]>
99
Homepage: http://www.dianomic.com

packages/Debian/common/DEBIAN/postinst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
22

33
##--------------------------------------------------------------------
44
## Copyright (c) 2018 OSIsoft, LLC
@@ -89,5 +89,3 @@ echo "Enabling FogLAMP service"
8989
enable_foglamp_service
9090
echo "Starting FogLAMP service"
9191
start_foglamp_service
92-
93-

packages/Debian/common/DEBIAN/preinst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
22

33
##--------------------------------------------------------------------
44
## Copyright (c) 2018 OSIsoft, LLC
@@ -96,5 +96,3 @@ then
9696
fi
9797

9898
fi
99-
100-

packages/Debian/common/DEBIAN/prerm

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
22

33
##--------------------------------------------------------------------
44
## Copyright (c) 2018 OSIsoft, LLC
@@ -19,11 +19,11 @@
1919
##--------------------------------------------------------------------
2020
##
2121
## @prerm DEBIAN/prerm
22-
## This script is used to execute pre installation tasks.
22+
## This script is used to execute before the removal of files associated with the package.
2323
##
2424
## Author: Ivan Zoratti, Ashwin Gopalakrishnan
2525
##
26-
##--------------------------------------------------------------------
26+
##----------------------------------------------------------------------------------------
2727

2828
set -e
2929

@@ -100,4 +100,3 @@ echo "Remove FogLAMP service script"
100100
remove_foglamp_service_file
101101
echo "Reset systemctl"
102102
reset_systemctl
103-

packages/Debian/x86_64/DEBIAN/control

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Package: foglamp
2-
Version: 0.0
2+
Version: 1.0.0
33
Section: devel
44
Priority: optional
55
Architecture: amd64
6-
Depends: postgresql,libpq-dev,autoconf,libtool,jq,libboost-dev,libboost-system-dev,libboost-thread-dev,sqlite3,python-setuptools,python3-pip
6+
Depends: autoconf,curl,libtool,libboost-dev,libboost-system-dev,libboost-thread-dev,libpq-dev,postgresql,python3-pip,python3-setuptools,sqlite3
77
Conflicts:
88
Maintainer: Dianomic Systems, Inc. <[email protected]>
99
Homepage: http://www.dianomic.com

0 commit comments

Comments
 (0)