all repos — mgba @ 545497a7de4bb079e92274751daa46bc28e215b2

mGBA Game Boy Advance Emulator

All: Add tool for cleaning up debs spat out by CPack
Jeffrey Pfau jeffrey@endrift.com
Sat, 14 Feb 2015 01:44:48 -0800
commit

545497a7de4bb079e92274751daa46bc28e215b2

parent

78b70d97f4a51a3af58f72d54f0312a1630ad852

2 files changed, 66 insertions(+), 1 deletions(-)

jump to
M CMakeLists.txtCMakeLists.txt

@@ -310,7 +310,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR ${LIB_VERSION_MAJOR})

set(CPACK_PACKAGE_VERSION_MINOR ${LIB_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${LIB_VERSION_PATCH}) set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE) -set(CPACK_RESOURCE_FILE_README ${CMAKE_SOURCE_DIR}/LICENSE) +set(CPACK_RESOURCE_FILE_README ${CMAKE_SOURCE_DIR}/README.md) set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "mGBA Game Boy Advance Emulator") set(CPACK_PACKAGE_VENDOR "Jeffrey Pfau")

@@ -318,7 +318,11 @@ set(CPACK_PACKAGE_CONTACT "Jeffrey Pfau <jeffrey@endrift.com>")

set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md") set(CPACK_DEBIAN_PACKAGE_SECTION "games") +SET(CPACK_DEB_COMPONENT_INSTALL ON) + set(CPACK_STRIP_FILES ${BINARY_NAME}) + +install(FILES ${CMAKE_SOURCE_DIR}/README.md ${CMAKE_SOURCE_DIR}/CHANGES DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT lib${BINARY_NAME}) include(CPack)
A tools/sanitize-deb.sh

@@ -0,0 +1,61 @@

+#!/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 + mv $DEB $DEB~ + sed -i~ s/mgba-// deb-temp/DEBIAN/control + PKG=`head -n1 deb-temp/DEBIAN/control | cut -f2 -d ' '` + echo Found pacakge $PKG + + case $PKG in + lib$BINARY) + rmdep sdl + rmdep qt + ;; + $BINARY-qt) + rmdep libav + rmdep libedit + rmdep libpng + rmdep libzip + rmdep libmagickwand + rmdep libswscale + rmdep zlib + adddep lib$BINARY + ;; + $BINARY-sdl) + rmdep libav + rmdep libedit + rmdep libpng + rmdep qt + rmdep libzip + rmdep libmagickwand + 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 + rm deb-temp/DEBIAN/control~ + dpkg-deb -b deb-temp $DEB + shift +done