]> git.pld-linux.org Git - packages/domoticz.git/blame - domoticz.spec
- initial; from FC
[packages/domoticz.git] / domoticz.spec
CommitLineData
9dda6696
AM
1Summary: Open source Home Automation System
2Name: domoticz
3Version: 3.8153
4Release: 0.1
5License: GPLv3+ and ASL 2.0 and Boost and BSD and MIT
6Group: Base
7URL: http://www.domoticz.com
8Source0: https://github.com/domoticz/domoticz/archive/%{version}.tar.gz
9# Source0-md5: ad7b1d0491cd17e54bbe7368bcfd5170
10Source1: %{name}.service
11Source2: %{name}.conf
12# Source says its version 3.5876, but it's really 3.8153
13Patch1: %{name}-version.patch
14# Use system tinyxpath (https://github.com/domoticz/domoticz/pull/1759)
15Patch2: %{name}-tinyxpath.patch
16# Use system openzwave includes
17Patch3: %{name}-openzwave.patch
18# Work against Dev branch of OpenZWave upstream
19Patch4: %{name}-openzwave-Dev.patch
20# Fix python detection (https://github.com/domoticz/domoticz/pull/1749)
21Patch5: %{name}-python.patch
22BuildRequires: boost-devel
23BuildRequires: cmake
24BuildRequires: curl-devel
25BuildRequires: libmosquitto-devel
26BuildRequires: libmosquittopp-devel
27BuildRequires: libopenzwave-devel >= 1.5.0
28BuildRequires: libstdc++-devel
29BuildRequires: libusb-devel
30BuildRequires: lua-devel
31BuildRequires: openssl-devel
32BuildRequires: python3-devel
33BuildRequires: sqlite-devel
34BuildRequires: systemd-devel
35BuildRequires: tinyxpath-devel
36BuildRequires: zlib-devel
37
38Requires(pre): shadow-utils
39Requires(post): systemd
40Requires(postun): systemd
41Requires(preun): systemd
42
43Requires: google-droid-sans-fonts
44Suggests: system-python-libs >= 3.4
45
46Provides: bundled(js-ace)
47Provides: bundled(js-angular-ui-bootstrap) = 0.13.4
48Provides: bundled(js-angularamd) = 0.2.1
49Provides: bundled(js-angularjs) = 1.5.8
50Provides: bundled(js-blockly)
51Provides: bundled(js-bootbox)
52Provides: bundled(js-bootstrap) = 3.2.0
53Provides: bundled(js-colpick)
54Provides: bundled(js-d3)
55Provides: bundled(js-datatables-datatools) = 2.2.3
56Provides: bundled(js-dateformat) = 1.2.3
57Provides: bundled(js-filesaver) = 0.0-git20140725
58Provides: bundled(js-highcharts) = 4.2.6
59Provides: bundled(js-html5shiv) = 3.6.2
60Provides: bundled(js-i18next) = 1.8.0
61Provides: bundled(js-ion-sound) = 3.0.6
62Provides: bundled(js-jquery) = 1.12.0
63Provides: bundled(js-jquery-noty) = 2.1.0
64Provides: bundled(js-less) = 1.3.0
65Provides: bundled(js-ngdraggable)
66Provides: bundled(js-nggrid)
67Provides: bundled(js-ozwcp)
68Provides: bundled(js-require) = 2.1.14
69Provides: bundled(js-respond) = 1.1.0
70Provides: bundled(js-wow) = 0.1.9
71Provides: bundled(js-zeroclipboard) = 1.0.4
72
73%description
74Domoticz is a Home Automation System that lets you monitor and
75configure various devices like: Lights, Switches, various
76sensors/meters like Temperature, Rain, Wind, UV, Electra, Gas, Water
77and much more. Notifications/Alerts can be sent to any mobile device
78
79%prep
80%setup -q
81%patch1 -p1 -b.version
82%patch2 -p1 -b.tinyxpath
83%patch3 -p1 -b.openzwave
84%patch4 -p1 -b.openzwave-Dev
85%patch5 -p1 -b.python
86rm -f hardware/openzwave/*.h
87rm -rf hardware/openzwave/aes
88rm -rf hardware/openzwave/command_classes
89rm -rf hardware/openzwave/platform
90rm -rf hardware/openzwave/value_classes
91rm -rf sqlite/
92rm -rf tinyxpath/
93
94%build
95install -d build && cd build
96%cmake \
97 -DUSE_STATIC_LIBSTDCXX=NO \
98 -DUSE_STATIC_OPENZWAVE=NO \
99 -DUSE_BUILTIN_LUA=NO \
100 -DUSE_BUILTIN_MQTT=NO \
101 -DUSE_BUILTIN_SQLITE=NO \
102 -DUSE_BUILTIN_TINYXPATH=NO \
103 -DUSE_STATIC_BOOST=NO \
104 -DCMAKE_INSTALL_PREFIX=%{_datadir}/%{name} \
105 ..
106%{__make}
107
108%install
109rm -rf $RPM_BUILD_ROOT
110%{__make} -C build \
111 install
112
113# remove docs, we grab them in files below
114rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/*.txt
115
116# move binary to standard directory
117install -d $RPM_BUILD_ROOT%{_bindir}/
118mv $RPM_BUILD_ROOT%{_datadir}/%{name}/%{name} $RPM_BUILD_ROOT%{_bindir}/
119
120# install systemd service and config
121install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/
122install -d $RPM_BUILD_ROOT%{systemdunitdir}/
123cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/
124cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
125
126# create database/ssl cert directory
127install -d $RPM_BUILD_ROOT%{_sharedstatedir}/%{name}/
128
129# Disable the app's self-update script
130
131# Unbundle DroidSans.ttf
132rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/DroidSans.ttf
133ln -s %{_fontdir}/google-droid/DroidSans.ttf \
134 $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/elemental/fonts/
135rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/DroidSans.ttf
136ln -s %{_fontdir}/google-droid/DroidSans.ttf \
137 $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-light/fonts/
138rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts/DroidSans.ttf
139ln -s %{_fontdir}/google-droid/DroidSans.ttf \
140 $RPM_BUILD_ROOT%{_datadir}/%{name}/www/styles/element-dark/fonts/
141
142# OpenZWave Control Panel temp file
143ln -s %{_sharedstatedir}/%{name}/ozwcp.poll.XXXXXX.xml \
144 $RPM_BUILD_ROOT%{_datadir}/%{name}/ozwcp.poll.XXXXXX.xml
145
146%clean
147rm -rf $RPM_BUILD_ROOT
148
149%pre
150getent group domoticz >/dev/null || groupadd -r domoticz
151getent passwd domoticz >/dev/null || \
152useradd -r -g domoticz -d %{_datadir}/%{name} -s /sbin/nologin \
153-c "Domoticz Home Automation Server" domoticz
154# For OpenZWave USB access (/dev/ttyACM#)
155usermod -G domoticz,dialout domoticz
156
157%post
158%systemd_post %{name}.service
159
160%preun
161%systemd_preun %{name}.service
162
163%postun
164%systemd_postun_with_restart %{name}.service
165
166%files
167%defattr(644,root,root,755)
168%doc License.txt
169%doc README.md History.txt
170%attr(755,root,root) %{_bindir}/%{name}
171%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
172%{_datadir}/%{name}/
173%attr(755,domoticz,domoticz) %{_sharedstatedir}/%{name}/
174%{systemdunitdir}/%{name}.service
This page took 0.081338 seconds and 4 git commands to generate.