b7c152f0b308589379d40b8a4d75ed519ef947eb
[platform/core/system/initrd-recovery.git] / packaging / initrd-recovery.spec
1 Name:           initrd-recovery
2 Summary:        Tools for system recovery
3 Version:        0.3.0
4 Release:        0
5 Group:          System/Utilities
6 License:        Apache-2.0
7 ExclusiveArch:  %{arm}
8
9 Source0:        %{name}-%{version}.tar.gz
10 Source1001:     initrd-recovery.manifest
11
12 BuildRequires:  cmake
13
14 %description
15 This is a special booting mode and executes system recovery mode on user
16 selection like safe mode or phone initialization.
17
18 %package -n reboot-param-helper
19 Summary:        Reboot Param Helper Using Inform Partition
20 Group:          System/Utilities
21 License:        Apache-2.0
22 %description -n reboot-param-helper
23 A reboot helper to use reboot parameter by inform partition
24
25 %prep
26 %setup -q
27
28 %define initrd_recovery_libexec_dir %{_libexecdir}/initrd-recovery
29 %define initrd_recovery_install_dropin_dir %{_datadir}/initrd-recovery/initrd.list.d
30 %define minireboot_binary_name minireboot
31
32 %build
33 cp %{SOURCE1001} .
34
35 %cmake . \
36                 -DINITRD_RECOVERY_LIBEXEC_DIR=%{initrd_recovery_libexec_dir} \
37                 -DINITRD_RECOVERY_INSTALL_DROPIN_DIR=%{initrd_recovery_install_dropin_dir} \
38                 -DINITRD_RECOVERY_SRC_DIR=src/initrd-recovery \
39                 -DMINIREBOOT_SRC_DIR=src/minireboot
40
41 make %{?_smp_mflags}
42
43 %install
44 %make_install
45
46 # reboot-param-helper
47 %define inform_path /mnt/inform
48 mkdir -p %{buildroot}%{inform_path}
49 mkdir -p %{buildroot}%{_unitdir}/local-fs.target.wants
50 install -m 644 units/mnt-inform.mount %{buildroot}%{_unitdir}
51 ln -s ../mnt-inform.mount %{buildroot}%{_unitdir}/local-fs.target.wants
52
53 %posttrans
54 %{initrd_recovery_libexec_dir}/mkinitrd-recovery.sh
55 rm -rf %{initrd_recovery_libexec_dir}
56 rm -rf %{_datadir}/initrd-recovery
57
58 %files
59 %defattr(-,root,root,-)
60 %manifest initrd-recovery.manifest
61 %license LICENSE
62 %{initrd_recovery_install_dropin_dir}/00-initrd-recovery.list
63 %attr(0775,root,root)%{initrd_recovery_libexec_dir}/init
64 %attr(0775,root,root)%{initrd_recovery_libexec_dir}/mkinitrd-recovery.sh
65 %attr(0775,root,root)%{initrd_recovery_libexec_dir}/minireboot
66
67 %files -n reboot-param-helper
68 %{_unitdir}/mnt-inform.mount
69 %{_unitdir}/local-fs.target.wants/mnt-inform.mount
70 %{inform_path}