| 1 | #!/bin/sh |
|---|
| 2 | # PBI building script |
|---|
| 3 | # This will run after your port build is complete |
|---|
| 4 | # Build your PBI here, and exit 0 on success, or exit 1 on failure. |
|---|
| 5 | ############################################################################## |
|---|
| 6 | # Available Variables |
|---|
| 7 | # PBIDIR = The location of where you can populate your PBI directory |
|---|
| 8 | # MODULEDIR = The location of the module directory for this PBI |
|---|
| 9 | # PORTVER = Version number of the port we used to build |
|---|
| 10 | ############################################################################## |
|---|
| 11 | |
|---|
| 12 | # We need to modify the bin/firefox script to point to the PBI directory |
|---|
| 13 | # properly |
|---|
| 14 | |
|---|
| 15 | rm /tmp/ff-fixed |
|---|
| 16 | while read line |
|---|
| 17 | do |
|---|
| 18 | |
|---|
| 19 | echo $line | grep '^moz_libdir=' >/dev/null 2>/dev/null |
|---|
| 20 | if [ "$?" = "0" ] |
|---|
| 21 | then |
|---|
| 22 | echo "moz_libdir=\"/Programs/Firefox${PORTVER}/autolibs/firefox\"" >>/tmp/ff-fixed |
|---|
| 23 | else |
|---|
| 24 | echo "${line}" >> /tmp/ff-fixed |
|---|
| 25 | fi |
|---|
| 26 | |
|---|
| 27 | done < ${PBIDIR}/bin/firefox |
|---|
| 28 | |
|---|
| 29 | cp /tmp/ff-fixed ${PBIDIR}/bin/firefox |
|---|
| 30 | chmod 755 ${PBIDIR}/bin/firefox |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | # Save the right version number in the removepbi.sh script |
|---|
| 34 | sed -e "s,CHANGEME,Firefox${PORTVER},g" ${PBIDIR}/scripts/removepbi.sh > /tmp/removepbi.sh |
|---|
| 35 | mv /tmp/removepbi.sh ${PBIDIR}/scripts/removepbi.sh |
|---|
| 36 | chmod 755 ${PBIDIR}/scripts/removepbi.sh |
|---|
| 37 | |
|---|
| 38 | rm -rf /${PBIDIR}/autolibs/firefox/extensions/lang* |
|---|
| 39 | |
|---|
| 40 | # Copy over the lang-packs |
|---|
| 41 | tar cvf - -C /usr/local/lib/xpi/ . | tar xvf - -C ${PBIDIR}/autolibs/firefox/extensions/ |
|---|
| 42 | |
|---|
| 43 | # Now append our prefs file with the default email script |
|---|
| 44 | echo "pref(\"network.protocol-handler.app.mailto\", \"/Programs/Firefox${PORTVER}/bin/defaultemail\");" >> ${PBIDIR}/autolibs/firefox/greprefs/all.js |
|---|