Skip to content

Commit 0231d07

Browse files
Merge pull request #22 from fledge-iot/1.9.0RC
1.9.0RC
2 parents ccfd37d + 6882ff5 commit 0231d07

File tree

19 files changed

+598
-10
lines changed

19 files changed

+598
-10
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
# Build
1212
packages/Debian/build/
1313
packages/RPM/build/
14+
others/paho.mqtt.c/
15+
others/jansson
1416

1517
# Archived packages
1618
plugins/archive
1719
service/archive
20+
others/archive

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ The make_rpm Script
141141
Building a RPM Package
142142
======================
143143

144-
``make_rpm`` script automatically do Fledge clone repo with branch master (by default) and then ``sudo make install`` followed by some prerequisite
144+
``make_rpm`` script automatically do Fledge clone repo with branch main (by default) and then ``sudo make install`` followed by some prerequisite
145145

146146
You may override the branch with ``-b`` or skip Fledge build with ``-s``. For more info just see its help ``-h``
147147

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM ubuntu:18.04
22

33
MAINTAINER Vaibhav Singhal "[email protected]"
44

5-
ARG FLEDGE_BRANCH=master
5+
ARG FLEDGE_BRANCH=main
66
ENV FLEDGE_BRANCH ${FLEDGE_BRANCH}
77
RUN apt-get update && apt-get -y upgrade
88
RUN apt-get install -y git rsyslog

