diff --git a/.gitignore b/.gitignore index e69de29..94844d5 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/domoticz-3.5877.tar.gz diff --git a/domoticz-version.patch b/domoticz-version.patch new file mode 100644 index 0000000..e39ebed --- /dev/null +++ b/domoticz-version.patch @@ -0,0 +1,7 @@ +--- a/appversion.default 2017-07-07 13:43:17.107648429 -0500 ++++ b/appversion.default 2017-07-07 14:10:46.154190961 -0500 +@@ -1,3 +1,3 @@ +-#define APPVERSION 5876 ++#define APPVERSION 5877 + #define APPHASH "b97777b" + #define APPDATE 1478691222 diff --git a/domoticz.conf b/domoticz.conf new file mode 100644 index 0000000..2c7b47e --- /dev/null +++ b/domoticz.conf @@ -0,0 +1,14 @@ +WWW_PORT=8080 +SSL_PORT=8443 +SSLCERT="/var/lib/domoticz/domoticz.pem" +SSLPASS="" +SSLMETHOD="" +SSLOPTIONS="" +SSLDHPARAM="" +WWW_ROOT="/usr/share/domoticz/www" +DBASE="/var/lib/domoticz/domoticz.db" +USERDATA="/usr/share/domoticz/" +VERBOSE=0 +LOG="/var/log/domoticz.log" +LOGLEVEL="1" + diff --git a/domoticz.service b/domoticz.service new file mode 100644 index 0000000..c3a29ac --- /dev/null +++ b/domoticz.service @@ -0,0 +1,14 @@ +[Unit] +Description=Domoticz Home Automation Server + +[Service] +User=domoticz +Group=domoticz +EnvironmentFile=/etc/sysconfig/domoticz +ExecStart=/usr/bin/domoticz -www $WWW_PORT -sslwww $SSL_PORT -sslcert $SSLCERT -sslpass $SSLPASS -sslmethod $SSLMETHOD -ssloptions $SSLOPTIONS -ssldhparam $SSLDHPARAM -wwwroot $WWW_ROOT -dbase $DBASE -userdata $USERDATA -verbose $VERBOSE -log $LOG -loglevel $LOGLEVEL +WorkingDirectory=/usr/share/domoticz +# Give the right to open priviliged ports. This allows you to run on a port <1024 without root permissions (user/group setting above) +#CapabilityBoundingSet=CAP_NET_BIND_SERVICE + +[Install] +WantedBy=multi-user.target diff --git a/domoticz.spec b/domoticz.spec new file mode 100644 index 0000000..776ab8c --- /dev/null +++ b/domoticz.spec @@ -0,0 +1,154 @@ +Name: domoticz +Version: 3.5877 +Release: 1%{?dist} +Summary: Open source Home Automation System + +License: GPLv3+ and ASL 2.0 and Boost and BSD and MIT +URL: http://www.domoticz.com +Source0: https://github.com/domoticz/domoticz/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz +Source1: %{name}.service +Source2: %{name}.conf + +# Source says its version 3.5876, but it's really 3.5877 +Patch1: %{name}-version.patch + +BuildRequires: boost-devel +BuildRequires: cmake +BuildRequires: curl-devel +BuildRequires: gcc-c++ +BuildRequires: git +BuildRequires: libopenzwave-devel +BuildRequires: libusb-devel +BuildRequires: lua-devel +BuildRequires: mosquitto-devel +BuildRequires: openssl-devel +BuildRequires: python2-devel +BuildRequires: sqlite-devel +BuildRequires: systemd-devel +BuildRequires: zlib-devel + +Requires(pre): shadow-utils +Requires(post): systemd +Requires(postun): systemd +Requires(preun): systemd + +Requires: google-droid-sans-fonts + +Provides: bundled(js-ace) +Provides: bundled(js-angularamd) = 0.2.1 +Provides: bundled(js-angularjs) = 1.5.8 +Provides: bundled(js-blockly) +Provides: bundled(js-bootbox) +Provides: bundled(js-bootstrap) = 3.2.0 +Provides: bundled(js-colpick) +Provides: bundled(js-d3) +Provides: bundled(js-datatables-datatools) = 2.2.3 +Provides: bundled(js-dateformat) = 1.2.3 +Provides: bundled(js-filesaver) = 0.0-git20140725 +Provides: bundled(js-highcharts) = 4.2.6 +Provides: bundled(js-html5shiv) = 3.6.2 +Provides: bundled(js-i18next) = 1.8.0 +Provides: bundled(js-jquery) = 1.12.0 +Provides: bundled(js-ngdraggable) +Provides: bundled(js-nggrid) +Provides: bundled(js-jquery-noty) = 2.1.0 +Provides: bundled(js-require) = 2.1.14 +Provides: bundled(js-respond) = 1.1.0 +Provides: bundled(js-angular-ui-bootstrap) = 0.13.4 +Provides: bundled(js-wow) = 0.1.9 +Provides: bundled(js-ozwcp) +Provides: bundled(js-less) = 1.3.0 +Provides: bundled(js-ion-sound) = 3.0.6 +Provides: bundled(js-zeroclipboard) = 1.0.4 + + +%description +Domoticz is a Home Automation System that lets you monitor and configure various +devices like: Lights, Switches, various sensors/meters like Temperature, Rain, +Wind, UV, Electra, Gas, Water and much more. Notifications/Alerts can be sent to +any mobile device + + +%prep +%setup -q +%patch1 -p1 -b.version + + +%build +%cmake \ + -DUSE_STATIC_LIBSTDCXX=NO \ + -DUSE_STATIC_OPENZWAVE=NO \ + -DUSE_BUILTIN_LUA=NO \ + -DUSE_BUILTIN_MQTT=NO \ + -DUSE_BUILTIN_SQLITE=NO \ + -DUSE_STATIC_BOOST=NO \ + -DCMAKE_INSTALL_PREFIX=%{_datadir}/%{name} +make %{?_smp_mflags} + + +%install +%make_install + +# remove docs, we grab them in files below +rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/*.txt + +# move binary to standard directory +mkdir -p $RPM_BUILD_ROOT%{_bindir}/ +mv $RPM_BUILD_ROOT%{_datadir}/%{name}/%{name} $RPM_BUILD_ROOT%{_bindir}/ + +# install systemd service and config +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ +mkdir -p $RPM_BUILD_ROOT%{_unitdir}/ +cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/ +cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name} + +# create database/ssl cert directory +mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/%{name}/ + +# Disable the app's self-update script +chmod 644 $RPM_BUILD_ROOT%{_datadir}/%{name}/updatedomo + +# Unbundle DroidSans.ttf +rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/DroidSans.ttf +ln -s %{_fontdir}/google-droid/DroidSans.ttf \ + $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/ +rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/DroidSans.ttf +ln -s %{_fontdir}/google-droid/DroidSans.ttf \ + $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/ +rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts/DroidSans.ttf +ln -s %{_fontdir}/google-droid/DroidSans.ttf \ + $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts/ + + +%pre +getent group domoticz >/dev/null || groupadd -r domoticz +getent passwd domoticz >/dev/null || \ +useradd -r -g domoticz -d %{_datadir}/%{name} -s /sbin/nologin \ +-c "Domoticz Home Automation Server" domoticz + + +%post +%systemd_post %{name}.service + + +%preun +%systemd_preun %{name}.service + + +%postun +%systemd_postun_with_restart %{name}.service + + +%files +%license License.txt +%doc README.md History.txt +%{_bindir}/%{name} +%config(noreplace) %{_sysconfdir}/sysconfig/%{name} +%{_datadir}/%{name}/ +%dir %attr(0755,domoticz,domoticz) %{_sharedstatedir}/%{name}/ +%{_unitdir}/%{name}.service + + +%changelog +* Wed Jul 19 2017 Michael Cronenworth - 3.5877-1 +- Initial spec diff --git a/sources b/sources index e69de29..078fe9b 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +SHA512 (domoticz-3.5877.tar.gz) = a9ca3fd2b70710d13535379188512f15355faae3e64b574ee960cf2a73898b1f2fee9a76633cb218a290d104f2c6527d3c52e2918dd974cded128d07817f305f