build 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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-android-x86_64") -%]
  14. mv [% c('input_files_by_name/android-x86_64') %]/* "$destdir"/
  15. [% END -%]
  16. [% IF c("var/torbrowser-android-aarch64") -%]
  17. mv [% c('input_files_by_name/android-aarch64') %]/* "$destdir"/
  18. [% END -%]
  19. [% IF c("var/torbrowser-windows-i686") -%]
  20. mv [% c('input_files_by_name/windows-i686') %]/* "$destdir"/
  21. mv [% c('input_files_by_name/windows-expert-bundle') %]/* "$destdir"/
  22. [% END -%]
  23. [% IF c("var/torbrowser-windows-x86_64") -%]
  24. mv [% c('input_files_by_name/windows-x86_64') %]/* "$destdir"/
  25. mv [% c('input_files_by_name/windows64-expert-bundle') %]/* "$destdir"/
  26. [% END -%]
  27. [% IF c("var/torbrowser-osx-x86_64") -%]
  28. mv [% c('input_files_by_name/osx-x86_64') %]/* "$destdir"/
  29. [% END -%]
  30. [% IF c("var/torbrowser-linux-i686") -%]
  31. mv [% c('input_files_by_name/linux-i686') %]/* "$destdir"/
  32. [% END -%]
  33. [% IF c("var/torbrowser-linux-x86_64") -%]
  34. mv [% c('input_files_by_name/linux-x86_64') %]/* "$destdir"/
  35. [% END -%]
  36. [% IF c("var/torbrowser-src") -%]
  37. mv [% c('input_files_by_name/src-firefox') %] \
  38. [% c('input_files_by_name/src-tor-launcher') %] \
  39. "$destdir"/
  40. [% END -%]
  41. cd "$destdir"
  42. cat > .htaccess <<EOF
  43. RewriteEngine On
  44. RewriteRule ^sha256sums.txt$ sha256sums-unsigned-build.txt
  45. RewriteRule ^sha256sums.txt.asc$ sha256sums-unsigned-build.txt.asc
  46. RewriteRule ^sha256sums.incrementals.txt$ sha256sums-unsigned-build.incrementals.txt
  47. RewriteRule ^sha256sums.incrementals.txt.asc$ sha256sums-unsigned-build.incrementals.txt.asc
  48. EOF
  49. sha256sum $(ls -1 *.exe *.tar.xz *.dmg *.mar *.zip *.tar.gz *.apk | grep -v '\.incremental\.mar$' | sort) > sha256sums-unsigned-build.txt
  50. [% IF c("var/sign_build") -%]
  51. gpg -abs [% c("var/sign_build_gpg_opts") %] sha256sums-unsigned-build.txt
  52. [% END -%]
  53. cat sha256sums-unsigned-build.txt