Name: connection-agent Version: 5.0.280 Release: 1%{?dist} Summary: WhiteStar HyperSpace Connection Agent Service License: GPL Source0: https://whitestar.io/repo/connection-agent/5.0.128/5.0.280/connection-agent.tar.xz BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: make Requires: telnet %description WhiteStar HyperSpace Connection Agent Service %prep %autosetup -n %{name} %build ESLINT=0 NODE_ENV=production make %install make install-service DESTDIR=%{buildroot} PREFIX=/home/whitestar/connection-agent %files %doc README.md %attr(0744, root, root) /home/whitestar/connection-agent/* %attr(0744, root, root) /home/whitestar/connection-agent/dist/* %attr(0755, root, root) /home/whitestar/connection-agent/dist/libs/* # Script to be run after package is installed %post chown -R root /home/whitestar/connection-agent chown -R root /home/whitestar/connection-agent/dist # if java 21 folder is not installed, install it if [ ! -d /opt/jdk-21.0.1 ]; then echo "##" echo "## Installing Java 21.0.1" echo "##" cd /tmp wget -c https://cdn.azul.com/zulu/bin/zulu21.30.15-ca-fx-jdk21.0.1-linux_x64.tar.gz tar xzf zulu21.30.15-ca-fx-jdk21.0.1-linux_x64.tar.gz mv zulu21.30.15-ca-fx-jdk21.0.1-linux_x64 /opt/jdk-21.0.1 fi # selinuxenabled if [ $? -ne 0 ] then echo "SELinux is not enabled" else echo "SELinux is enabled, updating fcontext for java..." semanage fcontext -a -t bin_t /opt/jdk-21.0.1/bin/java restorecon -v /opt/jdk-21.0.1/bin/java fi if [ ! -e /etc/systemd/system/connection-agent.service ]; then echo "##" echo "## Creating the HyperSpace Connection Agent Service" echo "##" cat > /etc/systemd/system/connection-agent.service < /usr/lib/firewalld/services/hyperSpace.xml < HyperSpace WhiteStar Communications, Inc. HyperSpace Hybrid Quantum Networking EOF firewall-cmd --reload fi # # Enable the HyperSpace Connection Agent Service - if we choose to start verify it is running # echo "##" echo "## Enable the HyperSpace Connection Agent Service" echo "##" systemctl daemon-reload systemctl enable connection-agent.service systemctl restart connection-agent.service echo "## WhiteStar HyperSpace Connection Agent Service Started!"; # Script to be run after package is un-installed %postun # $1 variable determines whether this is an upgrade ($1 == 1) or uninstall ($1 == 0) # if set to uninstall, remove the Hyperspace Connection Agent service if [ $1 -eq 0 ] ; then rm -f /etc/systemd/system/connection-agent.service; systemctl stop connection-agent.service; systemctl disable connection-agent.service; systemctl daemon-reload; fi %changelog