Name: wsf Version: 6.0.002 Release: 7%{?dist} Summary: Whitestar Files Service License: GPL Source0: https://whitestar.io/repo/wsf/6.0.002/7/wsf.tar.xz BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: make Requires: telnet, java-25-openjdk %description Whitestar Files Service %prep %autosetup -n %{name} %build ESLINT=0 NODE_ENV=production make %install make install-service DESTDIR=%{buildroot} PREFIX=/home/whitestar/wsf %files %doc README.md %attr(0744, whitestar, whitestar) /home/whitestar/wsf/* %attr(0744, whitestar, whitestar) /home/whitestar/wsf/dist/* %attr(0755, whitestar, whitestar) /home/whitestar/wsf/dist/libs/* # Script to be run after package is installed %post # # Create the user: whitestar with password whitestar and admin privileges # password is encrypted below using crypt() command outside this routine # # perl -e 'print crypt("whitestar", "salt"),"\n"' # echo "##" echo "## Creating whitestar userid...and giving it admin authority" echo "##" id -u whitestar || ( echo "Creating new User: whitestar" useradd -m -p saVcBwwVb0fMY whitestar ) usermod -aG wheel whitestar chown -R whitestar /home/whitestar/wsf chown -R whitestar /home/whitestar/wsf/dist # 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 $JAVA_FOLDER restorecon -v $JAVA_FOLDER fi SERVICE_PATH="/etc/systemd/system/wsf.service" EXEC_START="$JAVA_FOLDER -XX:+UseStringDeduplication -DfilesServer=true -jar wsf.jar" if [ ! -e "$SERVICE_PATH" ]; then echo "##" echo "## Creating the wsf Service" echo "##" cat > "$SERVICE_PATH" < /usr/lib/firewalld/services/WSFiles.xml < WSFiles WhiteStar Communications, Inc. Secure File Transfer EOF firewall-cmd --reload fi # # Enable the wsf Service - if we choose to start verify it is running # echo "##" echo "## Enable the wsf Service" echo "##" systemctl daemon-reload systemctl enable wsf.service systemctl restart wsf.service echo "## WhiteStar Files 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 wsf service if [ $1 -eq 0 ] ; then rm -f /etc/systemd/system/wsf.service; systemctl stop wsf.service; systemctl disable wsf.service; systemctl daemon-reload; fi %changelog