3 # Find out ASAP if some command breaks here, because we're copying a lot of
4 # files we don't actually maintain ourselves, and requirements could easily be
8 # need these environment vars:
11 echo " MKDIR = $MKDIR"
14 echo " SRCDIR = $SRCDIR"
15 echo " MOZJS_MAJOR_VERSION = $MOZJS_MAJOR_VERSION"
16 echo " MOZJS_MINOR_VERSION = $MOZJS_MINOR_VERSION"
17 echo " MOZJS_PATCH_VERSION = $MOZJS_PATCH_VERSION"
18 echo " MOZJS_ALPHA = $MOZJS_ALPHA"
21 pkg
="mozjs-${MOZJS_MAJOR_VERSION}.${MOZJS_MINOR_VERSION}.${MOZJS_PATCH_VERSION:-${MOZJS_ALPHA:-0}}.tar.bz2"
23 tgtpath
=${DIST}/${pkgpath}
28 echo "Cleaning ${pkg} and ${tgtpath} ..."
29 rm -rf ${pkg} ${tgtpath}
32 echo "Packaging source tarball ${pkg}..."
33 if [ -d ${tgtpath} ]; then
34 echo "WARNING - dist tree ${tgtpath} already exists!"
36 ${MKDIR} -p ${tgtpath}/js
/src
38 # copy the embedded icu
39 ${MKDIR} -p ${tgtpath}/intl
40 cp -t ${tgtpath}/intl
-dRp ${SRCDIR}/..
/..
/intl
/icu
42 # copy main moz.build and Makefile.in
43 cp -t ${tgtpath} -dRp ${SRCDIR}/../../Makefile.in ${SRCDIR}/..
/..
/moz.build
45 # copy a nspr file used by the build system
46 ${MKDIR} -p ${tgtpath}/nsprpub
/config
47 cp -t ${tgtpath}/nsprpub
/config
-dRp \
48 ${SRCDIR}/..
/..
/nsprpub
/config
/make-system-wrappers.pl
50 # copy build and config directory.
51 ${MKDIR} -p ${tgtpath}/build
52 cp -t ${tgtpath} -dRp ${SRCDIR}/../../build ${SRCDIR}/..
/..
/config
55 cp -t ${tgtpath} -dRp ${SRCDIR}/..
/..
/mfbt
56 cp -t ${tgtpath}/js -dRp ${SRCDIR}/../jsd ${SRCDIR}/..
/public
57 find ${SRCDIR} -mindepth 1 -maxdepth 1 -not -path ${DIST} -a -not -name ${pkg} \
58 -exec cp -t ${tgtpath}/js
/src
-dRp {} +
60 # distclean if necessary
61 if [ -e ${tgtpath}/js
/src
/Makefile
]; then
62 ${MAKE} -C ${tgtpath}/js
/src distclean
65 cp -t ${tgtpath} -dRp \
66 ${SRCDIR}/..
/..
/python
67 ${MKDIR} -p ${tgtpath}/dom
/bindings
68 cp -t ${tgtpath}/dom
/bindings
-dRp \
69 ${SRCDIR}/..
/..
/dom
/bindings
/mozwebidlcodegen
70 ${MKDIR} -p ${tgtpath}/media
/webrtc
/trunk
/tools
71 cp -t ${tgtpath}/media
/webrtc
/trunk
/tools
-dRp \
72 ${SRCDIR}/..
/..
/media
/webrtc
/trunk
/tools
/gyp
73 ${MKDIR} -p ${tgtpath}/testing
74 cp -t ${tgtpath}/testing
-dRp \
75 ${SRCDIR}/..
/..
/testing
/mozbase
76 ${MKDIR} -p ${tgtpath}/modules
/zlib
77 cp -t ${tgtpath}/modules
/zlib
-dRp \
78 ${SRCDIR}/..
/..
/modules
/zlib
/src
80 # remove *.pyc and *.pyo files if any
81 find ${tgtpath} -type f
-name "*.pyc" -o -name "*.pyo" |
xargs rm -f
83 # copy or create INSTALL
84 if [ -e {DIST
}/INSTALL
]; then
85 cp -t ${tgtpath} ${DIST}/INSTALL
87 cat <<INSTALL_EOF >${tgtpath}/INSTALL
88 Full build documentation for SpiderMonkey is hosted on MDN:
89 https://developer.mozilla.org/en-US/docs/SpiderMonkey/Build_Documentation
91 Note that the libraries produced by the build system include symbols,
92 causing the binaries to be extremely large. It is highly suggested that \`strip\`
93 be run over the binaries before deploying them.
95 Building with default options may be performed as follows:
102 # copy or create README
103 if [ -e ${DIST}/README
]; then
104 cp -t ${tgtpath} ${DIST}/README
106 cat <<README_EOF >${tgtpath}/README
107 This directory contains SpiderMonkey ${MOZJS_MAJOR_VERSION}.
109 This release is based on a revision of Mozilla ${MOZJS_MAJOR_VERSION}:
110 http://hg.mozilla.org/releases/
111 The changes in the patches/ directory were applied.
113 MDN hosts the latest SpiderMonkey ${MOZJS_MAJOR_VERSION} release notes:
114 https://developer.mozilla.org/en-US/docs/SpiderMonkey/${MOZJS_MAJOR_VERSION}
119 if [ -e ${SRCDIR}/..
/..
/b2g
/LICENSE
]; then
120 cp ${SRCDIR}/..
/..
/b2g
/LICENSE
${tgtpath}/
122 cp ${SRCDIR}/..
/..
/LICENSE
${tgtpath}/
125 # copy patches dir, if it currently exists in DIST
126 if [ -d ${DIST}/patches
]; then
127 cp -t ${tgtpath} -dRp ${DIST}/patches
128 elif [ -d ${SRCDIR}/..
/..
/patches
]; then
129 cp -t ${tgtpath} -dRp ${SRCDIR}/..
/..
/patches
133 ${TAR} $taropts ${DIST}/../${pkg} -C ${DIST} ${pkgpath}
137 echo "Unrecognized command: $cmd"