build_debian.sh 770 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env bash
  2. # The script to build the Debian package, as ran inside the Docker image.
  3. set -ex
  4. # Get the codename from distro env
  5. DIST=`cut -d ':' -f2 <<< $distro`
  6. # we get a read-only copy of the source: make a writeable copy
  7. cp -aT /synapse/source /synapse/build
  8. cd /synapse/build
  9. # add an entry to the changelog for this distribution
  10. dch -M -l "+$DIST" "build for $DIST"
  11. dch -M -r "" --force-distribution --distribution "$DIST"
  12. dpkg-buildpackage -us -uc
  13. ls -l ..
  14. # copy the build results out, setting perms if necessary
  15. shopt -s nullglob
  16. for i in ../*.deb ../*.dsc ../*.tar.xz ../*.changes ../*.buildinfo; do
  17. [ -z "$TARGET_USERID" ] || chown "$TARGET_USERID" "$i"
  18. [ -z "$TARGET_GROUPID" ] || chgrp "$TARGET_GROUPID" "$i"
  19. mv "$i" /debs
  20. done