build 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  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-windows-i686") -%]
  8. mv [% c('input_files_by_name/windows-i686') %]/* "$destdir"/
  9. mv [% c('input_files_by_name/windows-expert-bundle') %]/* "$destdir"/
  10. [% END -%]
  11. [% IF c("var/torbrowser-windows-x86_64") -%]
  12. mv [% c('input_files_by_name/windows-x86_64') %]/* "$destdir"/
  13. mv [% c('input_files_by_name/windows64-expert-bundle') %]/* "$destdir"/
  14. [% END -%]
  15. [% IF c("var/torbrowser-osx-x86_64") -%]
  16. mv [% c('input_files_by_name/osx-x86_64') %]/* "$destdir"/
  17. [% END -%]
  18. [% IF c("var/torbrowser-linux-i686") -%]
  19. mv [% c('input_files_by_name/linux-i686') %]/* "$destdir"/
  20. [% END -%]
  21. [% IF c("var/torbrowser-linux-x86_64") -%]
  22. mv [% c('input_files_by_name/linux-x86_64') %]/* "$destdir"/
  23. [% END -%]
  24. cd "$destdir"
  25. cat > .htaccess <<EOF
  26. RewriteEngine On
  27. RewriteRule ^sha256sums.txt$ sha256sums-unsigned-build.txt
  28. RewriteRule ^sha256sums.txt.asc$ sha256sums-unsigned-build.txt.asc
  29. RewriteRule ^sha256sums.incrementals.txt$ sha256sums-unsigned-build.incrementals.txt
  30. RewriteRule ^sha256sums.incrementals.txt.asc$ sha256sums-unsigned-build.incrementals.txt.asc
  31. EOF
  32. sha256sum $(ls -1 *.exe *.tar.xz *.dmg *.mar *.zip *.tar.gz | grep -v '\.incremental\.mar$' | sort) > sha256sums-unsigned-build.txt
  33. [% IF c("var/sign_build") -%]
  34. gpg -abs [% c("var/sign_build_gpg_opts") %] sha256sums-unsigned-build.txt
  35. [% END -%]
  36. cat sha256sums-unsigned-build.txt