summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyano Hao2017-09-22 14:18:57 +0800
committerCyano Hao2017-09-22 14:18:57 +0800
commite63b7f53c069a149a67ee1f3c99101983daa2595 (patch)
tree1c94bb9cf43b6684c794006e4833e0614e298409
parentce299bcce3943f2915d922cf4bbbe95fe5b0868b (diff)
downloadaur-e63b7f53c069a149a67ee1f3c99101983daa2595.tar.gz
new policy for pkgver; makepkg will always look for latest build
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD57
-rwxr-xr-xupdate-source-files.sh28
3 files changed, 35 insertions, 66 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 963a16f0204..54707dc82ca 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -25,21 +25,13 @@ pkgbase = firefox-nightly-en-gb
conflicts = firefox-nightly
source = firefox-nightly.desktop
source = vendor.js
+ source = 20170921-220243-firefox-58.0a1.en-GB.linux-x86_64.tar.bz2::https://ftp.mozilla.org/pub/firefox/nightly/2017/09/2017-09-21-22-02-43-mozilla-central-l10n/firefox-58.0a1.en-GB.linux-x86_64.tar.bz2
+ source = 20170921-220243-firefox-58.0a1.en-GB.linux-x86_64.tar.bz2.asc::https://ftp.mozilla.org/pub/firefox/nightly/2017/09/2017-09-21-22-02-43-mozilla-central-l10n/firefox-58.0a1.en-GB.linux-x86_64.tar.bz2.asc
validpgpkeys = 14F26682D0916CDD81E37B6D61B7B526D98F0353
sha512sums = b514abafc559ec03a4222442fa4306db257c3de9e18ed91a0b37cc9d7058a8e08a241442e54a67659a3ab4512a5dae6a0b94ea7a33d08ef0b8a76a9eac902095
sha512sums = bae5a952d9b92e7a0ccc82f2caac3578e0368ea6676f0a4bc69d3ce276ef4f70802888f882dda53f9eb8e52911fb31e09ef497188bcd630762e1c0f5293cc010
- source_i686 = 20170922-firefox-58.0a1.en-GB.linux-i686.tar.bz2::https://ftp.mozilla.org/pub/firefox/nightly/latest-mozilla-central-l10n/firefox-58.0a1.en-GB.linux-i686.tar.bz2
- source_i686 = 20170922-firefox-58.0a1.en-GB.linux-i686.tar.bz2.asc::https://ftp.mozilla.org/pub/firefox/nightly/latest-mozilla-central-l10n/firefox-58.0a1.en-GB.linux-i686.tar.bz2.asc
- source_i686 = 20170922-firefox-58.0a1.en-US.linux-i686.txt::https://ftp.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-58.0a1.en-US.linux-i686.txt
- sha512sums_i686 = SKIP
- sha512sums_i686 = SKIP
- sha512sums_i686 = SKIP
- source_x86_64 = 20170922-firefox-58.0a1.en-GB.linux-x86_64.tar.bz2::https://ftp.mozilla.org/pub/firefox/nightly/latest-mozilla-central-l10n/firefox-58.0a1.en-GB.linux-x86_64.tar.bz2
- source_x86_64 = 20170922-firefox-58.0a1.en-GB.linux-x86_64.tar.bz2.asc::https://ftp.mozilla.org/pub/firefox/nightly/latest-mozilla-central-l10n/firefox-58.0a1.en-GB.linux-x86_64.tar.bz2.asc
- source_x86_64 = 20170922-firefox-58.0a1.en-US.linux-x86_64.txt::https://ftp.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-58.0a1.en-US.linux-x86_64.txt
- sha512sums_x86_64 = SKIP
- sha512sums_x86_64 = SKIP
- sha512sums_x86_64 = SKIP
+ sha512sums = SKIP
+ sha512sums = SKIP
pkgname = firefox-nightly-en-gb
diff --git a/PKGBUILD b/PKGBUILD
index 4673f7a179e..fa724f29b7a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,12 +5,26 @@
_name=firefox
_channel=nightly
_lang=en-GB
-_pkgname_en_us=${_name}-${_channel}
+_pkgname=${_name}-${_channel}
pkgname=${_name}-${_channel}-${_lang,,}
pkgdesc="Standalone Web Browser from Mozilla — Nightly build (${_lang})"
url="https://www.mozilla.org/${_lang}/${_name}/${_channel}"
+
_version=58.0a1
-pkgver=58.0a1.20170921.220243
+declare -A _build_id
+_build_id=(
+ [id]="$(curl https://ftp.mozilla.org/pub/${_name}/nightly/latest-mozilla-central/${_name}-${_version}.en-US.linux-${CARCH}.txt | head -n1)"
+ [year]="${_build_id[id]:0:4}"
+ [month]="${_build_id[id]:4:2}"
+ [day]="${_build_id[id]:6:2}"
+ [hour]="${_build_id[id]:8:2}"
+ [min]="${_build_id[id]:10:2}"
+ [sec]="${_build_id[id]:12:2}"
+ [date]="${_build_id[id]:0:8}"
+ [time]="${_build_id[id]:8:6}"
+)
+
+pkgver=${_version}.${_build_id[date]}.${_build_id[time]}
pkgrel=1
arch=('i686' 'x86_64')
license=('MPL' 'GPL' 'LGPL')
@@ -25,50 +39,41 @@ optdepends=('pulseaudio: audio support'
'networkmanager: location detection via available WiFi networks'
'speech-dispatcher: text-to-speech'
'startup-notification: support for FreeDesktop Startup Notification')
-_url="https://ftp.mozilla.org/pub/${_name}/nightly/latest-mozilla-central"
-_url_l10n="${_url}-l10n"
-_src="${_name}-${_version}.${_lang}.linux"
-_src_en_us="${_name}-${_version}.en-US.linux"
-_filename="$(date --utc +%Y%m%d)-${_src}"
-_filename_en_us="$(date --utc +%Y%m%d)-${_src_en_us}"
-source=('firefox-nightly.desktop' 'vendor.js')
-source_i686=("${_filename}-i686.tar.bz2"::"${_url_l10n}/${_src}-i686.tar.bz2"
- "${_filename}-i686.tar.bz2.asc"::"${_url_l10n}/${_src}-i686.tar.bz2.asc"
- "${_filename_en_us}-i686.txt"::"${_url}/${_src_en_us}-i686.txt")
-source_x86_64=("${_filename}-x86_64.tar.bz2"::"${_url_l10n}/${_src}-x86_64.tar.bz2"
- "${_filename}-x86_64.tar.bz2.asc"::"${_url_l10n}/${_src}-x86_64.tar.bz2.asc"
- "${_filename_en_us}-x86_64.txt"::"${_url}/${_src_en_us}-x86_64.txt")
+
+_url="https://ftp.mozilla.org/pub/firefox/nightly/${_build_id[year]}/${_build_id[month]}/${_build_id[year]}-${_build_id[month]}-${_build_id[day]}-${_build_id[hour]}-${_build_id[min]}-${_build_id[sec]}-mozilla-central-l10n"
+_src="${_name}-${_version}.${_lang}.linux-${CARCH}"
+_filename="${_build_id[date]}-${_build_id[time]}-${_src}"
+source=('firefox-nightly.desktop'
+ 'vendor.js'
+ "${_filename}.tar.bz2"::"${_url}/${_src}.tar.bz2"
+ "${_filename}.tar.bz2.asc"::"${_url}/${_src}.tar.bz2.asc")
sha512sums=(
'b514abafc559ec03a4222442fa4306db257c3de9e18ed91a0b37cc9d7058a8e08a241442e54a67659a3ab4512a5dae6a0b94ea7a33d08ef0b8a76a9eac902095'
'bae5a952d9b92e7a0ccc82f2caac3578e0368ea6676f0a4bc69d3ce276ef4f70802888f882dda53f9eb8e52911fb31e09ef497188bcd630762e1c0f5293cc010'
+ 'SKIP'
+ 'SKIP'
)
-sha512sums_i686=('SKIP' 'SKIP' 'SKIP')
-sha512sums_x86_64=('SKIP' 'SKIP' 'SKIP')
validpgpkeys=('14F26682D0916CDD81E37B6D61B7B526D98F0353') # Mozilla’s GnuPG release key
-pkgver() {
- echo "${_version}.$(head -n1 ${_filename_en_us}-${CARCH}.txt | cut -c-8).$(head -n1 ${_filename_en_us}-${CARCH}.txt | cut -c9-14)"
-}
-
package() {
- OPT_PATH="opt/${_pkgname_en_us}"
+ OPT_PATH="opt/${_pkgname}"
# Install the package files
install -d "${pkgdir}"/{usr/bin,opt}
cp -r ${_name} "${pkgdir}"/${OPT_PATH}
- ln -s "/${OPT_PATH}/${_name}" "${pkgdir}"/usr/bin/${_pkgname_en_us}
+ ln -s "/${OPT_PATH}/${_name}" "${pkgdir}"/usr/bin/${_pkgname}
# Install .desktop files
- install -Dm644 "${srcdir}"/${_pkgname_en_us}.desktop -t "${pkgdir}"/usr/share/applications
+ install -Dm644 "${srcdir}"/${_pkgname}.desktop -t "${pkgdir}"/usr/share/applications
# Install icons
SRC_LOC="${srcdir}"/${_name}/browser
DEST_LOC="${pkgdir}"/usr/share/icons/hicolor
for i in 16 32 48
do
- install -Dm644 "${SRC_LOC}"/chrome/icons/default/default${i}.png "${DEST_LOC}"/${i}x${i}/apps/${_pkgname_en_us}.png
+ install -Dm644 "${SRC_LOC}"/chrome/icons/default/default${i}.png "${DEST_LOC}"/${i}x${i}/apps/${_pkgname}.png
done
- install -Dm644 "${SRC_LOC}"/icons/mozicon128.png "${DEST_LOC}"/128x128/apps/${_pkgname_en_us}.png
+ install -Dm644 "${SRC_LOC}"/icons/mozicon128.png "${DEST_LOC}"/128x128/apps/${_pkgname}.png
# Disable auto-updates
install -Dm644 "${srcdir}"/vendor.js -t "${pkgdir}"/${OPT_PATH}/browser/defaults/preferences
diff --git a/update-source-files.sh b/update-source-files.sh
deleted file mode 100755
index 11447767814..00000000000
--- a/update-source-files.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#! /bin/bash
-# Author: Cyano Hao < c at cyano dot cn >
-
-# This script intends to solve the following problems:
-# 1. I made a package yesterday, and there is no new build on `ftp.mozilla.org` (of cource I hate redundant fetchings);
-# 2. I made a package today, but there is a new build on `ftp.mozilla.org`.
-
-source /etc/makepkg.conf
-source ./PKGBUILD
-
-ls | grep "${_src_en_us}-${CARCH}.txt" >/dev/null
-if (( "$?" == 0 )) ; then
- latest_nightly_build_time=$(eval curl \${source_${CARCH}[2]#*::} | head -n1)
- local_source_build_time=$(head -n1 $(ls | grep "${_src_en_us}-${CARCH}.txt" | tail -n1))
- local_source_download_date=$(ls | grep "${_src_en_us}-${CARCH}.txt" | tail -n1 | cut -c-8)
- today=$(date --utc +%Y%m%d)
- if [[ (( "${local_source_build_time}" == "${latest_nightly_build_time}" )) &&
- (( "${local_source_download_date}" < "${today}" )) ]]
- then
- for file in ${local_source_download_date}-*-${CARCH}.{tar.bz2{,.asc},txt} ; do
- mv ${file} ${today}-${file#${local_source_download_date}-}
- done
- elif [[ (( "${local_source_build_time}" < "${latest_nightly_build_time}" )) &&
- (( "${local_source_download_date}" == "${today}" )) ]]
- then
- rm ${today}-*-${CARCH}.{tar.bz2{,.asc},txt}
- fi
-fi