mirror of
https://github.com/thingsboard/thingsboard-gateway
synced 2025-10-26 22:31:42 +08:00
Added deb package and configurations for building rpm
This commit is contained in:
@@ -1,27 +1,45 @@
|
||||
if [ "$1" = "clean" ] || [ "$1" = "only_clean" ] ; then
|
||||
sudo apt remove python3-thingsboard-gateway -y
|
||||
sudo rm -rf /var/log/thingsboard-gateway/
|
||||
sudo rm -rf deb_dist/
|
||||
sudo rm -rf dist/
|
||||
sudo rm -rf thingsboard-gateway.egg-info/
|
||||
sudo rm -rf /etc/thingsboard-gateway/
|
||||
sudo rm -rf thingsboard-gateway-1.0.0.tar.gz
|
||||
sudo rm -rf thingsboard-gateway-2.0.0.tar.gz
|
||||
sudo rm -rf /home/zenx/rpmbuild/BUILDROOT/*
|
||||
sudo rm -rf build/
|
||||
sudo apt remove python3-thingsboard-gateway -y
|
||||
fi
|
||||
|
||||
#IFS=':' read -ra env_path <<< "$PATH"
|
||||
|
||||
|
||||
if [ "$1" != "only_clean" ] ; then
|
||||
# Create sources for DEB package
|
||||
python3 setup.py --command-packages=stdeb.command bdist_deb
|
||||
sudo cp -r temp/etc deb_dist/thingsboard-gateway-1.0.0/debian/python3-thingsboard-gateway
|
||||
sudo cp -r temp/var deb_dist/thingsboard-gateway-1.0.0/debian/python3-thingsboard-gateway
|
||||
sudo cp -r -a temp/DEBIAN deb_dist/thingsboard-gateway-1.0.0/debian/python3-thingsboard-gateway
|
||||
sudo chown root:root deb_dist/thingsboard-gateway-1.0.0/debian/python3-thingsboard-gateway/ -R
|
||||
sudo chown root:root deb_dist/thingsboard-gateway-1.0.0/debian/python3-thingsboard-gateway/var/ -R
|
||||
sudo chmod 775 deb_dist/thingsboard-gateway-1.0.0/debian/python3-thingsboard-gateway/DEBIAN/preinst
|
||||
sudo chown root:root deb_dist/thingsboard-gateway-1.0.0/debian/python3-thingsboard-gateway/DEBIAN/preinst
|
||||
dpkg-deb -b deb_dist/thingsboard-gateway-1.0.0/debian/python3-thingsboard-gateway/
|
||||
cp deb_dist/thingsboard-gateway-1.0.0/debian/python3-thingsboard-gateway.deb .
|
||||
# Adding the files, scripts and permissions
|
||||
sudo cp -r temp/etc deb_dist/thingsboard-gateway-2.0.0/debian/python3-thingsboard-gateway
|
||||
sudo cp -r temp/var deb_dist/thingsboard-gateway-2.0.0/debian/python3-thingsboard-gateway
|
||||
sudo cp -r -a temp/DEBIAN deb_dist/thingsboard-gateway-2.0.0/debian/python3-thingsboard-gateway
|
||||
sudo chown root:root deb_dist/thingsboard-gateway-2.0.0/debian/python3-thingsboard-gateway/ -R
|
||||
sudo chown root:root deb_dist/thingsboard-gateway-2.0.0/debian/python3-thingsboard-gateway/var/ -R
|
||||
sudo chmod 775 deb_dist/thingsboard-gateway-2.0.0/debian/python3-thingsboard-gateway/DEBIAN/preinst
|
||||
sudo chown root:root deb_dist/thingsboard-gateway-2.0.0/debian/python3-thingsboard-gateway/DEBIAN/preinst
|
||||
# Bulding Deb package
|
||||
dpkg-deb -b deb_dist/thingsboard-gateway-2.0.0/debian/python3-thingsboard-gateway/
|
||||
cp deb_dist/thingsboard-gateway-2.0.0/debian/python3-thingsboard-gateway.deb .
|
||||
# Create sources for RPM Package
|
||||
echo 'Building sources RPM package'
|
||||
python3 setup.py --command-packages=stdeb.command bdist_rpm
|
||||
# sudo apt install ./deb_dist/thingsboard-gateway-1.0.0/debian/python3-thingsboard-gateway.deb -y
|
||||
cp build/bdist.linux-x86_64/rpm/* /home/$USER/rpmbuild/ -r
|
||||
# Adding the file, scripts and permissions
|
||||
cp temp/etc/systemd/system/thingsboard-gateway.service /home/$USER/rpmbuild/SOURCES/
|
||||
cd temp/etc/thingsboard-gateway/
|
||||
tar -zcvf configs.tar.gz .*
|
||||
cp configs.tar.gz /home/$USER/rpmbuild/SOURCES/
|
||||
cd ../../../
|
||||
# Bulding RPM Package
|
||||
cp thingsboard-gateway.spec /home/$USER/rpmbuild/SPECS/
|
||||
rpmbuild -ba thingsboard-gateway.spec
|
||||
cp /home/$USER/rpmbuild/RPMS/noarch/*.rpm .
|
||||
# sudo apt install ./deb_dist/thingsboard-gateway-2.0.0/debian/python3-thingsboard-gateway.deb -y
|
||||
fi
|
||||
|
||||
BIN
python3-thingsboard-gateway.deb
Normal file
BIN
python3-thingsboard-gateway.deb
Normal file
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
[metadata]
|
||||
name = thingsboard-gateway
|
||||
version = 1.0.1
|
||||
version = 2.0.0
|
||||
description = Thingsboard Gateway for IoT devices.
|
||||
long_description = The Thingsboard IoT Gateway is an open-source solution that allows you to integrate devices connected to legacy and third-party systems with Thingsboard.
|
||||
license = Apache Software License (Apache Software License 2.0)
|
||||
|
||||
2
setup.py
2
setup.py
@@ -19,7 +19,7 @@ setup(
|
||||
'PyYAML',
|
||||
'six'
|
||||
],
|
||||
download_url='https://github.com/thingsboard/thingsboard-gateway/archive/2.0.0rc.tar.gz',
|
||||
download_url='https://github.com/thingsboard/thingsboard-gateway/archive/2.0.0rc-python.tar.gz',
|
||||
entry_points={
|
||||
'console_scripts': [
|
||||
'thingsboard-gateway = thingsboard_gateway.tb_gateway:daemon'
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user