summaryrefslogtreecommitdiff
path: root/packaging/mic-bootstrap.spec
blob: 42e751deb12fd2bbb4829d850e092c6c0fe6e5b8 (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
%define _build_name_fmt    %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.vanish.rpm
%define __os_install_post %{nil}
%define nodebug 1

Name:		mic-bootstrap
Version:	1.0
Release:	0
AutoReqProv:    0
Provides:       %{name}
ExclusiveArch:  x86_64 %ix86

Summary:	mic bootstrap
Group:		System/Tools
License:	GPLv2
URL:		http://www.tizen.org/
Source100:      baselibs.conf
Source101:      rpmlintrc

BuildRequires:	rpm
#BuildRequires:	!rpmlint !rpmlint-min !rpmlint-tizen
BuildRequires:  python-rpm
BuildRequires:  python-zypp
BuildRequires:  kmod-compat
BuildRequires:  mic
#BuildRequires:  busybox
BuildRequires:  rpm-security-plugin
BuildRequires:  bmap-tools
BuildRequires:  e2fsprogs
BuildRequires:  kpartx
BuildRequires:  dosfstools
BuildRequires:  parted
BuildRequires:  zip
BuildRequires:  openssl1.1
BuildRequires:  btrfs-progs
BuildRequires:  squashfs
BuildRequires:  cryptsetup
BuildRequires:  verity-tools
BuildRequires:  f2fs-tools
BuildRequires:  curl

%description
used for mic bootstrap, this package will be repackaged for i586 and arm libs.
it provides a x86 bootstrap environment for unified usage, especially to speed
up the performance of arm image creation.

%prep

%build

%install
%if %nodebug
set +x
%endif

mkdir -p %buildroot
mkdir -p %buildroot/bootstrap
rpm -qla > filestoinclude1

# ignore files - construct sed script
sedtmp="sedtmp.$$"
echo "s#^%{_docdir}.*##" >> $sedtmp
echo "s#^%{_mandir}.*##" >> $sedtmp
echo "s#^%{_infodir}.*##" >> $sedtmp
# ignore pyc and pyo
echo "s#^.*\.pyc\$##" >> $sedtmp
echo "s#^.*\.pyo\$##" >> $sedtmp

# ignore default filesystem files
for i in `rpm -ql filesystem`; do
  echo "s#^${i}\$##" >> $sedtmp
done

#finish up
echo "/^\$/d" >> $sedtmp

#execute
sed -f $sedtmp -i filestoinclude1

# tar copy to bootstrap dir under buildroot
# prefix /bootstrap will fix conflicts
tar -T filestoinclude1 -cpf - | ( cd %buildroot/bootstrap && tar -xpf - )
# tar copy /usr/bin and /usr/sbin to /bin and /sbin to fix symblic lost in tar
(cd /usr/bin && tar -cpf - *) | (cd %buildroot/bootstrap/bin && tar -xpf -)
(cd /usr/sbin && tar -cpf - *) | (cd %buildroot/bootstrap/sbin && tar -xpf -)
rm filestoinclude1

# Todo: refractor
# no directories, in filelist
find %buildroot >  filestoinclude2
cat filestoinclude2 | sed -e "s#%{buildroot}##g" | uniq | sort > filestoinclude1
for i in `cat filestoinclude1`; do
# no directories
  if test -h %buildroot/$i || ! test -d %buildroot/$i; then
    #
    echo "$i" >> filestoinclude
  fi
done
rm filestoinclude1
rm filestoinclude2

set -x

%clean
rm -rf $RPM_BUILD_ROOT

%files -f filestoinclude