Skip to content
This repository has been archived by the owner on Jan 17, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1 from foglamp/FOGL-1534_pt100
Browse files Browse the repository at this point in the history
FOGL-1534 foglamp version supported greater than or equal to and other minor fixes
  • Loading branch information
praveen-garg authored Jul 30, 2018
2 parents 2dc0969 + 51f656e commit 5001ab1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
19 changes: 17 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Package Build
packages/Debian/build
# vi
*.swp

# MacOS Finder
.DS_Store
._*

# IDE
*.idea

# Build
packages/Debian/build/

# Compiled Object files
*.pyc

# Test
.pytest_cache
4 changes: 2 additions & 2 deletions VERSION.south.pt100
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
foglamp_south_pt100_version=1.0
foglamp_version=1.3
foglamp_south_pt100_version=1.0.0
foglamp_version>=1.3
11 changes: 7 additions & 4 deletions make_deb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ do
echo -n "Cleaning the build folder from older versions..."
find "${GIT_ROOT}/packages/Debian/build" -maxdepth 1 | grep '.*\.[0-9][0-9][0-9][0-9]' | xargs rm -rf
echo "Done."
exit 0
shift
;;
cleanall)
Expand All @@ -47,6 +48,7 @@ do
else
echo "No build folder, skipping cleanall"
fi
exit 0
shift
;;
*)
Expand All @@ -58,7 +60,7 @@ done

architecture="armhf"
version=`cat ${GIT_ROOT}/VERSION.south.pt100 | tr -d ' ' | grep 'foglamp_south_pt100_version=' | head -1 | sed -e 's/\(.*\)=\(.*\)/\2/g'`
foglamp_version=`cat ${GIT_ROOT}/VERSION.south.pt100 | tr -d ' ' | grep 'foglamp_version=' | head -1 | sed -e 's/\(.*\)=\(.*\)/\2/g'`
foglamp_version=`cat ${GIT_ROOT}/VERSION.south.pt100 | tr -d ' ' | grep 'foglamp_version' | head -1 | sed -e 's/\(.*\)version\(.*\)/\2/g'`
BUILD_ROOT="${GIT_ROOT}/packages/Debian/build"

# Final package name
Expand All @@ -67,7 +69,7 @@ package_name="foglamp-south-pt100-${version}-${architecture}"
# Print the summary of findings
echo "The package root directory is : ${GIT_ROOT}"
echo "The FogLAMP version is : ${version}"
echo "The Package will be built in : ${BUILD_ROOT}"
echo "The package will be built in : ${BUILD_ROOT}"
echo "The architecture is set as : ${architecture}"
echo "The package name is : ${package_name}"
echo
Expand Down Expand Up @@ -95,11 +97,12 @@ mkdir "${package_name}"
echo -n "Populating the package and updating version file..."
cd "${package_name}"
cp -R ${GIT_ROOT}/packages/Debian/${architecture}/* .
sed -i "s/Version: 0.0/Version: $version/g" DEBIAN/control
sed -i "s/Depends: foglamp/Depends: foglamp (>=$foglamp_version)/g" DEBIAN/control
sed -i "s/Version: 0.0/Version: ${version}/g" DEBIAN/control
sed -i "s/Depends: foglamp/Depends: foglamp (${foglamp_version})/g" DEBIAN/control

mkdir -p usr/local/foglamp
cd usr/local/foglamp
find ${GIT_ROOT}/python | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
cp -R ${GIT_ROOT}/python .
cp -R ${GIT_ROOT}/VERSION.south.pt100 .
echo "Done."
Expand Down
3 changes: 1 addition & 2 deletions packages/Debian/armhf/DEBIAN/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ set_files_ownership () {

add_service () {
output=$(curl -sX POST http://localhost:8081/foglamp/service -d '{"name": "pt100", "type": "south", "plugin": "pt100", "enabled": true}')
service_id=$(echo $output | awk -F '"id": ' '{print $2}' | awk -F \" '{print $2}')
echo $service_id
echo $output
}

set_files_ownership
Expand Down

0 comments on commit 5001ab1

Please sign in to comment.