1
0
mirror of https://github.com/thingsboard/thingsboard-gateway synced 2025-10-26 22:31:42 +08:00

Fixed path to custom converter

This commit is contained in:
zbeacon
2019-10-29 14:00:40 +02:00
parent d180c0b917
commit 0047b956fe

View File

@@ -18,7 +18,7 @@ Prefix: %{_prefix}
BuildArch: noarch
Vendor: ThingsBoard <info@thingsboard.io>
Url: https://github.com/thingsboard/thingsboard-gateway
Requires(pre): /usr/sbin/useradd, /usr/bin/getent, /usr/bin/pip3
Requires(pre): /usr/sbin/useradd, /usr/bin/getent, /usr/bin/pip3, /usr/bin/mkdir
Requires(post): /usr/bin/systemctl, /usr/bin/cp, /usr/bin/rm, /usr/bin/chown
Requires(postun): /usr/sbin/userdel, /usr/bin/rm, /usr/bin/systemctl
@@ -26,12 +26,14 @@ Requires(postun): /usr/sbin/userdel, /usr/bin/rm, /usr/bin/systemctl
The Thingsboard IoT Gateway is an open-source solution that allows you to integrate devices connected to legacy and third-party systems with Thingsboard.
%pre
/usr/bin/getent passwd thingsboard-gateway || /usr/sbin/useradd -c "ThingsBoard-Gateway Service" -r -U -d /var/lib/thingsboard-gateway thingsboard-gateway && passwd -d thingsboard-gateway
/usr/bin/mkdir -p $RPM_BUILD_ROOT/var/lib/thingsboard_gateway/extensions
/usr/bin/getent passwd thingsboard-gateway || /usr/sbin/useradd -c "ThingsBoard-Gateway Service" -r -U -d /var/lib/thingsboard_gateway thingsboard-gateway && passwd -d thingsboard-gateway
/usr/bin/pip3 install thingsboard_gateway
%build
sudo mkdir -p $RPM_BUILD_ROOT/etc/thingsboard-gateway || echo "ThingsBoard config folder already exists"
sudo mkdir -p $RPM_BUILD_ROOT/var/lib/thingsboard-gateway || echo "ThingsBoard user home directory already exists"
sudo mkdir -p $RPM_BUILD_ROOT/var/lib/thingsboard_gateway || echo "ThingsBoard user home directory already exists"
sudo mkdir -p $RPM_BUILD_ROOT/var/lib/thingsboard_gateway/extensions || echo "ThingsBoard user home directory already exists"
sudo mkdir -p $RPM_BUILD_ROOT/var/log/thingsboard-gateway || echo "ThingsBoard log directory already exists"
sudo chown -R thingsboard-gateway:thingsboard-gateway $RPM_BUILD_ROOT/var/log/thingsboard-gateway
sudo pip3 install thingsboard_gateway
@@ -40,10 +42,13 @@ sudo install -p -D -m 755 %{SOURCE1} $RPM_BUILD_ROOT/etc/thingsboard-gateway/
sudo tar -xvf %{SOURCE1} -C $RPM_BUILD_ROOT/etc/thingsboard-gateway/
%post
/usr/bin/cp -a -r $RPM_BUILD_ROOT/etc/thingsboard-gateway/extensions $RPM_BUILD_ROOT/var/lib/thingsboard_gateway/
/usr/bin/rm -rf $RPM_BUILD_ROOT/etc/thingsboard-gateway/extensions
/usr/bin/rm -rf $RPM_BUILD_ROOT/etc/thingsboard-gateway/thingsboard-gateway
/usr/bin/rm -f $RPM_BUILD_ROOT/etc/thingsboard-gateway/configs.tar.gz
/usr/bin/chown thingsboard-gateway:thingsboard-gateway $RPM_BUILD_ROOT/etc/thingsboard-gateway -R
/usr/bin/chown thingsboard-gateway:thingsboard-gateway $RPM_BUILD_ROOT/var/log/thingsboard-gateway -R
/usr/bin/chown thingsboard-gateway:thingsboard-gateway $RPM_BUILD_ROOT/var/lib/thingsboard_gateway -R
/usr/bin/systemctl enable thingsboard-gateway.service
/usr/bin/systemctl start thingsboard-gateway.service
@@ -57,6 +62,8 @@ sudo rm -rf $RPM_BUILD_ROOT
%defattr(-,thingsboard-gateway,thingsboard-gateway)
%postun
systemctl stop thingsboard-gateway
userdel thingsboard-gateway
/usr/sbin/userdel thingsboard-gateway
/usr/bin/rm -rf $RPM_BUILD_ROOT/var/log/thingsboard-gateway
/usr/bin/rm -rf $RPM_BUILD_ROOT/var/lib/thingsboard-gateway
/usr/bin/rm -rf $RPM_BUILD_ROOT/var/lib/thingsboard_gateway