pass-hal: tm2: Add dependency on PASS and PASS standard HAL
[platform/adaptation/tm2/pass-hal-tm2.git] / packaging / pass-hal-tm2.spec
1 %define version 0.0.1
2 %define release 1
3
4 Name:       pass-hal-tm2
5 Summary:    PASS hal for TM2
6 Version:    %{version}
7 Release:    %{release}
8 Group:      System/Hardware Adaptation
9 License:    Apache-2.0
10 Source0:    %{name}-%{version}.tar.gz
11 Source1:    %{name}.manifest
12
13 ExclusiveArch: %{arm} aarch64
14
15 Requires(post): /sbin/ldconfig
16 Requires(postun): /sbin/ldconfig
17 Requires: pass >= 0.0.1
18 Requires: pass-hal-standard >= 0.0.1
19 BuildRequires:  cmake
20
21 %description
22 PASS hal for TM2
23
24 %prep
25 %setup -q
26 cp %{SOURCE1} .
27
28 %build
29 %cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DHAL_VERSION=%{version}.%{release}
30
31 make %{?jobs:-j%jobs}
32
33 %install
34 rm -rf %{buildroot}
35
36 %make_install
37
38 %post
39 /sbin/ldconfig
40 systemd-tmpfiles /usr/lib/tmpfiles.d/pass-hal.conf --create
41 if [ -f %{_unitdir}/pass.service ]; then
42         systemctl | grep pass.service  | awk '{if ($3 == "active" && $4 == "running") system("systemctl restart pass.service")}'
43 fi
44
45 %postun
46 /sbin/ldconfig
47 if [ -f %{_unitdir}/pass.service ]; then
48         systemctl | grep pass.service  | awk '{if ($3 == "active" && $4 == "running") system("systemctl restart pass.service")}'
49 fi
50
51 %files
52 %manifest %{name}.manifest
53 /usr/lib/tmpfiles.d/pass-hal.conf
54
55 %config %{_sysconfdir}/pass/pass.conf
56 %config %{_sysconfdir}/pass/pass-resource0.conf
57 %config %{_sysconfdir}/pass/pass-resource1.conf
58 %config %{_sysconfdir}/pass/pass-resource2.conf
59 %config %{_sysconfdir}/pass/pass-resource3.conf
60 %config %{_sysconfdir}/pass/pass-resource4.conf