]>
Commit | Line | Data |
---|---|---|
9dda6696 AM |
1 | Summary: Open source Home Automation System |
2 | Name: domoticz | |
72784cf7 | 3 | Version: 2020.2 |
0abc31de | 4 | Release: 3 |
9dda6696 AM |
5 | License: GPLv3+ and ASL 2.0 and Boost and BSD and MIT |
6 | Group: Base | |
7 | URL: http://www.domoticz.com | |
72784cf7 AM |
8 | Source0: https://github.com/domoticz/domoticz/archive/%{version}.tar.gz |
9 | # Source0-md5: fd383a13d13d0976c72f332d6db1d24e | |
9dda6696 AM |
10 | Source1: %{name}.service |
11 | Source2: %{name}.conf | |
9dda6696 | 12 | # Use system tinyxpath (https://github.com/domoticz/domoticz/pull/1759) |
bc226567 | 13 | Patch0: %{name}-tinyxpath.patch |
9dda6696 | 14 | # Use system openzwave includes |
bc226567 | 15 | Patch1: %{name}-openzwave.patch |
9dda6696 | 16 | # Fix python detection (https://github.com/domoticz/domoticz/pull/1749) |
bc226567 JP |
17 | Patch2: %{name}-python.patch |
18 | Patch3: no-git.patch | |
19 | Patch4: boost-1.73.patch | |
c8cb4cfe | 20 | Patch5: %{name}-gpio.patch |
2fd2c1d4 | 21 | Patch6: python3.9.patch |
e7e8ea24 | 22 | Patch7: %{name}-no_updates.patch |
4987f952 | 23 | BuildRequires: boost-devel >= 1.66.0 |
72784cf7 | 24 | BuildRequires: cereal-devel |
4987f952 | 25 | BuildRequires: cmake >= 3.16.0 |
9dda6696 | 26 | BuildRequires: curl-devel |
4987f952 | 27 | BuildRequires: jsoncpp-devel |
9dda6696 | 28 | BuildRequires: libmosquitto-devel |
9dda6696 | 29 | BuildRequires: libopenzwave-devel >= 1.5.0 |
4987f952 JP |
30 | BuildRequires: libstdc++-devel >= 6:4.8.1 |
31 | BuildRequires: libusb-compat-devel | |
32 | BuildRequires: linux-libc-headers | |
33 | BuildRequires: lua53-devel | |
72784cf7 | 34 | BuildRequires: minizip-devel |
9dda6696 | 35 | BuildRequires: openssl-devel |
4987f952 JP |
36 | BuildRequires: pkgconfig |
37 | BuildRequires: python3 >= 1:3.4 | |
38 | BuildRequires: python3-devel >= 1:3.4 | |
f5d0e494 | 39 | BuildRequires: rpmbuild(macros) >= 1.644 |
4987f952 JP |
40 | BuildRequires: sqlite3-devel |
41 | BuildRequires: tinyxml-devel | |
9dda6696 AM |
42 | BuildRequires: tinyxpath-devel |
43 | BuildRequires: zlib-devel | |
0e22aa87 JP |
44 | Requires(pre): /usr/sbin/groupadd |
45 | Requires(pre): /usr/sbin/useradd | |
46 | Requires(post,preun,postun): systemd-units >= 38 | |
47 | Requires: fonts-TTF-Google-Droid | |
e9c32406 | 48 | Requires: fonts-TTF-OpenSans |
4987f952 | 49 | Requires: libopenzwave >= 1.5.0 |
a1c25c45 | 50 | Requires: setup >= 2.10.1 |
ed4fe787 JP |
51 | Provides: group(domoticz) |
52 | Provides: user(domoticz) | |
9dda6696 AM |
53 | |
54 | %description | |
55 | Domoticz is a Home Automation System that lets you monitor and | |
56 | configure various devices like: Lights, Switches, various | |
57 | sensors/meters like Temperature, Rain, Wind, UV, Electra, Gas, Water | |
58 | and much more. Notifications/Alerts can be sent to any mobile device | |
59 | ||
60 | %prep | |
72784cf7 | 61 | %setup -q |
bc226567 JP |
62 | %patch0 -p1 |
63 | %patch1 -p1 | |
64 | %patch2 -p1 | |
65 | %patch3 -p1 | |
66 | %patch4 -p1 | |
c8cb4cfe | 67 | %patch5 -p1 |
2fd2c1d4 | 68 | %patch6 -p1 |
e7e8ea24 | 69 | %patch7 -p1 |
10f7a92e AM |
70 | |
71 | APPVERSION="%{version}" | |
72 | echo "#define APPVERSION ${APPVERSION##*.}" > appversion.h | |
73 | echo '#define APPHASH "%{snap}"' >> appversion.h | |
74 | APPDATE=$(date --date="%{date}" "+%s") | |
75 | echo "#define APPDATE ${APPDATE}" >> appversion.h | |
76 | ||
0e22aa87 | 77 | %{__rm} -r extern tinyxpath |
9dda6696 AM |
78 | |
79 | %build | |
80 | install -d build && cd build | |
81 | %cmake \ | |
4987f952 JP |
82 | -DUSE_BUILTIN_JSONCPP=NO \ |
83 | -DUSE_BUILTIN_MINIZIP=NO \ | |
71593ba7 JR |
84 | -DUSE_BUILTIN_MQTT=NO \ |
85 | -DUSE_BUILTIN_SQLITE=NO \ | |
86 | -DUSE_BUILTIN_TINYXPATH=NO \ | |
4987f952 JP |
87 | -DUSE_LUA_STATIC=NO \ |
88 | -DUSE_OPENSSL_STATIC=NO \ | |
71593ba7 | 89 | -DUSE_STATIC_BOOST=NO \ |
4987f952 JP |
90 | -DUSE_STATIC_LIBSTDCXX=NO \ |
91 | -DUSE_STATIC_OPENZWAVE=NO \ | |
71593ba7 JR |
92 | -DCMAKE_INSTALL_PREFIX=%{_datadir}/%{name} \ |
93 | .. | |
00bce45c | 94 | |
9dda6696 AM |
95 | %{__make} |
96 | ||
97 | %install | |
98 | rm -rf $RPM_BUILD_ROOT | |
0e22aa87 | 99 | |
00bce45c | 100 | %{__make} -C build install \ |
0e22aa87 JP |
101 | DESTDIR=$RPM_BUILD_ROOT |
102 | ||
103 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_sysconfdir}/sysconfig,%{systemdunitdir},%{_sharedstatedir}/%{name}} | |
9dda6696 AM |
104 | |
105 | # remove docs, we grab them in files below | |
0e22aa87 | 106 | %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/*.txt |
9dda6696 AM |
107 | |
108 | # move binary to standard directory | |
0e22aa87 | 109 | mv $RPM_BUILD_ROOT%{_datadir}/%{name}/%{name} $RPM_BUILD_ROOT%{_bindir} |
9dda6696 | 110 | |
0e22aa87 | 111 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir} |
9dda6696 AM |
112 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name} |
113 | ||
9dda6696 | 114 | # Unbundle DroidSans.ttf |
e9c32406 | 115 | %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element{al,-light,-dark}/fonts/{Droid,Open}Sans.ttf |
0e22aa87 JP |
116 | ln -s %{_fontsdir}/TTF/DroidSans.ttf \ |
117 | $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts | |
e9c32406 JP |
118 | ln -s %{_fontsdir}/TTF/OpenSans-Regular.ttf \ |
119 | $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/OpenSans.ttf | |
0e22aa87 JP |
120 | ln -s %{_fontsdir}/TTF/DroidSans.ttf \ |
121 | $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts | |
e9c32406 JP |
122 | ln -s %{_fontsdir}/TTF/OpenSans-Regular.ttf \ |
123 | $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/OpenSans.ttf | |
0e22aa87 JP |
124 | ln -s %{_fontsdir}/TTF/DroidSans.ttf \ |
125 | $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts | |
e9c32406 JP |
126 | ln -s %{_fontsdir}/TTF/OpenSans-Regular.ttf \ |
127 | $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts/OpenSans.ttf | |
9dda6696 AM |
128 | |
129 | # OpenZWave Control Panel temp file | |
130 | ln -s %{_sharedstatedir}/%{name}/ozwcp.poll.XXXXXX.xml \ | |
0e22aa87 | 131 | $RPM_BUILD_ROOT%{_datadir}/%{name}/ozwcp.poll.XXXXXX.xml |
9dda6696 AM |
132 | |
133 | %clean | |
134 | rm -rf $RPM_BUILD_ROOT | |
135 | ||
136 | %pre | |
ed4fe787 | 137 | %groupadd -g 342 domoticz |
a1c25c45 | 138 | %useradd -u 342 -r -d %{_datadir} -s /bin/false -c "Domoticz Home Automation Server" -G dialout,i2c -g domoticz domoticz |
9dda6696 AM |
139 | |
140 | %post | |
141 | %systemd_post %{name}.service | |
142 | ||
143 | %preun | |
144 | %systemd_preun %{name}.service | |
145 | ||
146 | %postun | |
ed4fe787 JP |
147 | if [ "$1" = "0" ]; then |
148 | %userremove mpd | |
149 | %groupremove mpd | |
150 | fi | |
5ac2f181 | 151 | %systemd_reload |
9dda6696 AM |
152 | |
153 | %files | |
154 | %defattr(644,root,root,755) | |
0e22aa87 | 155 | %doc License.txt README.md History.txt |
9dda6696 AM |
156 | %attr(755,root,root) %{_bindir}/%{name} |
157 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} | |
0e22aa87 JP |
158 | %{_datadir}/%{name} |
159 | %dir %attr(750,domoticz,domoticz) %{_sharedstatedir}/%{name} | |
9dda6696 | 160 | %{systemdunitdir}/%{name}.service |