-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlts-glamor-egl-rename
executable file
·77 lines (59 loc) · 2.15 KB
/
lts-glamor-egl-rename
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
#!/bin/bash
ltsq=$(grep "^[#]*libdrm-intel1" "${rename_mapping_file}" | cut -d- -f3)
if [ -z "${ltsq}" ]; then
echo "Could not get name for ltsq"
exit 1
fi
set -e
# debian/control
# Strictly speaking libglamor itself doesn't conflict, but libglamor
# depends on the xorg abi too, so it sort of does.
${basedir}/dpkg-control \
--source-suffix ${suffix} \
--binary-suffix ${suffix} \
--mapping-file "${rename_mapping_file}" \
--add-replaces --add-provides --add-conflicts \
--extra-conflicts "${extraconflicts}" \
> debian/control.new
mv -v debian/control.new debian/control
# debian/rules fixes
cp debian/rules debian/rules.new
# big mess, since we're special
sed -e "s/libglamor/&_${ltsq}/" -i debian/libglamor-dev.install
mv debian/libglamor-dev.install debian/libglamor-dev-${suffix}.install
if [ -f debian/xserver-xorg-glamoregl.install ]; then
mv debian/xserver-xorg-glamoregl.install debian/xserver-xorg-glamoregl-${suffix}.install
else
mv debian/xserver-xorg-video-glamoregl.install debian/xserver-xorg-video-glamoregl-${suffix}.install
fi
for ipkg in 0; do
newpkg="libglamor-${ltsq}${ipkg}"
pkg="libglamor${ipkg}"
echo "- Renaming ${pkg}.* files to ${newpkg}.*"
set +e
files=$(ls debian/${pkg}.*)
err=$?
set -e
if [ $err -ne 0 ]; then
echo "Failed to list in ${old_package} for ${old_package} -> ${new_package}"
continue
fi
for old_file in $files; do
new_file=${old_file/${pkg}/${newpkg}}
mv -v ${old_file} ${new_file}
# TODO: Maybe using 'rename' would be better?
done
# and of course the install stuff
sed -e "s/libglamor/&_${ltsq}/" -i debian/${newpkg}.install
done
# add a override for debian/rules
echo -e "\\noverride_dh_shlibdeps:
dh_shlibdeps -a -O--builddirectory=build/
sed -i 's/libgl1-mesa-glx /libgl1-mesa-glx-${suffix} /' debian/libglamor-${ltsq}0.substvars" \
>> debian/rules.new
mv -v debian/rules.new debian/rules
sed -e "s/-lglamor/&_${ltsq}/" -i *.pc.in
sed -e "s/^libglamor_la/libglamor_${ltsq}_la/" -i */Makefile.am
sed -e "s/libglamor\\.la/libglamor_${ltsq}.la/" -i */Makefile.am
debuild --source-option=--auto-commit -S -sa
cd ..