9f4806842605abd16d191ab2f03bddeaaa8837b0
[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 BuildRequires:  cmake
18
19 %description
20 PASS hal for TM2
21
22 %prep
23 %setup -q
24 cp %{SOURCE1} .
25
26 %build
27 %cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DHAL_VERSION=%{version}.%{release}
28
29 make %{?jobs:-j%jobs}
30
31 %install
32 rm -rf %{buildroot}
33
34 %make_install
35
36 %post
37 /sbin/ldconfig
38 systemd-tmpfiles /usr/lib/tmpfiles.d/pass-hal.conf --create
39 if [ -f %{_unitdir}/pass.service ]; then
40         systemctl | grep pass.service  | awk '{if ($3 == "active" && $4 == "running") system("systemctl restart pass.service")}'
41 fi
42
43 %postun
44 /sbin/ldconfig
45 if [ -f %{_unitdir}/pass.service ]; then
46         systemctl | grep pass.service  | awk '{if ($3 == "active" && $4 == "running") system("systemctl restart pass.service")}'
47 fi
48
49 %files
50 %manifest %{name}.manifest
51 /usr/lib/tmpfiles.d/pass-hal.conf
52
53 %config %{_sysconfdir}/pass/pass.conf
54 %config %{_sysconfdir}/pass/pass-resource0.conf
55 %config %{_sysconfdir}/pass/pass-resource1.conf
56 %config %{_sysconfdir}/pass/pass-resource2.conf
57 %config %{_sysconfdir}/pass/pass-resource3.conf
58 %config %{_sysconfdir}/pass/pass-resource4.conf