#!/bin/sh set -e retrieve() { mkdir -p tmp printf "Downloading '%s'...\n" "${archive_pkg}" if [ ! -f "tmp/${archive_pkg}" ]; then curl -o "tmp/${archive_pkg}" "http://www.slackware.com/~alien/slackbuilds/chromium-ungoogled/pkg64/current/${archive_pkg}" fi if [ ! -f "checksums/${archive_pkg}.md5" ]; then curl -o "checksums/${archive_pkg}.md5" "http://www.slackware.com/~alien/slackbuilds/chromium-ungoogled/pkg64/current/${archive_pkg}.md5" fi printf "Checking the integrity of '%s'...\n" "${archive_pkg}" cd tmp md5sum -c "../checksums/${archive_pkg}.md5" cd .. printf "Retrieving necessary metadata...\n" if [ ! -f "tmp/copyright" ]; then curl -o "tmp/copyright" "https://salsa.debian.org/chromium-team/chromium/-/raw/master/debian/copyright" fi } prepare() { if ! cmp --silent "debian/copyright" "tmp/copyright"; then cp "tmp/copyright" "debian/copyright" fi mkdir tmp/archive && cd tmp/archive tar -xf "../${archive_pkg}" 2>/dev/null # Move a couple of things in order to conform to Debian's standards mv usr/lib64 usr/lib mv usr/man usr/share/ # Remove Slackware-specific folders rm -rf install/ rm -rf usr/doc/ # Correct to the new path sed -i "s|/usr/lib64/|/usr/lib/|" usr/bin/chromium-ungoogled # It should not be executable chmod 644 usr/lib/chromium-ungoogled/vk_swiftshader_icd.json cd ../.. } package() { mkdir tree # Copy the content to the rootdir, ready to be packaged cp -r tmp/archive/etc "${pkgdir}/etc" cp -r tmp/archive/usr "${pkgdir}/usr" # Update the changelog dch \ --newversion "${pkgver}" \ --distribution unstable \ --controlmaint "New release." } pkgver=103.0.5060.53 archive_pkg="chromium-ungoogled-${pkgver}-x86_64-1alien.txz" pkgdir="tree" retrieve printf "Preparing...\n" prepare printf "Packaging...\n" package dpkg-buildpackage