commit 4097d4804e7f5a0f29e6f5f65fbb184e9afb10a4
Author: Richard Shaw <hobbes1069(a)gmail.com>
Date: Mon Oct 14 08:34:00 2019 -0500
Remove hard dependency on mongodb and document in SETUP.
Fix Requires for java to comply with guidelines.
Try JAVA_HOME instead of forcing java 1.8.0 via alternatives.
SETUP | 21 ++++++++++++++++++---
unifi-lts.spec | 24 ++++++++++++------------
unifi.service | 10 ++++------
3 files changed, 34 insertions(+), 21 deletions(-)
---
diff --git a/SETUP b/SETUP
index 7dd8cc0..c6102d7 100644
--- a/SETUP
+++ b/SETUP
@@ -1,12 +1,27 @@
-For RHEL/CentOS/SL etc, you will also need Fedora EPEL repository installed for mongodb,
on CentOS it's already available:
+####################
+#### All systems ###
+####################
-(as root or sudo)
-# yum install epel-release
+Since MongoDB was removed from Fedora[1] it must be installed separately. The
+EL7 community package[1] from MongoDB works on Fedora as well.
+
+[1]
https://fedoraproject.org/wiki/Changes/MongoDB_Removal
+[2]
https://www.mongodb.com/download-center/community
Enable the unifi service and the firewall config:
# firewall-cmd --permanent --add-service=unifi
+
+To permit Cloud Access:
+
+# firewall-cmd --permanent --add-service=unifi-cloud
+
+Then reload the configuration:
+
# firewall-cmd --reload
+
+Enabling and starting the unifi service:
+
# systemctl enable unifi.service
# systemctl start unifi.service
diff --git a/unifi-lts.spec b/unifi-lts.spec
index a397d56..7b14f36 100644
--- a/unifi-lts.spec
+++ b/unifi-lts.spec
@@ -5,7 +5,7 @@
Name: unifi-lts
Version: 5.6.42
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Ubiquiti UniFi controller LTS
License: Proprietary
@@ -28,14 +28,11 @@ Requires: firewalld-filesystem
BuildRequires: firewalld-filesystem
BuildRequires: %{_bindir}/execstack
-%if 0%{?fedora} > 29 || 0%{?rhel} > 7
-Requires: mongodb-org-server
-%else
-Requires: mongodb-server
-%endif
-Requires: java-1.8.0-openjdk-headless
-Requires(post): policycoreutils-python
-Requires(postun): policycoreutils-python
+#
https://fedoraproject.org/wiki/Changes/MongoDB_Removal
+#Requires: /usr/bin/mongod
+Requires: java-headless = 1:1.8.0
+Requires(post): policycoreutils-python-utils
+Requires(postun): policycoreutils-python-utils
# Unbundled fonts
Requires: fontawesome-fonts
@@ -212,9 +209,7 @@ install -p %{SOURCE100} %{SOURCE101} .
# Workaround script for MongoDB 3.6 no longer accepting --nohttpinterface.
# See:
https://community.ubnt.com/t5/UniFi-Routing-Switching/MongoDB-3-6/m-p/232...
#
-%if 0%{?fedora} >= 28
- install -pm 0755 %{SOURCE6} %{buildroot}%{_datadir}/unifi/bin/mongod
-%endif
+install -pm 0755 %{SOURCE6} %{buildroot}%{_datadir}/unifi/bin/mongod
%pre
@@ -286,6 +281,11 @@ fi
%changelog
+* Mon Oct 14 2019 Richard Shaw <hobbes1069(a)gmail.com> - 5.6.42-3
+- Remove hard dependency on mongodb and document in SETUP.
+- Fix Requires for java to comply with guidelines.
+- Try JAVA_HOME instead of forcing java 1.8.0 via alternatives.
+
* Sat Aug 10 2019 RPM Fusion Release Engineering <leigh123linux(a)gmail.com> -
5.6.42-2
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
diff --git a/unifi.service b/unifi.service
index ee71880..f4bf151 100644
--- a/unifi.service
+++ b/unifi.service
@@ -7,12 +7,10 @@ Wants=network-online.target
Type=simple
User=unifi
WorkingDirectory=/usr/share/unifi
-# Has to be run though bash script due to java issue, see:
-#
https://bugzilla.redhat.com/show_bug.cgi?id=1358476#c20
-#ExecStart=/usr/sbin/unifi start
-#ExecStop=/usr/sbin/unifi stop
-ExecStart=/usr/bin/java -jar /usr/share/unifi/lib/ace.jar start
-ExecStop=/usr/bin/java -jar /usr/share/unifi/lib/ace.jar stop
+EnvironmentFile=-/etc/sysconfig/unifi
+Environment=JAVA_HOME=/usr/lib/jvm/jre-1.8.0
+ExecStart=/usr/lib/jvm/jre-1.8.0/bin/java $JAVA_OPTS -jar /usr/share/unifi/lib/ace.jar
start
+ExecStop=/usr/lib/jvm/jre-1.8.0/bin/java $JAVA_OPTS -jar /usr/share/unifi/lib/ace.jar
stop
Restart=on-success
[Install]