build 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/sh
  2. [% c("var/set_default_env") -%]
  3. # reset HOME which was changed by var/set_default_env, for gpg
  4. [% IF ENV.HOME %]export HOME="[% ENV.HOME %]"[% END %]
  5. destdir="[% dest_dir _ '/' _ c("var/publish_dir") %]"
  6. mkdir -p "$destdir"
  7. [% IF c("var/torbrowser-android-armv7") -%]
  8. mv [% c('input_files_by_name/android-armv7') %]/* "$destdir"/
  9. [% END -%]
  10. [% IF c("var/torbrowser-android-x86") -%]
  11. mv [% c('input_files_by_name/android-x86') %]/* "$destdir"/
  12. [% END -%]
  13. [% IF c("var/torbrowser-windows-i686") -%]
  14. mv [% c('input_files_by_name/windows-i686') %]/* "$destdir"/
  15. mv [% c('input_files_by_name/windows-expert-bundle') %]/* "$destdir"/
  16. [% END -%]
  17. [% IF c("var/torbrowser-windows-x86_64") -%]
  18. mv [% c('input_files_by_name/windows-x86_64') %]/* "$destdir"/
  19. mv [% c('input_files_by_name/windows64-expert-bundle') %]/* "$destdir"/
  20. [% END -%]
  21. [% IF c("var/torbrowser-osx-x86_64") -%]
  22. mv [% c('input_files_by_name/osx-x86_64') %]/* "$destdir"/
  23. [% END -%]
  24. [% IF c("var/torbrowser-linux-i686") -%]
  25. mv [% c('input_files_by_name/linux-i686') %]/* "$destdir"/
  26. [% END -%]
  27. [% IF c("var/torbrowser-linux-x86_64") -%]
  28. mv [% c('input_files_by_name/linux-x86_64') %]/* "$destdir"/
  29. [% END -%]
  30. [% IF c("var/torbrowser-linux-arm") -%]
  31. mv [% c('input_files_by_name/linux-arm') %]/* "$destdir"/
  32. [% END -%]
  33. cd "$destdir"
  34. cat > .htaccess <<EOF
  35. RewriteEngine On
  36. RewriteRule ^sha256sums.txt$ sha256sums-unsigned-build.txt
  37. RewriteRule ^sha256sums.txt.asc$ sha256sums-unsigned-build.txt.asc
  38. RewriteRule ^sha256sums.incrementals.txt$ sha256sums-unsigned-build.incrementals.txt
  39. RewriteRule ^sha256sums.incrementals.txt.asc$ sha256sums-unsigned-build.incrementals.txt.asc
  40. EOF
  41. sha256sum $(ls -1 *.exe *.tar.xz *.dmg *.mar *.zip *.tar.gz *.apk | grep -v '\.incremental\.mar$' | sort) > sha256sums-unsigned-build.txt
  42. [% IF c("var/sign_build") -%]
  43. gpg -abs [% c("var/sign_build_gpg_opts") %] sha256sums-unsigned-build.txt
  44. [% END -%]
  45. cat sha256sums-unsigned-build.txt