docker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
2525
docker build --tag fledge --build-arg FLEDGE_BRANCH=develop .
2626
```
2727

28-
where name of the image is fledge, FLEDGE_BRANCH is the branch to build (develop, master, 1.5.2 ,etc)
28+
where name of the image is fledge, FLEDGE_BRANCH is the branch to build (develop, main, 1.5.2 ,etc)
2929

3030
### Run container
3131

make_rpm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ set -e
2323

2424
PKG_ROOT=`pwd` # The script must be executed from the root git directory
2525
repo_name="fledge" # Name of the Git repository
26-
branch="master" # Default Git branch to use
26+
branch="main" # Default Git branch to use
2727
pkg_name="fledge" # Name of the package to build
2828
architecture="x86_64" # The architecture for which the rpm should be created
2929
rhpg_pkg="rh-postgresql96" # Name of the Red Hat package for postgres

others/README.rst

Lines changed: 310 additions & 0 deletions
Large diffs are not rendered by default.

others/make_deb

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
#!/bin/bash
2+
3+
##--------------------------------------------------------------------
4+
## Copyright (c) 2021 Dianomic Systems Inc.
5+
##
6+
## Licensed under the Apache License, Version 2.0 (the "License");
7+
## you may not use this file except in compliance with the License.
8+
## You may obtain a copy of the License at
9+
##
10+
## http://www.apache.org/licenses/LICENSE-2.0
11+
##
12+
## Unless required by applicable law or agreed to in writing, software
13+
## distributed under the License is distributed on an "AS IS" BASIS,
14+
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
## See the License for the specific language governing permissions and
16+
## limitations under the License.
17+
##--------------------------------------------------------------------
18+
##
19+
## Author: Ashish Jabble
20+
##
21+
22+
set -e
23+
24+
USAGE="$(basename "$0") [-h] [-a] ...
25+
This script is used to create the Debian package for to support other additional libraries as separately such as mqtt, gcp
26+
27+
Arguments:
28+
-h - Display this help text
29+
-a - Remove all the archive versions"
30+
31+
while getopts ":ha" opt; do
32+
case "$opt" in
33+
a)
34+
if [ -d "./archive" ]; then
35+
echo -n "Cleaning the package archive folder..."
36+
rm -rf ./archive/*
37+
echo "Done."
38+
else
39+
echo "No archive folder, skipping cleanall"
40+
fi
41+
exit 0
42+
;;
43+
h)
44+
echo "${USAGE}"
45+
exit 0
46+
;;
47+
\?)
48+
echo "Invalid option -$OPTARG"
49+
exit 1
50+
;;
51+
:)
52+
echo "-$OPTARG requires an argument"
53+
exit 1
54+
esac
55+
done
56+
shift $((OPTIND -1))
57+
58+
ADDITIONAL_LIB_NAME=$1
59+
if [ "${ADDITIONAL_LIB_NAME}" = "" ]; then
60+
echo You must specify additional library name to package
61+
exit 1
62+
fi
63+
64+
# VERSION
65+
if [ -f scripts/${ADDITIONAL_LIB_NAME}/VERSION ]; then
66+
version=`cat scripts/${ADDITIONAL_LIB_NAME}/VERSION | tr -d ' ' | grep "fledge_${ADDITIONAL_LIB_NAME}_version" | head -1 | sed -e 's/\(.*\)=\(.*\)/\2/g'`
67+
fledge_version=`cat scripts/${ADDITIONAL_LIB_NAME}/VERSION | tr -d ' ' | grep 'fledge_version' | head -1 | sed -e 's/\(.*\)version\(.*\)/\2/g'`
68+
else
69+
echo VERSION file is missing for ${ADDITIONAL_LIB_NAME} in "others/scripts/" directory
70+
exit 1
71+
fi
72+
73+
# Description
74+
if [ -f scripts/${ADDITIONAL_LIB_NAME}/Description ]; then
75+
description=`cat "scripts/${ADDITIONAL_LIB_NAME}/Description"`
76+
else
77+
echo Description file is missing for ${ADDITIONAL_LIB_NAME} in "others/scripts/" directory
78+
exit 1
79+
fi
80+
81+
# requirements.sh
82+
if [ -f scripts/${ADDITIONAL_LIB_NAME}/requirements.sh ]; then
83+
./scripts/${ADDITIONAL_LIB_NAME}/requirements.sh
84+
else
85+
echo Requirement script is missing for ${ADDITIONAL_LIB_NAME} "others/scripts/" directory
86+
exit 1
87+
fi
88+
89+
architecture=`arch`
90+
PKG_ROOT=`pwd`
91+
archive=${PKG_ROOT}/archive/DEBIAN
92+
pkg_name="fledge-${ADDITIONAL_LIB_NAME}"
93+
arch_name=$(dpkg --print-architecture)
94+
package_name="${pkg_name}-${version}-${architecture}"
95+
96+
if [ ! -d "${archive}/${architecture}" ]; then
97+
mkdir -p "${archive}/${architecture}"
98+
fi
99+
100+
# Print the summary of findings
101+
echo "Additional ${ADDITIONAL_LIB_NAME} Package version is : ${version}"
102+
echo "The Fledge required version is : ${fledge_version}"
103+
echo "The architecture is set as : ${architecture}"
104+
echo "The package will be built in : ${archive}/${architecture}"
105+
echo "The package name is : ${package_name}"
106+
echo
107+
108+
echo -n "Populating the package and updating version file..."
109+
if [ ! -d "${archive}/${architecture}/${package_name}" ]; then
110+
mkdir -p "${archive}/${architecture}/${package_name}"
111+
fi
112+
cd "${archive}/${architecture}/${package_name}"
113+
mkdir -p DEBIAN
114+
cp -R ${PKG_ROOT}/packages/DEBIAN/* DEBIAN
115+
sed -i "s/__VERSION__/${version}/g" DEBIAN/control
116+
sed -i "s/__NAME__/${pkg_name}/g" DEBIAN/control
117+
sed -i "s/__ARCH__/${arch_name}/g" DEBIAN/control
118+
sed -i "s/__REQUIRES__/fledge (${fledge_version})/g" DEBIAN/control
119+
sed -i "s/__DESCRIPTION__/${description}/g" DEBIAN/control
120+
121+
# Debian file structure
122+
mkdir -p usr/local/lib
123+
if [ "${ADDITIONAL_LIB_NAME}" == "mqtt" ]; then
124+
cp -R --preserve=links /usr/local/lib/libpaho* usr/local/lib
125+
fi
126+
if [ "${ADDITIONAL_LIB_NAME}" == "gcp" ]; then
127+
cp -R --preserve=links /usr/local/lib/libjwt* usr/local/lib
128+
cp -R --preserve=links /usr/local/lib/libjansson* usr/local/lib
129+
fi
130+
echo "Done."
131+
132+
# Build the package
133+
cd "${archive}/${architecture}"
134+
echo "Building the ${package_name} package..."
135+
dpkg-deb --build ${package_name}
136+
echo "Building Complete."

others/packages/DEBIAN/control

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Package: __NAME__
2+
Version: __VERSION__
3+
Section: devel
4+
Priority: optional
5+
Architecture: __ARCH__
6+
Depends: __REQUIRES__
7+
Conflicts:
8+
Maintainer: Dianomic Systems, Inc. <[email protected]>
9+
Homepage: http://www.dianomic.com
10+
Description: __DESCRIPTION__

others/packages/DEBIAN/postinst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/sh
2+
3+
##--------------------------------------------------------------------
4+
## Copyright (c) 2021 Dianomic Systems Inc.
5+
##
6+
## Licensed under the Apache License, Version 2.0 (the "License");
7+
## you may not use this file except in compliance with the License.
8+
## You may obtain a copy of the License at
9+
##
10+
## http://www.apache.org/licenses/LICENSE-2.0
11+
##
12+
## Unless required by applicable law or agreed to in writing, software
13+
## distributed under the License is distributed on an "AS IS" BASIS,
14+
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
## See the License for the specific language governing permissions and
16+
## limitations under the License.
17+
##--------------------------------------------------------------------
18+
19+
##--------------------------------------------------------------------
20+
##
21+
## @postinst DEBIAN/postinst
22+
## This script is used to execute post installation tasks.
23+
##
24+
## Author: Ashish Jabble
25+
##
26+
##--------------------------------------------------------------------
27+
28+
set -e

others/scripts/gcp/Description

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
libjwt which allows you to encode and decode JSON Web Tokens (JWT) and Jansson for encoding, decoding and manipulating JSON data are the additional libraries which will be used in GCP plugins.

0 commit comments

Comments
 (0)