Skip to content

Commit f4fe6d9

Browse files
authored
Merge pull request #13 from foglamp/develop
update master with develop
2 parents 44dcafb + e013fbe commit f4fe6d9

File tree

6 files changed

+68
-6
lines changed

6 files changed

+68
-6
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright [yyyy] [name of copyright owner]
189+
Copyright 2018 Dianomic Systems
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ The make_deb Script
4444
cleanall - Remove all the versions, including the last one
4545
$
4646
47+
.. warning::
48+
49+
Postgres dependencies will not be installed automatically.
50+
In order to use postgres storage engine, you will need manual installation of `postgresql`.
51+
52+
.. code-block:: console
53+
54+
yes Y | sudo apt install postgresql
55+
56+
4757
4858
Building a Package
4959
==================

packages/Debian/armhf/DEBIAN/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Version: 1.0.0
33
Section: devel
44
Priority: optional
55
Architecture: armhf
6-
Depends: autoconf,libtool,libboost-dev,libboost-system-dev,libboost-thread-dev,libpq-dev,postgresql,python3-pip,python3-setuptools,sqlite3
6+
Depends: autoconf,libtool,libboost-dev,libboost-system-dev,libboost-thread-dev,libpq-dev,python3-pip,python3-setuptools,sqlite3,sudo
77
Conflicts:
88
Maintainer: Dianomic Systems, Inc. <[email protected]>
99
Homepage: http://www.dianomic.com

packages/Debian/common/DEBIAN/postinst

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
## @postinst DEBIAN/postinst
2222
## This script is used to execute post installation tasks.
2323
##
24-
## Author: Ivan Zoratti
24+
## Author: Ivan Zoratti, Massimiliano Pinto
2525
##
2626
##--------------------------------------------------------------------
2727

@@ -31,6 +31,19 @@ set -e
3131
SSL_NAME="foglamp"
3232
SSL_DAYS="365"
3333

34+
link_update_task() {
35+
echo "Changing setuid of update_task.apt"
36+
chmod ugo+s /usr/local/foglamp/bin/update_task.apt
37+
echo "Removing task/update"
38+
[ -e /usr/local/foglamp/scripts/tasks/update ] && rm /usr/local/foglamp/scripts/tasks/update
39+
echo "Create link file"
40+
ln -s /usr/local/foglamp/bin/update_task.apt /usr/local/foglamp/scripts/tasks/update
41+
}
42+
43+
copy_foglamp_sudoer_file() {
44+
cp /usr/local/foglamp/bin/foglamp.sudoers /etc/sudoers.d/foglamp
45+
}
46+
3447
copy_service_file() {
3548
cp /usr/local/foglamp/extras/scripts/foglamp.service /etc/init.d/foglamp
3649
}
@@ -74,6 +87,24 @@ install_pip3_packages () {
7487
pip3 install -r /usr/local/foglamp/python/requirements.txt
7588
}
7689

90+
# Call FogLAMP package update script
91+
# Any message will be written by called update script
92+
call_package_update_script () {
93+
# File created by presinstall hook
94+
installed_version_file="/usr/local/foglamp/.current_installed_version"
95+
if [ -s "${installed_version_file}" ]; then
96+
current_installed_version=`cat ${installed_version_file}`
97+
update_script="/usr/local/foglamp/scripts/package/debian/package_update.sh"
98+
# Check update script exists
99+
if [ -x "${update_script}" ] && [ -s "${update_script}" ] && [ -O "${update_script}" ]; then
100+
# Call Debian update script passing the previous version
101+
${update_script} ${current_installed_version}
102+
fi
103+
# Update done: remove temp file
104+
rm ${installed_version_file}
105+
fi
106+
}
107+
77108
# main
78109
echo "Install python dependencies"
79110
install_pip3_packages
@@ -85,6 +116,16 @@ echo "Generating certificate files"
85116
generate_certs
86117
echo "Setting ownership of FogLAMP files"
87118
set_files_ownership
119+
120+
# Call FogLAMP package update script
121+
call_package_update_script
122+
123+
echo "Linking update task"
124+
link_update_task
125+
126+
echo "Copying sodoers file"
127+
copy_foglamp_sudoer_file
128+
88129
echo "Enabling FogLAMP service"
89130
enable_foglamp_service
90131
echo "Starting FogLAMP service"

packages/Debian/common/DEBIAN/preinst

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
## @preinst DEBIAN/preinst
2222
## This script is used to execute pre installation tasks.
2323
##
24-
## Author: Ivan Zoratti, Ashwin Gopalakrishnan
24+
## Author: Ivan Zoratti, Ashwin Gopalakrishnan, Massimiliano Pinto
2525
##
2626
##--------------------------------------------------------------------
2727

@@ -83,7 +83,18 @@ then
8383
echo "*** ERROR. FogLAMP is currently running. Stop FogLAMP and try again. ***"
8484
exit 1
8585
fi
86-
86+
87+
# Persist current version in case of upgrade/downgrade
88+
installed_version=`dpkg -s ${PKG_NAME} | grep '^Version:' | awk '{print $2}'`
89+
if [ "${installed_version}" ]
90+
then
91+
# Persist current FogLAMP version: it will be removed by postinstall script
92+
this_dir=`pwd`
93+
cd usr/local/foglamp/
94+
echo "${installed_version}" > .current_installed_version
95+
cd ${this_dir}
96+
fi
97+
8798
# check schema version file, exit if schema change path does not exist
8899
CURRENT_VERSION_FILE=$(get_current_version_file)
89100
CURRENT_SCHEMA_VERSION=$(get_schema_version $CURRENT_VERSION_FILE)

packages/Debian/x86_64/DEBIAN/control

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

0 commit comments

Comments
 (0)