]> git.pld-linux.org Git - packages/domoticz.git/blob - domoticz.spec
drop unused patches
[packages/domoticz.git] / domoticz.spec
1 Summary:        Open source Home Automation System
2 Name:           domoticz
3 Version:        2020.2
4 Release:        3
5 License:        GPLv3+ and ASL 2.0 and Boost and BSD and MIT
6 Group:          Base
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
11 Source2:        %{name}.conf
12 # Use system tinyxpath (https://github.com/domoticz/domoticz/pull/1759)
13 Patch0:         %{name}-tinyxpath.patch
14 # Use system openzwave includes
15 Patch1:         %{name}-openzwave.patch
16 # Fix python detection (https://github.com/domoticz/domoticz/pull/1749)
17 Patch2:         %{name}-python.patch
18 Patch3:         no-git.patch
19 Patch4:         boost-1.73.patch
20 BuildRequires:  boost-devel >= 1.66.0
21 BuildRequires:  cereal-devel
22 BuildRequires:  cmake >= 3.16.0
23 BuildRequires:  curl-devel
24 BuildRequires:  jsoncpp-devel
25 BuildRequires:  libmosquitto-devel
26 BuildRequires:  libopenzwave-devel >= 1.5.0
27 BuildRequires:  libstdc++-devel >= 6:4.8.1
28 BuildRequires:  libusb-compat-devel
29 BuildRequires:  linux-libc-headers
30 BuildRequires:  lua53-devel
31 BuildRequires:  minizip-devel
32 BuildRequires:  openssl-devel
33 BuildRequires:  pkgconfig
34 BuildRequires:  python3 >= 1:3.4
35 BuildRequires:  python3-devel >= 1:3.4
36 BuildRequires:  sqlite3-devel
37 BuildRequires:  tinyxml-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 Requires:       libopenzwave >= 1.5.0
47 Provides:       bundled(js-ace)
48 Provides:       bundled(js-angular-ui-bootstrap) = 0.13.4
49 Provides:       bundled(js-angularamd) = 0.2.1
50 Provides:       bundled(js-angularjs) = 1.5.8
51 Provides:       bundled(js-blockly)
52 Provides:       bundled(js-bootbox)
53 Provides:       bundled(js-bootstrap) = 3.2.0
54 Provides:       bundled(js-colpick)
55 Provides:       bundled(js-d3)
56 Provides:       bundled(js-datatables-datatools) = 2.2.3
57 Provides:       bundled(js-dateformat) = 1.2.3
58 Provides:       bundled(js-filesaver) = 0.0-git20140725
59 Provides:       bundled(js-highcharts) = 4.2.6
60 Provides:       bundled(js-html5shiv) = 3.6.2
61 Provides:       bundled(js-i18next) = 1.8.0
62 Provides:       bundled(js-ion-sound) = 3.0.6
63 Provides:       bundled(js-jquery) = 1.12.0
64 Provides:       bundled(js-jquery-noty) = 2.1.0
65 Provides:       bundled(js-less) = 1.3.0
66 Provides:       bundled(js-ngdraggable)
67 Provides:       bundled(js-nggrid)
68 Provides:       bundled(js-ozwcp)
69 Provides:       bundled(js-require) = 2.1.14
70 Provides:       bundled(js-respond) = 1.1.0
71 Provides:       bundled(js-wow) = 0.1.9
72 Provides:       bundled(js-zeroclipboard) = 1.0.4
73
74 %description
75 Domoticz is a Home Automation System that lets you monitor and
76 configure various devices like: Lights, Switches, various
77 sensors/meters like Temperature, Rain, Wind, UV, Electra, Gas, Water
78 and much more. Notifications/Alerts can be sent to any mobile device
79
80 %prep
81 %setup -q
82 %patch0 -p1
83 %patch1 -p1
84 %patch2 -p1
85 %patch3 -p1
86 %patch4 -p1
87
88 APPVERSION="%{version}"
89 echo "#define APPVERSION ${APPVERSION##*.}" > appversion.h
90 echo '#define APPHASH "%{snap}"' >> appversion.h
91 APPDATE=$(date --date="%{date}" "+%s")
92 echo "#define APPDATE ${APPDATE}" >> appversion.h
93
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
99 rm -rf sqlite/
100 rm -rf tinyxpath/
101
102 %build
103 install -d build && cd build
104 %cmake \
105         -DUSE_BUILTIN_JSONCPP=NO \
106         -DUSE_BUILTIN_MINIZIP=NO \
107         -DUSE_BUILTIN_MQTT=NO \
108         -DUSE_BUILTIN_SQLITE=NO \
109         -DUSE_BUILTIN_TINYXPATH=NO \
110         -DUSE_LUA_STATIC=NO \
111         -DUSE_OPENSSL_STATIC=NO \
112         -DUSE_STATIC_BOOST=NO \
113         -DUSE_STATIC_LIBSTDCXX=NO \
114         -DUSE_STATIC_OPENZWAVE=NO \
115         -DCMAKE_INSTALL_PREFIX=%{_datadir}/%{name} \
116         ..
117
118 %{__make}
119
120 %install
121 rm -rf $RPM_BUILD_ROOT
122 %{__make} -C build install \
123       DESTDIR=$RPM_BUILD_ROOT
124
125 # remove docs, we grab them in files below
126 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/*.txt
127
128 # move binary to standard directory
129 install -d $RPM_BUILD_ROOT%{_bindir}/
130 mv $RPM_BUILD_ROOT%{_datadir}/%{name}/%{name} $RPM_BUILD_ROOT%{_bindir}/
131
132 # install systemd service and config
133 install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/
134 install -d $RPM_BUILD_ROOT%{systemdunitdir}/
135 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/
136 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
137
138 # create database/ssl cert directory
139 install -d $RPM_BUILD_ROOT%{_sharedstatedir}/%{name}/
140
141 # Disable the app's self-update script
142
143 # Unbundle DroidSans.ttf
144 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/DroidSans.ttf
145 ln -s /usr/share/fonts/TTF/DroidSans.ttf \
146       $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/
147 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/DroidSans.ttf
148 ln -s /usr/share/fonts/TTF/DroidSans.ttf \
149       $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/
150 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts/DroidSans.ttf
151 ln -s /usr/share/fonts/TTF/DroidSans.ttf \
152       $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts/
153
154 # OpenZWave Control Panel temp file
155 ln -s %{_sharedstatedir}/%{name}/ozwcp.poll.XXXXXX.xml \
156       $RPM_BUILD_ROOT%{_datadir}/%{name}/ozwcp.poll.XXXXXX.xml
157
158 %clean
159 rm -rf $RPM_BUILD_ROOT
160
161 %pre
162 getent group domoticz >/dev/null || groupadd -r domoticz
163 getent passwd domoticz >/dev/null || \
164 useradd -r -g domoticz -d %{_datadir}/%{name} -s /sbin/nologin \
165 -c "Domoticz Home Automation Server" domoticz
166 # For OpenZWave USB access (/dev/ttyACM#)
167 usermod -G domoticz,dialout domoticz
168
169 %post
170 %systemd_post %{name}.service
171
172 %preun
173 %systemd_preun %{name}.service
174
175 %postun
176 %systemd_reload
177
178 %files
179 %defattr(644,root,root,755)
180 %doc License.txt
181 %doc README.md History.txt
182 %attr(755,root,root) %{_bindir}/%{name}
183 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
184 %{_datadir}/%{name}/
185 %attr(755,domoticz,domoticz) %{_sharedstatedir}/%{name}/
186 %{systemdunitdir}/%{name}.service
This page took 0.058592 seconds and 4 git commands to generate.