]>
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 |
4987f952 | 21 | BuildRequires: boost-devel >= 1.66.0 |
72784cf7 | 22 | BuildRequires: cereal-devel |
4987f952 | 23 | BuildRequires: cmake >= 3.16.0 |
9dda6696 | 24 | BuildRequires: curl-devel |
4987f952 | 25 | BuildRequires: jsoncpp-devel |
9dda6696 | 26 | BuildRequires: libmosquitto-devel |
9dda6696 | 27 | BuildRequires: libopenzwave-devel >= 1.5.0 |
4987f952 JP |
28 | BuildRequires: libstdc++-devel >= 6:4.8.1 |
29 | BuildRequires: libusb-compat-devel | |
30 | BuildRequires: linux-libc-headers | |
31 | BuildRequires: lua53-devel | |
72784cf7 | 32 | BuildRequires: minizip-devel |
9dda6696 | 33 | BuildRequires: openssl-devel |
4987f952 JP |
34 | BuildRequires: pkgconfig |
35 | BuildRequires: python3 >= 1:3.4 | |
36 | BuildRequires: python3-devel >= 1:3.4 | |
37 | BuildRequires: sqlite3-devel | |
38 | BuildRequires: tinyxml-devel | |
9dda6696 AM |
39 | BuildRequires: tinyxpath-devel |
40 | BuildRequires: zlib-devel | |
0e22aa87 JP |
41 | Requires(pre): /usr/sbin/groupadd |
42 | Requires(pre): /usr/sbin/useradd | |
43 | Requires(post,preun,postun): systemd-units >= 38 | |
44 | Requires: fonts-TTF-Google-Droid | |
4987f952 | 45 | Requires: libopenzwave >= 1.5.0 |
ed4fe787 JP |
46 | Provides: group(domoticz) |
47 | Provides: user(domoticz) | |
9dda6696 AM |
48 | |
49 | %description | |
50 | Domoticz is a Home Automation System that lets you monitor and | |
51 | configure various devices like: Lights, Switches, various | |
52 | sensors/meters like Temperature, Rain, Wind, UV, Electra, Gas, Water | |
53 | and much more. Notifications/Alerts can be sent to any mobile device | |
54 | ||
55 | %prep | |
72784cf7 | 56 | %setup -q |
bc226567 JP |
57 | %patch0 -p1 |
58 | %patch1 -p1 | |
59 | %patch2 -p1 | |
60 | %patch3 -p1 | |
61 | %patch4 -p1 | |
c8cb4cfe | 62 | %patch5 -p1 |
10f7a92e AM |
63 | |
64 | APPVERSION="%{version}" | |
65 | echo "#define APPVERSION ${APPVERSION##*.}" > appversion.h | |
66 | echo '#define APPHASH "%{snap}"' >> appversion.h | |
67 | APPDATE=$(date --date="%{date}" "+%s") | |
68 | echo "#define APPDATE ${APPDATE}" >> appversion.h | |
69 | ||
0e22aa87 | 70 | %{__rm} -r extern tinyxpath |
9dda6696 AM |
71 | |
72 | %build | |
73 | install -d build && cd build | |
74 | %cmake \ | |
4987f952 JP |
75 | -DUSE_BUILTIN_JSONCPP=NO \ |
76 | -DUSE_BUILTIN_MINIZIP=NO \ | |
71593ba7 JR |
77 | -DUSE_BUILTIN_MQTT=NO \ |
78 | -DUSE_BUILTIN_SQLITE=NO \ | |
79 | -DUSE_BUILTIN_TINYXPATH=NO \ | |
4987f952 JP |
80 | -DUSE_LUA_STATIC=NO \ |
81 | -DUSE_OPENSSL_STATIC=NO \ | |
71593ba7 | 82 | -DUSE_STATIC_BOOST=NO \ |
4987f952 JP |
83 | -DUSE_STATIC_LIBSTDCXX=NO \ |
84 | -DUSE_STATIC_OPENZWAVE=NO \ | |
71593ba7 JR |
85 | -DCMAKE_INSTALL_PREFIX=%{_datadir}/%{name} \ |
86 | .. | |
00bce45c | 87 | |
9dda6696 AM |
88 | %{__make} |
89 | ||
90 | %install | |
91 | rm -rf $RPM_BUILD_ROOT | |
0e22aa87 | 92 | |
00bce45c | 93 | %{__make} -C build install \ |
0e22aa87 JP |
94 | DESTDIR=$RPM_BUILD_ROOT |
95 | ||
96 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_sysconfdir}/sysconfig,%{systemdunitdir},%{_sharedstatedir}/%{name}} | |
9dda6696 AM |
97 | |
98 | # remove docs, we grab them in files below | |
0e22aa87 | 99 | %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/*.txt |
9dda6696 AM |
100 | |
101 | # move binary to standard directory | |
0e22aa87 | 102 | mv $RPM_BUILD_ROOT%{_datadir}/%{name}/%{name} $RPM_BUILD_ROOT%{_bindir} |
9dda6696 | 103 | |
0e22aa87 | 104 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir} |
9dda6696 AM |
105 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name} |
106 | ||
9dda6696 | 107 | # Unbundle DroidSans.ttf |
0e22aa87 JP |
108 | %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element{al,-light,-dark}/fonts/DroidSans.ttf |
109 | ln -s %{_fontsdir}/TTF/DroidSans.ttf \ | |
110 | $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts | |
111 | ln -s %{_fontsdir}/TTF/DroidSans.ttf \ | |
112 | $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts | |
113 | ln -s %{_fontsdir}/TTF/DroidSans.ttf \ | |
114 | $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts | |
9dda6696 AM |
115 | |
116 | # OpenZWave Control Panel temp file | |
117 | ln -s %{_sharedstatedir}/%{name}/ozwcp.poll.XXXXXX.xml \ | |
0e22aa87 | 118 | $RPM_BUILD_ROOT%{_datadir}/%{name}/ozwcp.poll.XXXXXX.xml |
9dda6696 AM |
119 | |
120 | %clean | |
121 | rm -rf $RPM_BUILD_ROOT | |
122 | ||
123 | %pre | |
ed4fe787 JP |
124 | %groupadd -g 342 domoticz |
125 | %useradd -u 342 -r -d %{_datadir} -s /bin/false -c "Domoticz Home Automation Server" -G dialout -g domoticz domoticz | |
9dda6696 AM |
126 | |
127 | %post | |
128 | %systemd_post %{name}.service | |
129 | ||
130 | %preun | |
131 | %systemd_preun %{name}.service | |
132 | ||
133 | %postun | |
ed4fe787 JP |
134 | if [ "$1" = "0" ]; then |
135 | %userremove mpd | |
136 | %groupremove mpd | |
137 | fi | |
5ac2f181 | 138 | %systemd_reload |
9dda6696 AM |
139 | |
140 | %files | |
141 | %defattr(644,root,root,755) | |
0e22aa87 | 142 | %doc License.txt README.md History.txt |
9dda6696 AM |
143 | %attr(755,root,root) %{_bindir}/%{name} |
144 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} | |
0e22aa87 JP |
145 | %{_datadir}/%{name} |
146 | %dir %attr(750,domoticz,domoticz) %{_sharedstatedir}/%{name} | |
9dda6696 | 147 | %{systemdunitdir}/%{name}.service |