1 Summary: Open source Home Automation System
5 License: GPLv3+ and ASL 2.0 and Boost and BSD and MIT
7 URL: http://www.domoticz.com
8 Source0: https://github.com/domoticz/domoticz/archive/%{version}.tar.gz
9 # Source0-md5: fd383a13d13d0976c72f332d6db1d24e
10 Source1: %{name}.service
13 # Use system tinyxpath (https://github.com/domoticz/domoticz/pull/1759)
14 Patch2: %{name}-tinyxpath.patch
15 # Use system openzwave includes
16 Patch3: %{name}-openzwave.patch
17 # Work against Dev branch of OpenZWave upstream
18 Patch4: %{name}-openzwave-Dev.patch
19 # Fix python detection (https://github.com/domoticz/domoticz/pull/1749)
20 Patch5: %{name}-python.patch
22 Patch7: boost-1.73.patch
23 BuildRequires: boost-devel >= 1.66.0
24 BuildRequires: cereal-devel
25 BuildRequires: cmake >= 3.16.0
26 BuildRequires: curl-devel
27 BuildRequires: jsoncpp-devel
28 BuildRequires: libmosquitto-devel
29 BuildRequires: libopenzwave-devel >= 1.5.0
30 BuildRequires: libstdc++-devel >= 6:4.8.1
31 BuildRequires: libusb-compat-devel
32 BuildRequires: linux-libc-headers
33 BuildRequires: lua53-devel
34 BuildRequires: minizip-devel
35 BuildRequires: openssl-devel
36 BuildRequires: pkgconfig
37 BuildRequires: python3 >= 1:3.4
38 BuildRequires: python3-devel >= 1:3.4
39 BuildRequires: sqlite3-devel
40 BuildRequires: tinyxml-devel
41 BuildRequires: tinyxpath-devel
42 BuildRequires: zlib-devel
43 Requires(pre): /usr/sbin/groupadd
44 Requires(pre): /usr/sbin/useradd
45 Requires(post): systemd
46 Requires(postun): systemd
47 Requires(preun): systemd
48 Requires: fonts-TTF-Google-Droid
49 Requires: libopenzwave >= 1.5.0
50 Provides: bundled(js-ace)
51 Provides: bundled(js-angular-ui-bootstrap) = 0.13.4
52 Provides: bundled(js-angularamd) = 0.2.1
53 Provides: bundled(js-angularjs) = 1.5.8
54 Provides: bundled(js-blockly)
55 Provides: bundled(js-bootbox)
56 Provides: bundled(js-bootstrap) = 3.2.0
57 Provides: bundled(js-colpick)
58 Provides: bundled(js-d3)
59 Provides: bundled(js-datatables-datatools) = 2.2.3
60 Provides: bundled(js-dateformat) = 1.2.3
61 Provides: bundled(js-filesaver) = 0.0-git20140725
62 Provides: bundled(js-highcharts) = 4.2.6
63 Provides: bundled(js-html5shiv) = 3.6.2
64 Provides: bundled(js-i18next) = 1.8.0
65 Provides: bundled(js-ion-sound) = 3.0.6
66 Provides: bundled(js-jquery) = 1.12.0
67 Provides: bundled(js-jquery-noty) = 2.1.0
68 Provides: bundled(js-less) = 1.3.0
69 Provides: bundled(js-ngdraggable)
70 Provides: bundled(js-nggrid)
71 Provides: bundled(js-ozwcp)
72 Provides: bundled(js-require) = 2.1.14
73 Provides: bundled(js-respond) = 1.1.0
74 Provides: bundled(js-wow) = 0.1.9
75 Provides: bundled(js-zeroclipboard) = 1.0.4
78 Domoticz is a Home Automation System that lets you monitor and
79 configure various devices like: Lights, Switches, various
80 sensors/meters like Temperature, Rain, Wind, UV, Electra, Gas, Water
81 and much more. Notifications/Alerts can be sent to any mobile device
86 APPVERSION="%{version}"
87 echo "#define APPVERSION ${APPVERSION##*.}" > appversion.h
88 echo '#define APPHASH "%{snap}"' >> appversion.h
89 APPDATE=$(date --date="%{date}" "+%s")
90 echo "#define APPDATE ${APPDATE}" >> appversion.h
92 %patch2 -p1 -b.tinyxpath
93 %patch3 -p1 -b.openzwave
94 #%patch4 -p1 -b.openzwave-Dev
99 rm -f hardware/openzwave/*.h
100 rm -rf hardware/openzwave/aes
101 rm -rf hardware/openzwave/command_classes
102 rm -rf hardware/openzwave/platform
103 rm -rf hardware/openzwave/value_classes
108 install -d build && cd build
110 -DUSE_BUILTIN_JSONCPP=NO \
111 -DUSE_BUILTIN_MINIZIP=NO \
112 -DUSE_BUILTIN_MQTT=NO \
113 -DUSE_BUILTIN_SQLITE=NO \
114 -DUSE_BUILTIN_TINYXPATH=NO \
115 -DUSE_LUA_STATIC=NO \
116 -DUSE_OPENSSL_STATIC=NO \
117 -DUSE_STATIC_BOOST=NO \
118 -DUSE_STATIC_LIBSTDCXX=NO \
119 -DUSE_STATIC_OPENZWAVE=NO \
120 -DCMAKE_INSTALL_PREFIX=%{_datadir}/%{name} \
126 rm -rf $RPM_BUILD_ROOT
127 %{__make} -C build install \
128 DESTDIR=$RPM_BUILD_ROOT
130 # remove docs, we grab them in files below
131 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/*.txt
133 # move binary to standard directory
134 install -d $RPM_BUILD_ROOT%{_bindir}/
135 mv $RPM_BUILD_ROOT%{_datadir}/%{name}/%{name} $RPM_BUILD_ROOT%{_bindir}/
137 # install systemd service and config
138 install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/
139 install -d $RPM_BUILD_ROOT%{systemdunitdir}/
140 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/
141 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
143 # create database/ssl cert directory
144 install -d $RPM_BUILD_ROOT%{_sharedstatedir}/%{name}/
146 # Disable the app's self-update script
148 # Unbundle DroidSans.ttf
149 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/DroidSans.ttf
150 ln -s /usr/share/fonts/TTF/DroidSans.ttf \
151 $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/
152 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/DroidSans.ttf
153 ln -s /usr/share/fonts/TTF/DroidSans.ttf \
154 $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/
155 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts/DroidSans.ttf
156 ln -s /usr/share/fonts/TTF/DroidSans.ttf \
157 $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts/
159 # OpenZWave Control Panel temp file
160 ln -s %{_sharedstatedir}/%{name}/ozwcp.poll.XXXXXX.xml \
161 $RPM_BUILD_ROOT%{_datadir}/%{name}/ozwcp.poll.XXXXXX.xml
164 rm -rf $RPM_BUILD_ROOT
167 getent group domoticz >/dev/null || groupadd -r domoticz
168 getent passwd domoticz >/dev/null || \
169 useradd -r -g domoticz -d %{_datadir}/%{name} -s /sbin/nologin \
170 -c "Domoticz Home Automation Server" domoticz
171 # For OpenZWave USB access (/dev/ttyACM#)
172 usermod -G domoticz,dialout domoticz
175 %systemd_post %{name}.service
178 %systemd_preun %{name}.service
184 %defattr(644,root,root,755)
186 %doc README.md History.txt
187 %attr(755,root,root) %{_bindir}/%{name}
188 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
190 %attr(755,domoticz,domoticz) %{_sharedstatedir}/%{name}/
191 %{systemdunitdir}/%{name}.service