/
sb2-tools-qt5-template.spec
105 lines (87 loc) · 3.4 KB
/
sb2-tools-qt5-template.spec
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
%define __strip /bin/true
%define architecture_target @ARCH@
%define _build_name_fmt %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.dontuse.rpm
%define packages_in_tools qt5-qmake qt5-tools qt5-qtcore qt5-qtxml systemd-libs libgcrypt libgpg-error
Name: sb2-tools-qt5-@ARCH@
Version: 1.0
Release: 1
Source0: %{name}-%{version}.tar.bz2
Source1: baselibs.conf
Source2: precheckin.sh
Source100: sb2-tools-qt5-@ARCH@-rpmlintrc
# no auto requirements - they're generated
AutoReqProv: 0
BuildRequires: rpm grep tar patchelf sed fakeroot
BuildRequires: %packages_in_tools
ExclusiveArch: nothing
License: BSD
Group: Development/Tools
Summary: SB2 cross tools for qt5
%description
This is a package providing %packages_in_tools for SB2 tools directory
It is not intended to be used in a normal system!
%package dependency
Summary: Dependency for sb2 host side
Group: Development/Tools
%description dependency
This is a package providing %packages_in_tools SB2 tools directory
It is not intended to be used in a normal system!
%prep
%setup -q -n %{name}-%{version}
%build
%install
#set +x -e
mkdir -p %buildroot
rpm -ql %packages_in_tools > filestoinclude1
cat > filestoignore << EOF
/usr/share/man
/usr/share/doc
EOF
grep -vf filestoignore filestoinclude1 | sort | uniq > filestoinclude2
cat filestoinclude2
tar --no-recursion -T filestoinclude2 -cpf - | ( cd %buildroot && fakeroot tar -xvpf - )
shellquote()
{
for arg; do
arg=${arg//\\/\\\\}
# arg=${arg//\$/\$} # already needs quoting ;(
# arg=${arg/\"/\\\"} # dito
# arg=${arg//\`/\`} # dito
arg=${arg//\\ |/\|}
arg=${arg//\\|/|}
echo "$arg"
done
}
echo "Creating baselibs_new.conf"
echo ""
rm -rRf /tmp/baselibs_new.conf || true
shellquote "arch i486 targets @ARCH@:inject" >> /tmp/baselibs_new.conf
shellquote "%{name}" >> /tmp/baselibs_new.conf
shellquote " targettype x86 block!" >> /tmp/baselibs_new.conf
shellquote " targettype 32bit block!" >> /tmp/baselibs_new.conf
shellquote " targettype inject autoreqprov off" >> /tmp/baselibs_new.conf
shellquote " targettype inject extension -inject" >> /tmp/baselibs_new.conf
shellquote " targettype inject +/" >> /tmp/baselibs_new.conf
shellquote " targettype inject -%{_mandir}" >> /tmp/baselibs_new.conf
shellquote " targettype inject -%{_docdir}" >> /tmp/baselibs_new.conf
shellquote " targettype inject config -/sb2-config$" >> /tmp/baselibs_new.conf
shellquote "arch i486 targets @ARCH@:inject" >> /tmp/baselibs_new.conf
shellquote "%{name}-dependency" >> /tmp/baselibs_new.conf
shellquote " targettype x86 block!" >> /tmp/baselibs_new.conf
shellquote " targettype 32bit block!" >> /tmp/baselibs_new.conf
shellquote " targettype inject autoreqprov off" >> /tmp/baselibs_new.conf
shellquote " targettype inject extension -inject" >> /tmp/baselibs_new.conf
shellquote " targettype inject +/" >> /tmp/baselibs_new.conf
shellquote " targettype inject -%{_mandir}" >> /tmp/baselibs_new.conf
shellquote " targettype inject -%{_docdir}" >> /tmp/baselibs_new.conf
shellquote " targettype inject config -/sb2-config$" >> /tmp/baselibs_new.conf
cat /tmp/baselibs_new.conf > %{_sourcedir}/baselibs.conf
mkdir -p %buildroot/etc
touch %buildroot/etc/sb2-tools-qt5-template
%clean
rm -rf $RPM_BUILD_ROOT
%files dependency
%defattr(-,root,root)
/etc/sb2-tools-qt5-template
%files -f filestoinclude2
%defattr(-,root,root)