-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#6] Update the test scripts for Arch packing.
As part of issue #6, I'm changing the way I make an Arch package to publish a few PKGBUILDs (-bin, -git, &c). This patchset updates a few test scripts. Also, add LICENSE to the distribution & fix the Debian package build. Somehow, the name got out of sync; I was missing a '-1'.
- Loading branch information
Showing
16 changed files
with
179 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,5 @@ configure | |
Makefile | ||
config.log | ||
config.status | ||
PKGBUILD | ||
*.deb | ||
*.zst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
SUBDIRS = mpdpopm doc | ||
EXTRA_DIST = LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PKGBUILD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,43 @@ | ||
# Docker image for building, debugging & packaging -*- mode: dockerfile; -*- | ||
FROM archlinux:latest AS base | ||
|
||
# Bootstrap | ||
RUN pacman --noconfirm -Syu && \ | ||
cp -v /etc/pacman.conf /etc/pacman.conf.orig && \ | ||
sed -e 's/^NoExtract/# NoExtract/' /etc/pacman.conf > /tmp/pacman.conf.tmp && \ | ||
cp -v /tmp/pacman.conf.tmp /etc/pacman.conf | ||
# I've had problems with the base image having out-of-date | ||
# mirrors. Begin by installing `reflector` & upating the | ||
# mirrorlist. Then update the system passing "-yy" to force a refresh | ||
# of all package databases (even if they appear to be up-to-date [this | ||
# has resolved the dreaded "404" problem for me in the past]). | ||
|
||
# See here https://bbs.archlinux.org/viewtopic.php?id=141029 | ||
RUN pacman-key --init && pacman --noconfirm -Sy archlinux-keyring && \ | ||
pacman --noconfirm -Syyu reflector && \ | ||
reflector --latest 10 --sort rate --save /etc/pacman.d/mirrorlist && \ | ||
cp -v /etc/pacman.conf /etc/pacman.conf.orig && \ | ||
sed -i -e 's/^NoExtract/# NoExtract/' /etc/pacman.conf | ||
|
||
# WORKAROUND for glibc 2.33 and old Docker | ||
# Seems to be no longer needed | ||
# (seems to be no longer needed) | ||
# See https://github.com/actions/virtual-environments/issues/2658 | ||
# Thanks to https://github.com/lxqt/lxqt-panel/pull/1562 | ||
# RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst && \ | ||
# curl -LO "https://repo.archlinuxcn.org/x86_64/$patched_glibc" && \ | ||
# bsdtar -C / -xvf "$patched_glibc" | ||
|
||
# Get the mirrorlist up-to-date | ||
# RUN pacman rsync --noconfirm -S reflector rsync && \ | ||
# reflector --latest 16 --protocol https --sort rate --save /etc/pacman.d/mirrorlist | ||
|
||
# See here https://bbs.archlinux.org/viewtopic.php?id=141029 | ||
# Not sure why the -yyu needed, perhaps as a result of reflector changing the mirrorlist? | ||
# RUN pacman --noconfirm -Syyu man-db man-pages texinfo vim base-devel gdb rust cargo && \ | ||
RUN pacman --noconfirm -S man-db man-pages texinfo vim base-devel gdb rust cargo && \ | ||
ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime && \ | ||
useradd -ms /bin/bash -G users,wheel mgh && \ | ||
echo 'mgh:mgh' | chpasswd && \ | ||
echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ | ||
mkdir /cores && chmod 777 /cores && \ | ||
echo "kernel.core_pattern=/cores/core.%e.%p" >> /etc/sysctl.d/50-coredump.conf | ||
RUN pacman --noconfirm -S base-devel pacman-contrib namcap git man-db man-pages \ | ||
texinfo vim gdb rust cargo && \ | ||
ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime && \ | ||
useradd -ms /bin/bash -G users,wheel mgh && \ | ||
echo 'mgh:mgh' | chpasswd && \ | ||
echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ | ||
mkdir /cores && chmod 777 /cores && \ | ||
echo "kernel.core_pattern=/cores/core.%e.%p" >> /etc/sysctl.d/50-coredump.conf && \ | ||
mkdir -p /tmp/mpdpopm{,-git,-bin} && \ | ||
chown mgh:users /tmp/mpdpopm{,-git,-bin} && \ | ||
chmod 775 /tmp/mpdpopm{,-git,-bin} | ||
|
||
# Rhm... needed? | ||
# sudo sysctl -p /etc/sysctl.d/50-coredump.conf | ||
|
||
USER mgh | ||
|
||
ENV PATH="/home/mgh/.cargo/bin:${PATH}" | ||
# Huh... still needed? | ||
# ENV PATH="/home/mgh/.cargo/bin:${PATH}" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
#!/bin/bash | ||
|
||
# This script is presumably mounted into the build container, with an argument | ||
# of the tarball to be used for the package. | ||
|
||
set -ex | ||
base="$(basename $1 .tar.gz)" | ||
version="${base:8}" | ||
cp -v /$1 /tmp | ||
cp -v /PKGBUILD /tmp | ||
cd /tmp | ||
makepkg -g >> PKGBUILD | ||
updpkgsums PKGBUILD | ||
namcap PKGBUILD | tee /tmp/namcap.$$.log | ||
makepkg | ||
namcap mpdpopm-${version}-1-x86_64.pkg.tar.zst | tee -a /tmp/namcap.$$.log | ||
pacman -Qlp mpdpopm-${version}-1-x86_64.pkg.tar.zst | ||
pacman -Qip mpdpopm-${version}-1-x86_64.pkg.tar.zst | ||
if grep -F ' E: ' /tmp/namcap.$$.log; then | ||
echo "There were errors and/or warnings from namcap:" | ||
cat /tmp/namcap.$$.log | ||
exit 1 | ||
fi | ||
sudo pacman --noconfirm -Uv mpdpopm-${version}-1-x86_64.pkg.tar.zst | ||
mppopm --version | ||
mppopm --help | ||
test -f /usr/local/share/info/mpdpopm.info.gz | ||
test -f /usr/share/info/mpdpopm.info.gz | ||
sudo pacman --noconfirm -R mpdpopm | ||
cp -v mpdpopm-${version}-1-x86_64.pkg.tar.zst /mpdpopm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script will mount the PKGBUILDs for my assorted AUR packages into a thin | ||
# Arch Linux Docker container and then attempt to build, install & uninstall | ||
# each. | ||
|
||
# It's meant for use after an mpdpopm release, when I'm updating my AUR | ||
# packages, before releasing new package versions. | ||
|
||
# It is presumably run from the root mpdpopm directory. | ||
|
||
# Invoke as `admin/test-aur-packages $version` | ||
|
||
set -ex | ||
docker build -t mpdpopm-arch:latest -f admin/Dockerfile-arch --label "mpdpopm-arch" . | ||
|
||
# If this 👆 fails with 404s when trying to download packages, try deleting any | ||
# Arch images before blowing away everything. | ||
|
||
version="$1" | ||
here=$(pwd) | ||
script=${here}/admin/test-aur-packages-cnt | ||
|
||
docker_args="-it" | ||
docker_args="$docker_args -v ${script}:/build-pkgs:ro" | ||
docker_args="$docker_args -v ${HOME}/code/projects/mpdpopm-aur/PKGBUILD:/tmp/mpdpopm/PKGBUILD" | ||
docker_args="$docker_args -v ${HOME}/code/projects/mpdpopm-git/PKGBUILD:/tmp/mpdpopm-git/PKGBUILD" | ||
docker_args="$docker_args -v ${HOME}/code/projects/mpdpopm-bin/PKGBUILD:/tmp/mpdpopm-bin/PKGBUILD" | ||
docker_args="$docker_args --privileged" | ||
docker_args="$docker_args --ulimit core=-1" | ||
docker_args="$docker_args -u mgh" | ||
docker_args="$docker_args --name=mpdpopm-aur" | ||
|
||
docker container rm -f mpdpopm-aur | ||
|
||
# Un-comment to just drop into the container & experiment | ||
# cmd="docker run ${docker_args} mpdpopm-arch:latest" | ||
cmd="docker run ${docker_args} mpdpopm-arch:latest /build-pkgs ${version}" | ||
exec $cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
|
||
# This script is presumably mounted into the build container. Invoke with | ||
# the package version. | ||
|
||
set -ex | ||
version="$1" | ||
|
||
# Test the "stock" package | ||
cd /tmp/mpdpopm | ||
makepkg | ||
namcap mpdpopm-${version}-1-x86_64.pkg.tar.zst | tee -a /tmp/namcap.$$.log | ||
pacman -Qlp mpdpopm-${version}-1-x86_64.pkg.tar.zst | ||
pacman -Qip mpdpopm-${version}-1-x86_64.pkg.tar.zst | ||
if grep -F ' E: ' /tmp/namcap.$$.log; then | ||
echo "There were errors and/or warnings from namcap:" | ||
cat /tmp/namcap.$$.log | ||
exit 1 | ||
fi | ||
sudo pacman --noconfirm -Uv mpdpopm-${version}-1-x86_64.pkg.tar.zst | ||
mppopm --version | ||
mppopm --help | ||
test -f /usr/share/info/mpdpopm.info.gz | ||
sudo pacman --noconfirm -R mpdpopm | ||
|
||
# Test the "git" package | ||
cd /tmp/mpdpopm-git | ||
makepkg | ||
namcap mpdpopm-git-${version}-1-x86_64.pkg.tar.zst | tee -a /tmp/namcap.$$.log | ||
pacman -Qlp mpdpopm-git-${version}-1-x86_64.pkg.tar.zst | ||
pacman -Qip mpdpopm-git-${version}-1-x86_64.pkg.tar.zst | ||
if grep -F ' E: ' /tmp/namcap.$$.log; then | ||
echo "There were errors and/or warnings from namcap:" | ||
cat /tmp/namcap.$$.log | ||
exit 1 | ||
fi | ||
sudo pacman --noconfirm -Uv mpdpopm-git-${version}-1-x86_64.pkg.tar.zst | ||
mppopm --version | ||
mppopm --help | ||
test -f /usr/share/info/mpdpopm.info.gz | ||
sudo pacman --noconfirm -R mpdpopm-git | ||
|
||
# Finally, test the "bin" package | ||
cd /tmp/mpdpopm-bin | ||
makepkg | ||
namcap mpdpopm-bin-${version}-1-x86_64.pkg.tar.zst | tee -a /tmp/namcap.$$.log | ||
pacman -Qlp mpdpopm-bin-${version}-1-x86_64.pkg.tar.zst | ||
pacman -Qip mpdpopm-bin-${version}-1-x86_64.pkg.tar.zst | ||
if grep -F ' E: ' /tmp/namcap.$$.log; then | ||
echo "There were errors and/or warnings from namcap:" | ||
cat /tmp/namcap.$$.log | ||
exit 1 | ||
fi | ||
sudo pacman --noconfirm -Uv mpdpopm-bin-${version}-1-x86_64.pkg.tar.zst | ||
mppopm --version | ||
mppopm --help | ||
test -f /usr/share/info/mpdpopm.info.gz | ||
grep -F 'mpdpopm' /usr/share/info/dir | ||
sudo pacman --noconfirm -R mpdpopm-bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@set UPDATED 29 December 2023 | ||
@set UPDATED-MONTH December 2023 | ||
@set EDITION 0.3.2 | ||
@set VERSION 0.3.2 | ||
@set EDITION 0.3.3 | ||
@set VERSION 0.3.3 |