2015-02-14 09:44:48 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Clean up the caveats that CPack leaves behind
|
|
|
|
BINARY=mgba
|
|
|
|
|
|
|
|
rmdep () {
|
|
|
|
local DEP=$1
|
|
|
|
echo Removing dependency $DEP
|
|
|
|
sed -i~ "s/[^, ]*$DEP[^,]*//g" deb-temp/DEBIAN/control
|
|
|
|
}
|
|
|
|
|
|
|
|
adddep() {
|
|
|
|
local DEP=$1
|
|
|
|
echo Adding dependency $DEP
|
|
|
|
sed -i~ "s/^Depends: /&$DEP,/" deb-temp/DEBIAN/control
|
|
|
|
}
|
|
|
|
|
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
DEB=$1
|
|
|
|
dpkg-deb -R $DEB deb-temp
|
2019-04-22 19:57:58 +00:00
|
|
|
PKG=`grep Package deb-temp/DEBIAN/control | cut -f2 -d ' '`
|
2018-05-06 06:31:45 +00:00
|
|
|
echo Found package $PKG
|
2015-02-14 09:44:48 +00:00
|
|
|
|
|
|
|
case $PKG in
|
2018-05-06 06:31:45 +00:00
|
|
|
*-base)
|
|
|
|
PKG=lib$BINARY
|
2015-02-14 09:44:48 +00:00
|
|
|
rmdep sdl
|
|
|
|
rmdep qt
|
|
|
|
;;
|
2018-05-06 06:31:45 +00:00
|
|
|
*-qt)
|
|
|
|
PKG=$BINARY-qt
|
2015-02-14 09:44:48 +00:00
|
|
|
rmdep libav
|
|
|
|
rmdep libedit
|
2019-04-22 19:57:58 +00:00
|
|
|
rmdep libelf
|
2019-05-14 20:02:36 +00:00
|
|
|
rmdep libgl
|
2015-02-14 09:44:48 +00:00
|
|
|
rmdep libpng
|
|
|
|
rmdep libzip
|
|
|
|
rmdep libmagickwand
|
2019-04-22 19:57:58 +00:00
|
|
|
rmdep libsqlite3
|
|
|
|
rmdep libswresample
|
2015-02-14 09:44:48 +00:00
|
|
|
rmdep libswscale
|
|
|
|
rmdep zlib
|
|
|
|
adddep lib$BINARY
|
|
|
|
;;
|
2018-05-06 06:31:45 +00:00
|
|
|
*-sdl)
|
|
|
|
PKG=$BINARY-sdl
|
2015-02-14 09:44:48 +00:00
|
|
|
rmdep libav
|
|
|
|
rmdep libedit
|
2019-04-22 19:57:58 +00:00
|
|
|
rmdep libelf
|
2019-05-14 20:02:36 +00:00
|
|
|
rmdep libgl
|
2015-02-14 09:44:48 +00:00
|
|
|
rmdep libpng
|
|
|
|
rmdep qt
|
|
|
|
rmdep libzip
|
|
|
|
rmdep libmagickwand
|
2019-04-22 19:57:58 +00:00
|
|
|
rmdep libsqlite3
|
|
|
|
rmdep libswresample
|
2015-02-14 09:44:48 +00:00
|
|
|
rmdep libswscale
|
|
|
|
rmdep zlib
|
|
|
|
adddep lib$BINARY
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo Unknown package!
|
|
|
|
esac
|
|
|
|
|
|
|
|
sed -i~ "s/,,*/,/g" deb-temp/DEBIAN/control
|
|
|
|
sed -i~ "s/,$//g" deb-temp/DEBIAN/control
|
|
|
|
sed -i~ "/^[^:]*: $/d" deb-temp/DEBIAN/control
|
2018-05-06 06:31:45 +00:00
|
|
|
sed -i~ "s/^Package: .*$/Package: $PKG/" deb-temp/DEBIAN/control
|
2015-02-14 09:44:48 +00:00
|
|
|
rm deb-temp/DEBIAN/control~
|
2015-07-30 21:02:33 +00:00
|
|
|
chmod 644 deb-temp/DEBIAN/md5sums
|
2015-07-28 08:15:48 +00:00
|
|
|
chown -R root:root deb-temp
|
2018-05-06 06:31:45 +00:00
|
|
|
dpkg-deb -b deb-temp $PKG.deb
|
2015-04-04 20:58:30 +00:00
|
|
|
rm -rf deb-temp
|
2015-02-14 09:44:48 +00:00
|
|
|
shift
|
|
|
|
done
|