製作 firefox 萬年版套件 [論壇 - Ubuntu 非官方發行版討論]


正在瀏覽:   1 名遊客


 到底部   前一個主題   下一個主題  [無發表權] 請登錄或者註冊



製作 firefox 萬年版套件
會員二級
註冊日期:
2017/3/23 10:15
所屬群組:
已註冊使用者
等級: 8
HP : 0 / 182
MP : 29 / 1409
EXP: 29
離線
#############################################################
### 製作 firefox 萬年版套件
#############################################################
在舊版的 OS 上已經無法編譯新版的 firefox, 如果硬要編。建置的依賴需要下載新版自己編譯,這樣很麻煩,所以舊版的 Linux 上,直接打包官方的萬年版是最方便的選擇。

## 下載 firefox 官方萬年版
FFVER=$(curl https://www.mozilla.org/en-US/firefox/new/ | tr " " "\n" | grep data-latest-firefox | awk -F'"' '{print $2}')
LANG=$(locale -a | grep utf8 2>&1 | sed -e 's/.utf8//g' | sed -e 's/_/-/g' | tail -n 1 )

if [ "$(uname -m)" == "x86_64" ]; then
ARCH=x86_64
else
ARCH=i686
fi


# FFVER=69.0.3
# ARCH=x86_64
# LANG=zh-TW

wget https://download-installer.cdn.mozilla.net/pub/firefox/releases/$FFVER/linux-${ARCH}/$LANG/firefox-${FFVER}.tar.bz2
tar jxvf firefox-${FFVER}.tar.bz2

rm -rf firefox/*.sig
rm -rf firefox/*.chk
rm -rf firefox/precomplete \
firefox/icons \
firefox/crashreporter \
firefox/crashreporter.ini \
firefox/active-update.xml \
firefox/removed-files \
firefox/update-settings.ini \
firefox/updater \
firefox/updater.ini \
firefox/updates.xml \
firefox/updates

sed -i '/Enabled/d' firefox/application.ini
sed -i '/ServerURL/d' firefox/application.ini
sed -i '/Reporter/d' firefox/application.ini
sed -i '/SourceRepository/d' firefox/platform.ini
sed -i '/SourceStamp/d' firefox/platform.ini

mkdir -p firefox/browser/defaults/preferences

cat > firefox/browser/defaults/preferences/vendor.js << EOF
// Disable application updates
pref("app.update.auto", false);
pref("app.update.enabled", false, locked);

// Disable default browser checking.
pref("browser.shell.checkDefaultBrowser", false);

// Disable OpenH264 Decoder
pref("media.gmp-gmpopenh264.enabled", false);
EOF

cat > firefox/browser/defaults/preferences/firefox.js << EOF
//pref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=file:///usr/share/kali-defaults/web/homepage.html");
pref("network.cookie.prefsMigrated", true);
pref("network.predictor.cleaned-up", true);
pref("network.proxy.socks", "127.0.0.1");
pref("network.proxy.socks_port", 9050);
pref("network.proxy.type", 0);
EOF


#############################################################
### 製作套件
#############################################################
PKGDIR=$HOME/Build/firefox-${FFVER}

mkdir -p $PKGDIR/usr/share/applications
mkdir -p $PKGDIR/usr/lib
mkdir -p $PKGDIR/usr/bin
mkdir -p $PKGDIR/DEBIAN

mv firefox $PKGDIR/usr/lib/

cat > $PKGDIR/usr/share/applications/firefox.desktop << EOF
[Desktop Entry]
Name=Firefox
Comment=Browse the World Wide Web
GenericName=Web Browser
X-GNOME-FullName=Firefox Web Browser
Exec=/usr/bin/firefox %u
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=firefox
Categories=Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;
StartupWMClass=Firefox
StartupNotify=true
EOF

cat > $PKGDIR/usr/bin/firefox << EOF
#!/bin/bash

/usr/lib/firefox/firefox "\$@"

EOF

chmod 755 $PKGDIR/usr/bin/firefox


PKGSIZE=$(du -s $PKGDIR | awk '{print $1}')

cat > $PKGDIR/DEBIAN/control << EOF
Package: firefox
Version: ${FFVER}-1
Architecture: amd64
Maintainer: Maintainers of Mozilla-related packages
Installed-Size: $PKGSIZE
Depends: libasound2, libatk1.0-0, libc6, libcairo-gobject2, libcairo2, libdbus-1-3, libdbus-glib-1-2, libevent-2.1-6, libffi6, libfontconfig1, libfreetype6, libgcc1, libgdk-pixbuf2.0-0, libglib2.0-0, libgtk-3-0, libpango-1.0-0, libstartup-notification0, libstdc++6, libx11-6, libx11-xcb1, libxcb-shm0, libxcb1, libxcomposite1, libxdamage1, libxext6, libxfixes3, libxrender1, libxt6, zlib1g, fontconfig, procps, debianutils
Provides: gnome-www-browser, www-browser
Section: web
Priority: optional
Description: Mozilla Firefox web browser
Firefox is a powerful, extensible web browser with support for modern
web application technologies.
EOF


cd $HOME/Build
sudo chown -R 0:0 $PKGDIR
sudo dpkg -b firefox-${FFVER} firefox_${FFVER}-1_amd64.deb


10/20 13:31:13
應用擴展 工具箱
回覆: 製作 firefox 萬年版套件
會員二級
註冊日期:
2017/3/23 10:15
所屬群組:
已註冊使用者
等級: 8
HP : 0 / 182
MP : 29 / 1409
EXP: 29
離線
#############################################################
### 製作 firefox-esr 萬年版套件
#############################################################
## 下載 firefox-esr 官方萬年版
FFVER=$(curl https://www.mozilla.org/en-US/firefox/new/ | tr " " "\n" | grep data-esr-versions | awk -F'"' '{print $2}')
LANG=$(locale -a | grep utf8 2>&1 | sed -e 's/.utf8//g' | sed -e 's/_/-/g' | tail -n 1)

if [ "$(uname -m)" == "x86_64" ]; then
ARCH=x86_64
else
ARCH=i686
fi


# FFVER=68.1.0
# ARCH=x86_64
# LANG=zh-TW

wget https://download-installer.cdn.mozilla.net/pub/firefox/releases/${FFVER}esr/linux-${ARCH}/$LANG/firefox-${FFVER}esr.tar.bz2
tar jxvf firefox-${FFVER}esr.tar.bz2

rm -rf firefox/*.sig
rm -rf firefox/*.chk
rm -rf firefox/precomplete \
firefox/icons \
firefox/crashreporter \
firefox/crashreporter.ini \
firefox/active-update.xml \
firefox/removed-files \
firefox/update-settings.ini \
firefox/updater \
firefox/updater.ini \
firefox/updates.xml \
firefox/updates

sed -i 's/RemotingName=.*/RemotingName=Firefox-esr/g' firefox/application.ini
sed -i '/SourceRepository/d' firefox/application.ini
sed -i '/SourceStamp/d' firefox/application.ini
sed -i '/Enabled=/d' firefox/application.ini
sed -i '/ServerURL/d' firefox/application.ini
sed -i '/Reporter/d' firefox/application.ini


mkdir -p firefox/browser/defaults/preferences

cat > firefox/browser/defaults/preferences/vendor.js << EOF
// Disable application updates
pref("app.update.auto", false);
pref("app.update.enabled", false, locked);

// Disable default browser checking.
pref("browser.shell.checkDefaultBrowser", false);

// Disable OpenH264 Decoder
pref("media.gmp-gmpopenh264.enabled", false);
EOF

cat > firefox/browser/defaults/preferences/firefox.js << EOF
//pref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=file:///usr/share/kali-defaults/web/homepage.html");
pref("network.cookie.prefsMigrated", true);
pref("network.predictor.cleaned-up", true);
pref("network.proxy.socks", "127.0.0.1");
pref("network.proxy.socks_port", 9050);
pref("network.proxy.type", 0);
EOF


#############################################################
### 製作套件
#############################################################
PKGDIR=$HOME/Build/firefox-esr-${FFVER}

mkdir -p $PKGDIR/usr/share/applications
mkdir -p $PKGDIR/usr/lib
mkdir -p $PKGDIR/usr/bin
mkdir -p $PKGDIR/DEBIAN

mv firefox $PKGDIR/usr/lib/firefox-esr

cat > $PKGDIR/usr/share/applications/firefox-esr.desktop << EOF
[Desktop Entry]
Name=Firefox ESR
Comment=Browse the World Wide Web
GenericName=Web Browser
X-GNOME-FullName=Firefox ESR Web Browser
Exec=/usr/bin/firefox-esr %u
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=firefox-esr
Categories=Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;
StartupWMClass=Firefox-esr
StartupNotify=true
EOF

cat > $PKGDIR/usr/bin/firefox-esr << EOF
#!/bin/bash

/usr/lib/firefox-esr/firefox "\$@"

EOF

chmod 755 $PKGDIR/usr/bin/firefox-esr


PKGSIZE=$(du -s $PKGDIR | awk '{print $1}')

cat > $PKGDIR/DEBIAN/control << EOF
Package: firefox-esr
Version: ${FFVER}-1
Architecture: amd64
Maintainer: Maintainers of Mozilla-related packages
Installed-Size: $PKGSIZE
Depends: libasound2, libatk1.0-0, libc6, libcairo-gobject2, libcairo2, libdbus-1-3, libdbus-glib-1-2, libevent-2.1-6, libffi6, libfontconfig1, libfreetype6, libgcc1, libgdk-pixbuf2.0-0, libglib2.0-0, libgtk-3-0, libpango-1.0-0, libstartup-notification0, libstdc++6, libx11-6, libx11-xcb1, libxcb-shm0, libxcb1, libxcomposite1, libxdamage1, libxext6, libxfixes3, libxrender1, libxt6, zlib1g, fontconfig, procps, debianutils
Provides: gnome-www-browser, www-browser
Section: web
Priority: optional
Description: Mozilla Firefox web browser
Firefox is a powerful, extensible web browser with support for modern
web application technologies.
EOF


cd $HOME/Build
sudo chown -R 0:0 $PKGDIR
sudo dpkg -b firefox-esr-${FFVER} firefox-esr_${FFVER}-1_amd64.deb

10/21 11:20:10
應用擴展 工具箱


 [無發表權] 請登錄或者註冊


可以查看帖子.
不可發帖.
不可回覆.
不可編輯自己的帖子.
不可刪除自己的帖子.
不可發起投票調查.
不可在投票調查中投票.
不可上傳附件.
不可不經審核直接發帖.