edps
(usa Slackware)
Enviado em 30/08/2019 - 20:25h
Exemplo de um template de um programa cujo source é um .deb, o Google Chrome:
template:
# Template file for 'google-chrome'
_chromeVersion=76.0.3809.100
_chromeRevision=1
_channel=stable
pkgname=google-chrome
version="${_chromeVersion}.${_chromeRevision}"
revision=1
maintainer="Michael Aldridge <maldridge@voidlinux.org>"
homepage="https://www.google.com/chrome/"
license="chrome"
short_desc="Attempt at creating a safer, faster, and more stable browser"
archs="x86_64"
repository=nonfree
restricted=yes
nostrip=yes
_baseUrl="https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable"
_filename="google-chrome-${_channel}_${_chromeVersion}-${_chromeRevision}_amd64.deb"
_chromeUrl="${_baseUrl}/${_filename}"
distfiles="$_chromeUrl"
checksum=1dbf606dfa051a927fbd9a241a9032148d25be0851b2f27849a26ca81fa6b9b0
do_extract() {
mkdir -p ${DESTDIR}
ar x ${XBPS_SRCDISTDIR}/google-chrome-${version}/${_filename}
}
do_install() {
tar xf data.tar.xz -C ${DESTDIR}
# Install the icons
for size in 16 22 24 32 48 64 128 256; do
# Create the google chrome xdg directory
mkdir -p ${DESTDIR}/usr/share/icons/hicolor/${size}x${size}/apps
# Copy the google chrome icon
mv ${DESTDIR}/opt/google/chrome/product_logo_${size}.png \
${DESTDIR}/usr/share/icons/hicolor/${size}x${size}/apps/google-chrome.png
done
# Remove unused icons
rm ${DESTDIR}/opt/google/chrome/*.xpm
# Remove the Debian/Ubuntu crontab
rm -rf ${DESTDIR}/etc
rm -rf ${DESTDIR}/opt/google/chrome/cron
}
update:
# This site is an official source of version numbers, but it is not
# obviously associated as such. We save bytes here and request the
# CSV, and then only the row containing the stable version number for
# the Linux desktop build. As a result the regex can be pretty simple
# to just grab the version number out of the correct column.
site="https://omahaproxy.appspot.com/all?os=linux&channel=stable"
pattern="stable,\K[\d.]+(?=,)