From 2ca838cbfab578977ea6777668ffa0c434156d13 Mon Sep 17 00:00:00 2001 From: Christian Date: Sun, 5 Dec 2021 13:45:25 +0100 Subject: [PATCH] Fix build scripts. --- Build/build.ps1 | 6 ++- Build/deb-meta/DEBIAN/control | 10 ----- Build/deb-meta/DEBIAN/copyright | 26 ----------- Build/deb-meta/DEBIAN/postinst | 44 ------------------- Build/deb-meta/DEBIAN/postrm | 8 ---- Build/deb-meta/DEBIAN/prerm | 18 -------- .../etc/systemd/system/mqttnet-server.service | 14 ------ 7 files changed, 4 insertions(+), 122 deletions(-) delete mode 100644 Build/deb-meta/DEBIAN/control delete mode 100644 Build/deb-meta/DEBIAN/copyright delete mode 100644 Build/deb-meta/DEBIAN/postinst delete mode 100644 Build/deb-meta/DEBIAN/postrm delete mode 100644 Build/deb-meta/DEBIAN/prerm delete mode 100644 Build/deb-meta/etc/systemd/system/mqttnet-server.service diff --git a/Build/build.ps1 b/Build/build.ps1 index 14fd79cb..cb9faf6d 100644 --- a/Build/build.ps1 +++ b/Build/build.ps1 @@ -14,13 +14,15 @@ Write-Host # Cleanup Get-ChildItem -Path ".\..\" -Filter "*.nupkg" -Recurse | Remove-Item +Get-ChildItem -Path ".\..\" -Filter "*.snupkg" -Recurse | Remove-Item # Build and execute tests &$msbuild ..\Tests\MQTTnet.Core.Tests\MQTTnet.Tests.csproj /t:Clean /t:Restore /t:Build /p:Configuration="Release" /p:TargetFramework="net5.0" /verbosity:m &$msbuild ..\Tests\MQTTnet.AspNetCore.Tests\MQTTnet.AspNetCore.Tests.csproj /t:Clean /t:Restore /t:Build /p:Configuration="Release" /p:TargetFramework="net5.0" /verbosity:m -#vstest.console.exe ..\Tests\MQTTnet.Core.Tests\bin\Release\net5.0\MQTTnet.Tests.dll -#vstest.console.exe ..\Tests\MQTTnet.AspNetCore.Tests\bin\Release\net5.0\MQTTnet.AspNetCore.Tests.dll +vstest.console.exe ..\Tests\MQTTnet.Core.Tests\bin\Release\net5.0\MQTTnet.Tests.dll +vstest.console.exe ..\Tests\MQTTnet.AspNetCore.Tests\bin\Release\net5.0\MQTTnet.AspNetCore.Tests.dll + $certificate = ".\..\..\Build\codeSigningKey.pfx" # Build the core library diff --git a/Build/deb-meta/DEBIAN/control b/Build/deb-meta/DEBIAN/control deleted file mode 100644 index 242444c7..00000000 --- a/Build/deb-meta/DEBIAN/control +++ /dev/null @@ -1,10 +0,0 @@ -Package: mqttnet-server -Version: VERSIONPLACEHOLDER -Section: base -Priority: optional -Architecture: amd64 -Depends: libssl1.1 -Suggests: -Maintainer: Damian Wolgast -Description: - MQTTnet Server is a standalone cross platform MQTT server (like mosquitto) basing on this library. diff --git a/Build/deb-meta/DEBIAN/copyright b/Build/deb-meta/DEBIAN/copyright deleted file mode 100644 index decf080f..00000000 --- a/Build/deb-meta/DEBIAN/copyright +++ /dev/null @@ -1,26 +0,0 @@ -The source of MQTTnet is at: -https://github.com/chkr1011/MQTTnet -Project is maintained by Christian Kratky - - -MIT License - -Copyright (c) 2021 Damian Wolgast - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/Build/deb-meta/DEBIAN/postinst b/Build/deb-meta/DEBIAN/postinst deleted file mode 100644 index 9a90e944..00000000 --- a/Build/deb-meta/DEBIAN/postinst +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -# Check if user exits -USER=mqttnetsrv -USEREXISTS=$(id -u $USER >/dev/null 2>&1; echo $?) -EC=0 -BASEPATH=/opt -INSTALLPATH=$BASEPATH/MQTTnetServer - -# If user does not exist, create it -if (( $USEREXISTS == 1 )); then - useradd -d $INSTALLPATH -r $USER - EC=$(echo $?) - - if (( $EC == 1 )); then - exit 1; - fi -fi - -# Set permissions on files -chown -R root:root $INSTALLPATH - -# Check if config does not exist and create it -if [ ! -f "$INSTALLPATH/appsettings.json" ]; then - cp $INSTALLPATH/appsettings.template.json $INSTALLPATH/appsettings.json -fi - - -# Check if setcap exists, does not exist in docker containers -SCAP=$(which setcap >/dev/null; echo $?) -if [ "$SCAP" -eq "0" ]; then - # Enable MQTTServer.NET to bind to IP interface - setcap CAP_NET_BIND_SERVICE=+eip $INSTALLPATH/MQTTnet.Server -fi - -chmod 644 /etc/systemd/system/mqttnet-server.service - -# Check if systemctl exists, does not exist in docker containers -SCTL=$(which systemctl >/dev/null; echo $?) - -if [ "$SCTL" -eq "0" ]; then - # Reload systemd because of new service file - systemctl daemon-reload -fi \ No newline at end of file diff --git a/Build/deb-meta/DEBIAN/postrm b/Build/deb-meta/DEBIAN/postrm deleted file mode 100644 index 9db22d48..00000000 --- a/Build/deb-meta/DEBIAN/postrm +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# Check if systemctl exists, does not exist in docker containers -SCTL=$(which systemctl >/dev/null; echo $?) -if [ "$SCTL" -eq "0" ]; then - # Reload systemd because of new service file - systemctl daemon-reload -fi \ No newline at end of file diff --git a/Build/deb-meta/DEBIAN/prerm b/Build/deb-meta/DEBIAN/prerm deleted file mode 100644 index ae23bcac..00000000 --- a/Build/deb-meta/DEBIAN/prerm +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -BASEPATH=/opt -INSTALLPATH=$BASEPATH/MQTTnetServer - -# Check if systemctl exists, does not exist in docker containers -SCTL=$(which systemctl >/dev/null; echo $?) -if [ "$SCTL" -eq "0" ]; then - # Stop service before uninstalling - systemctl stop mqttnet-server -fi - -# Check if setcap exists, does not exist in docker containers -SCAP=$(which setcap >/dev/null; echo $?) -if [ "$SCAP" -eq "0" ]; then - # Remove permission to open ports - setcap CAP_NET_BIND_SERVICE=-eip $INSTALLPATH/MQTTnet.Server -fi \ No newline at end of file diff --git a/Build/deb-meta/etc/systemd/system/mqttnet-server.service b/Build/deb-meta/etc/systemd/system/mqttnet-server.service deleted file mode 100644 index 41816247..00000000 --- a/Build/deb-meta/etc/systemd/system/mqttnet-server.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=MQTTnetServer -After=network.target - -[Service] -ExecStart=/opt/MQTTnetServer/MQTTnet.Server -WorkingDirectory=/opt/MQTTnetServer -StandardOutput=inherit -StandardError=inherit -Restart=always -User=mqttnetsrv - -[Install] -WantedBy=multi-user.target \ No newline at end of file