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