summaryrefslogtreecommitdiff
path: root/packaging/hal-rootstrap.spec
blob: 9d79f300d2efd07fbf1ab40621ce5168c5e3b7d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
%define name				hal-rootstrap
%define devel_name			hal-rootstrap-devel
%define hal_rootstrap_install_path	/opt/data/hal-rootstrap/common

%define headed_name				hal-rootstrap-headed
%define headed_devel_name			hal-rootstrap-headed-devel
%define hal_rootstrap_headed_install_path	/opt/data/hal-rootstrap/headed

Name:		hal-rootstrap
Summary:	Package for rootstrap of hal
Version:	0.1.0
Release:	1
#Group: 
License:	Apache-2.0
Source0:	%{name}-%{version}.tar.gz
Source1:	hal-rootstrap-checker.sh
Source2:	hal-rootstrap-checker.yaml
Source3:	hal-rootstrap-checker-rpmmacros
AutoReqProv:    no

BuildRequires:	cmake
BuildRequires:	xmlstarlet
BuildRequires:	python3

BuildRequires:	hal-rootstrap-common

### hal-rootstrap
%description
Package for rootstrap of hal

### hal-rootstrap-devel
%package -n	%{devel_name}
Summary:	%{name} interface
Group:		Development/Libraries
Requires:	%{name} = %{version}-%{release}

%description -n	%{devel_name}
%{name} Interface for product vendor developer

### hal-rootstrap-checker
%package checker
Summary:	%{name} checker
Group:		System/Base
#Requires:	hal-rootstrap-checker-plugin-conf

%description checker
Checker for the hal rootstrap

### hal-rootstrap-headed
%package -n	%{headed_name}
Summary:	Package for rootstrap of hal, for headed image

%description -n	%{headed_name}
Package for rootstrap of hal, for headed image

### hal-rootstrap-headed-devel
%package -n	%{headed_devel_name}
Summary:	%{headed_name} interface
Group:		Development/Libraries
Requires:	%{headed_name} = %{version}-%{release}

%description -n	%{headed_devel_name}
${headed_name} Interface for product vendor developer

%prep
%setup -q
%cmake . -DCMAKE_LIBDIR_PREFIX=%{_libdir}

%build
make %{?jobs:-j%jobs}

%install
rm -rf %{buildroot}
mkdir %{buildroot}
mkdir -p %{buildroot}%{_libdir}/pkgconfig/

# hal-rootstrap
./generate_rootstrap.sh "%{_arch}" "common" "%{buildroot}%{hal_rootstrap_install_path}"
cp packaging/hal-rootstrap.pc %{buildroot}%{_libdir}/pkgconfig/
./modify_pc.py "%{buildroot}%{_libdir}/pkgconfig/hal-rootstrap.pc" "%{buildroot}%{hal_rootstrap_install_path}/%{_libdir}/pkgconfig"
rm -f "%{buildroot}%{hal_rootstrap_install_path}/%{_libdir}/pkgconfig/*.pc"

# hal-rootstrap-headed
./generate_rootstrap.sh "%{_arch}" "headed" "%{buildroot}%{hal_rootstrap_headed_install_path}"
cp packaging/hal-rootstrap-headed.pc %{buildroot}%{_libdir}/pkgconfig/
./modify_pc.py "%{buildroot}%{_libdir}/pkgconfig/hal-rootstrap-headed.pc" "%{buildroot}%{hal_rootstrap_headed_install_path}/%{_libdir}/pkgconfig"
rm -f "%{buildroot}%{hal_rootstrap_headed_install_path}/%{_libdir}/pkgconfig/*.pc"

mkdir -p %{buildroot}%{_sysconfdir}/hal/rootstrap
install -m 755 %{SOURCE1} %{buildroot}%{_sysconfdir}/hal/rootstrap
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/hal/rootstrap
install -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/hal/rootstrap

%post checker
ln -sf %{_sysconfdir}/hal/rootstrap/hal-rootstrap-checker-rpmmacros %{_sysconfdir}/rpm/macros.hal-rootstrap-checker

%postun checker
rm -f %{_sysconfdir}/rpm/macros.hal-rootstrap-checker

%files
%{hal_rootstrap_install_path}
%exclude %dir %{hal_rootstrap_install_path}/%{_includedir}

%files	-n %{devel_name}
%defattr(-,root,root,-)
%{hal_rootstrap_install_path}/%{_includedir}
%{_libdir}/pkgconfig/hal-rootstrap.pc

%files -n %{headed_name}
%{hal_rootstrap_headed_install_path}
%exclude %dir %{hal_rootstrap_headed_install_path}/%{_includedir}

%files	-n %{headed_devel_name}
%defattr(-,root,root,-)
%{hal_rootstrap_headed_install_path}/%{_includedir}
%{_libdir}/pkgconfig/hal-rootstrap-headed.pc

%files checker
%defattr(-,root,root,-)
%{_sysconfdir}/hal/rootstrap/hal-rootstrap-checker.sh
%{_sysconfdir}/hal/rootstrap/hal-rootstrap-checker.yaml
%{_sysconfdir}/hal/rootstrap/hal-rootstrap-checker-rpmmacros