3 Summary: Open source Home Automation System
7 License: GPLv3+ and ASL 2.0 and Boost and BSD and MIT
9 URL: http://www.domoticz.com
10 # Source0: https://github.com/domoticz/domoticz/archive/%{version}.tar.gz
11 # https://www.domoticz.com/wiki/Domoticz_versions_-_Commits
12 Source0: https://github.com/domoticz/domoticz/archive/%{snap}.tar.gz
13 # Source0-md5: 376611fe9d5a8fb7febd71be8addc4ce
14 Source1: %{name}.service
17 # Use system tinyxpath (https://github.com/domoticz/domoticz/pull/1759)
18 Patch2: %{name}-tinyxpath.patch
19 # Use system openzwave includes
20 Patch3: %{name}-openzwave.patch
21 # Work against Dev branch of OpenZWave upstream
22 Patch4: %{name}-openzwave-Dev.patch
23 # Fix python detection (https://github.com/domoticz/domoticz/pull/1749)
24 Patch5: %{name}-python.patch
25 BuildRequires: boost-devel
27 BuildRequires: curl-devel
28 BuildRequires: libmosquitto-devel
29 BuildRequires: libmosquittopp-devel
30 BuildRequires: libopenzwave-devel >= 1.5.0
31 BuildRequires: libstdc++-devel
32 BuildRequires: libusb-devel
33 BuildRequires: lua-devel
34 BuildRequires: openssl-devel
35 BuildRequires: python3-devel
36 BuildRequires: sqlite-devel
37 BuildRequires: systemd-devel
38 BuildRequires: tinyxpath-devel
39 BuildRequires: zlib-devel
40 Requires(pre): /usr/sbin/groupadd
41 Requires(pre): /usr/sbin/useradd
42 Requires(post): systemd
43 Requires(postun): systemd
44 Requires(preun): systemd
45 Requires: fonts-TTF-Google-Droid
46 Provides: bundled(js-ace)
47 Provides: bundled(js-angular-ui-bootstrap) = 0.13.4
48 Provides: bundled(js-angularamd) = 0.2.1
49 Provides: bundled(js-angularjs) = 1.5.8
50 Provides: bundled(js-blockly)
51 Provides: bundled(js-bootbox)
52 Provides: bundled(js-bootstrap) = 3.2.0
53 Provides: bundled(js-colpick)
54 Provides: bundled(js-d3)
55 Provides: bundled(js-datatables-datatools) = 2.2.3
56 Provides: bundled(js-dateformat) = 1.2.3
57 Provides: bundled(js-filesaver) = 0.0-git20140725
58 Provides: bundled(js-highcharts) = 4.2.6
59 Provides: bundled(js-html5shiv) = 3.6.2
60 Provides: bundled(js-i18next) = 1.8.0
61 Provides: bundled(js-ion-sound) = 3.0.6
62 Provides: bundled(js-jquery) = 1.12.0
63 Provides: bundled(js-jquery-noty) = 2.1.0
64 Provides: bundled(js-less) = 1.3.0
65 Provides: bundled(js-ngdraggable)
66 Provides: bundled(js-nggrid)
67 Provides: bundled(js-ozwcp)
68 Provides: bundled(js-require) = 2.1.14
69 Provides: bundled(js-respond) = 1.1.0
70 Provides: bundled(js-wow) = 0.1.9
71 Provides: bundled(js-zeroclipboard) = 1.0.4
74 Domoticz is a Home Automation System that lets you monitor and
75 configure various devices like: Lights, Switches, various
76 sensors/meters like Temperature, Rain, Wind, UV, Electra, Gas, Water
77 and much more. Notifications/Alerts can be sent to any mobile device
81 mv %{name}-%{snap}*/* .
83 APPVERSION="%{version}"
84 echo "#define APPVERSION ${APPVERSION##*.}" > appversion.h
85 echo '#define APPHASH "%{snap}"' >> appversion.h
86 APPDATE=$(date --date="%{date}" "+%s")
87 echo "#define APPDATE ${APPDATE}" >> appversion.h
89 %patch2 -p1 -b.tinyxpath
90 %patch3 -p1 -b.openzwave
91 #%patch4 -p1 -b.openzwave-Dev
94 rm -f hardware/openzwave/*.h
95 rm -rf hardware/openzwave/aes
96 rm -rf hardware/openzwave/command_classes
97 rm -rf hardware/openzwave/platform
98 rm -rf hardware/openzwave/value_classes
103 install -d build && cd build
105 -DUSE_OPENSSL_STATIC=NO \
106 -DUSE_STATIC_LIBSTDCXX=NO \
107 -DUSE_STATIC_OPENZWAVE=NO \
108 -DUSE_BUILTIN_LUA=NO \
109 -DUSE_BUILTIN_MQTT=NO \
110 -DUSE_BUILTIN_SQLITE=NO \
111 -DUSE_BUILTIN_TINYXPATH=NO \
112 -DUSE_STATIC_BOOST=NO \
113 -DCMAKE_INSTALL_PREFIX=%{_datadir}/%{name} \
119 rm -rf $RPM_BUILD_ROOT
120 %{__make} -C build install \
121 DESTDIR=$RPM_BUILD_ROOT
123 # remove docs, we grab them in files below
124 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/*.txt
126 # move binary to standard directory
127 install -d $RPM_BUILD_ROOT%{_bindir}/
128 mv $RPM_BUILD_ROOT%{_datadir}/%{name}/%{name} $RPM_BUILD_ROOT%{_bindir}/
130 # install systemd service and config
131 install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/
132 install -d $RPM_BUILD_ROOT%{systemdunitdir}/
133 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/
134 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
136 # create database/ssl cert directory
137 install -d $RPM_BUILD_ROOT%{_sharedstatedir}/%{name}/
139 # Disable the app's self-update script
141 # Unbundle DroidSans.ttf
142 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/DroidSans.ttf
143 ln -s /usr/share/fonts/TTF/DroidSans.ttf \
144 $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/
145 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/DroidSans.ttf
146 ln -s /usr/share/fonts/TTF/DroidSans.ttf \
147 $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/
148 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts/DroidSans.ttf
149 ln -s /usr/share/fonts/TTF/DroidSans.ttf \
150 $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts/
152 # OpenZWave Control Panel temp file
153 ln -s %{_sharedstatedir}/%{name}/ozwcp.poll.XXXXXX.xml \
154 $RPM_BUILD_ROOT%{_datadir}/%{name}/ozwcp.poll.XXXXXX.xml
157 rm -rf $RPM_BUILD_ROOT
160 getent group domoticz >/dev/null || groupadd -r domoticz
161 getent passwd domoticz >/dev/null || \
162 useradd -r -g domoticz -d %{_datadir}/%{name} -s /sbin/nologin \
163 -c "Domoticz Home Automation Server" domoticz
164 # For OpenZWave USB access (/dev/ttyACM#)
165 usermod -G domoticz,dialout domoticz
168 %systemd_post %{name}.service
171 %systemd_preun %{name}.service
177 %defattr(644,root,root,755)
179 %doc README.md History.txt
180 %attr(755,root,root) %{_bindir}/%{name}
181 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
183 %attr(755,domoticz,domoticz) %{_sharedstatedir}/%{name}/
184 %{systemdunitdir}/%{name}.service