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