Install langpacks as .xpi files instead of unpacking them
This helps performance of the browser, notably at startup, as it needs to open less files. http://blog.mozilla.com/tglek/2010/03/11/extensions-startup/
This commit is contained in:
parent
36d2d05089
commit
49840edf8c
@ -194,8 +194,8 @@ if [ $MOZILLA_DOWN -ne 0 ]; then
|
|||||||
|
|
||||||
function create_langpack_link() {
|
function create_langpack_link() {
|
||||||
local language=$*
|
local language=$*
|
||||||
local langpack=langpack-${language}@firefox.mozilla.org
|
local langpack=langpack-${language}@firefox.mozilla.org.xpi
|
||||||
if [ -f $MOZ_LANGPACKS_DIR/$langpack/chrome.manifest ]; then
|
if [ -f $MOZ_LANGPACKS_DIR/$langpack ]; then
|
||||||
rm -rf $MOZ_EXTENSIONS_PROFILE_DIR/$langpack
|
rm -rf $MOZ_EXTENSIONS_PROFILE_DIR/$langpack
|
||||||
ln -s $MOZ_LANGPACKS_DIR/$langpack \
|
ln -s $MOZ_LANGPACKS_DIR/$langpack \
|
||||||
$MOZ_EXTENSIONS_PROFILE_DIR/$langpack
|
$MOZ_EXTENSIONS_PROFILE_DIR/$langpack
|
||||||
|
20
firefox.spec
20
firefox.spec
@ -229,22 +229,26 @@ XULRUNNER_DIR=`pkg-config --variable=libdir libxul | %{__sed} -e "s,%{_libdir},,
|
|||||||
|
|
||||||
echo > ../%{name}.lang
|
echo > ../%{name}.lang
|
||||||
%if %{build_langpacks}
|
%if %{build_langpacks}
|
||||||
# Install langpacks
|
# Extract langpacks, make any mods needed, repack the langpack, and install it.
|
||||||
%{__mkdir_p} $RPM_BUILD_ROOT%{langpackdir}
|
%{__mkdir_p} $RPM_BUILD_ROOT%{langpackdir}
|
||||||
%{__tar} xf %{SOURCE1}
|
%{__tar} xf %{SOURCE1}
|
||||||
for langpack in `ls firefox-langpacks/*.xpi`; do
|
for langpack in `ls firefox-langpacks/*.xpi`; do
|
||||||
language=`basename $langpack .xpi`
|
language=`basename $langpack .xpi`
|
||||||
extensiondir=$RPM_BUILD_ROOT%{langpackdir}/langpack-$language@firefox.mozilla.org
|
extensionID=langpack-$language@firefox.mozilla.org
|
||||||
%{__mkdir_p} $extensiondir
|
%{__mkdir_p} $extensionID
|
||||||
unzip $langpack -d $extensiondir
|
unzip $langpack -d $extensionID
|
||||||
find $extensiondir -type f | xargs chmod 644
|
find $extensionID -type f | xargs chmod 644
|
||||||
|
|
||||||
sed -i -e "s|browser.startup.homepage.*$|browser.startup.homepage=%{homepage}|g;" \
|
sed -i -e "s|browser.startup.homepage.*$|browser.startup.homepage=%{homepage}|g;" \
|
||||||
$extensiondir/chrome/$language/locale/branding/browserconfig.properties
|
$extensionID/chrome/$language/locale/branding/browserconfig.properties
|
||||||
|
|
||||||
|
cd $extensionID
|
||||||
|
zip -r9mX ../${extensionID}.xpi *
|
||||||
|
cd -
|
||||||
|
|
||||||
|
%{__install} -m 644 ${extensionID}.xpi $RPM_BUILD_ROOT%{langpackdir}
|
||||||
language=`echo $language | sed -e 's/-/_/g'`
|
language=`echo $language | sed -e 's/-/_/g'`
|
||||||
extensiondir=`echo $extensiondir | sed -e "s,^$RPM_BUILD_ROOT,,"`
|
echo "%%lang($language) %{langpackdir}/${extensionID}.xpi" >> ../%{name}.lang
|
||||||
echo "%%lang($language) $extensiondir" >> ../%{name}.lang
|
|
||||||
done
|
done
|
||||||
%{__rm} -rf firefox-langpacks
|
%{__rm} -rf firefox-langpacks
|
||||||
%endif # build_langpacks
|
%endif # build_langpacks
|
||||||
|
Loading…
Reference in New Issue
Block a user