make_deb.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/bin/bash
  2. # Run this from your project root (where visual-renamer binary is)
  3. VERSION="1.1.0"
  4. ARCH="amd64"
  5. DEB_NAME="visual-renamer_${VERSION}_${ARCH}"
  6. echo "Building structure for ${DEB_NAME}..."
  7. mkdir -p ${DEB_NAME}/usr/bin
  8. mkdir -p ${DEB_NAME}/usr/share/applications
  9. mkdir -p ${DEB_NAME}/usr/share/icons/hicolor/512x512/apps
  10. mkdir -p ${DEB_NAME}/DEBIAN
  11. echo "Copying binary and stripping that bloated shit..."
  12. cp visual-renamer ${DEB_NAME}/usr/bin/
  13. strip ${DEB_NAME}/usr/bin/visual-renamer
  14. chmod 755 ${DEB_NAME}/usr/bin/visual-renamer
  15. echo "Copying icon..."
  16. cp icon.png ${DEB_NAME}/usr/share/icons/hicolor/512x512/apps/visual-renamer.png
  17. chmod 644 ${DEB_NAME}/usr/share/icons/hicolor/512x512/apps/visual-renamer.png
  18. echo "Writing .desktop file with the correct wmclass..."
  19. cat <<EOF > ${DEB_NAME}/usr/share/applications/visual-renamer.desktop
  20. [Desktop Entry]
  21. Version=1.0
  22. Name=Visual Renamer
  23. Comment=Simple Image Renamer
  24. Exec=/usr/bin/visual-renamer
  25. Icon=visual-renamer
  26. Terminal=false
  27. Type=Application
  28. Categories=Graphics;Utility;
  29. StartupWMClass=simpleimagerenamer
  30. EOF
  31. chmod 644 ${DEB_NAME}/usr/share/applications/visual-renamer.desktop
  32. echo "Writing DEBIAN/control..."
  33. cat <<EOF > ${DEB_NAME}/DEBIAN/control
  34. Package: visual-renamer
  35. Version: ${VERSION}
  36. Section: graphics
  37. Priority: optional
  38. Architecture: ${ARCH}
  39. Depends: libgtkmm-3.0-1v5
  40. Maintainer: Nikki <nicole@builder>
  41. Description: Simple Image Renamer
  42. GUI for renaming images with drag and drop sorting.
  43. EOF
  44. echo "Building the fucking .deb..."
  45. dpkg-deb --build ${DEB_NAME}
  46. echo "Cleaning up..."
  47. rm -rf ${DEB_NAME}
  48. echo "Done. You now have ${DEB_NAME}.deb"