build_debian.sh 718 B

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