diff --git a/.gitignore b/.gitignore index 900ab65..c242984 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,5 @@ configure Makefile config.log config.status -PKGBUILD *.deb *.zst diff --git a/Makefile.am b/Makefile.am index 6c43c77..40f59fc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1 +1,2 @@ SUBDIRS = mpdpopm doc +EXTRA_DIST = LICENSE diff --git a/NEWS b/NEWS index 957c661..0f1722b 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,8 @@ mpdpopm News -- history of user-visible changes -*- outline -*- *** User-visible changes **** If HOME isn't set, look for .mppopm in / +**** [#6] Removed the Arch package from the build & start publishing them to the AUR +**** Add LICENSE to the distribution ** 0.3.2 build *** Bugfixes diff --git a/admin/.gitignore b/admin/.gitignore new file mode 100644 index 0000000..670e123 --- /dev/null +++ b/admin/.gitignore @@ -0,0 +1 @@ +PKGBUILD diff --git a/admin/Dockerfile-arch b/admin/Dockerfile-arch index c47552d..2691209 100644 --- a/admin/Dockerfile-arch +++ b/admin/Dockerfile-arch @@ -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}" diff --git a/admin/Dockerfile-debian b/admin/Dockerfile-debian index 4ddc5cd..0938764 100644 --- a/admin/Dockerfile-debian +++ b/admin/Dockerfile-debian @@ -10,7 +10,6 @@ ENV DEBIAN_FRONTEND=${DEBIAN_FRONTEND:-noninteractive} RUN set -ex && \ echo "Installing pre-requisites..." && \ apt-get update && \ - apt-get upgrade && \ apt-get install -y --no-install-recommends \ # Wow... \ ca-certificates \ diff --git a/admin/PKGBUILD.in b/admin/PKGBUILD.in index 6f3ff03..eb6e93f 100644 --- a/admin/PKGBUILD.in +++ b/admin/PKGBUILD.in @@ -1,15 +1,17 @@ +# Maintainer: Michael pkgname=@PACKAGE_NAME@ pkgver=@PACKAGE_VERSION@ pkgrel=1 pkgdesc='Maintain ratings & playcounts for your mpd server' url=https://github.com/sp1ff/mpdpopm arch=('x86_64') -license=('GPL3') +license=('GPL-3.0-or-later') +depends=("gcc-libs" "glibc") source=(mpdpopm-@PACKAGE_VERSION@.tar.gz) build() { cd "${pkgname}-${pkgver}" - ./configure --prefix=/usr/local + ./configure --prefix=/usr make } diff --git a/admin/build-dev-arch-pkg b/admin/build-dev-arch-pkg index f4a5ac7..556db94 100755 --- a/admin/build-dev-arch-pkg +++ b/admin/build-dev-arch-pkg @@ -1,30 +1,33 @@ #!/usr/bin/env bash -# This script will bindmount the host mpdpopm project directory and invoke -# `makepkg` so as to make an Arch package. It's meant for use during mpdpopm -# development, as a check that my latest changes won't break anything at -# release-time when it's time to package the latest mpdpopm. +# This script will mount a source tarball into a thin Arc Linux container and +# invoke`makepkg` so as to make an Arch package. It's meant for use during +# mpdpopm development, as a check that my latest changes won't break anything +# at release-time when it's time to package the latest mpdpopm. # It is presumably run from the root mpdpopm directory. -# Invoke as `admin/build-dev-arch-pkg mpdpopm-${version}.tar.gz +# Invoke as `admin/build-dev-arch-pkg mpdpopm-${version}.tar.gz` set -ex -docker build -t mpdpopm-arch:latest -f admin/Dockerfile-arch . +docker build -t mpdpopm-arch:latest -f admin/Dockerfile-arch --label "mpdpopm-arch" . here=$(pwd) script=${here}/admin/build-dev-arch-pkg-cnt -pkgbuild=${here}/PKGBUILD +pkgbuild=${here}/admin/PKGBUILD tarball=${here}/$1 docker_args="-it" docker_args="$docker_args -v ${script}:/build-dev-pkg:ro" docker_args="$docker_args -v ${tarball}:/$1:ro" docker_args="$docker_args -v ${pkgbuild}:/PKGBUILD" -docker_args="$docker_args --mount type=bind,source=${here},target=/mpdpopm" docker_args="$docker_args --privileged" docker_args="$docker_args --ulimit core=-1" docker_args="$docker_args -u mgh" +docker_args="$docker_args --name=mpdpopm-dev-arch" + +docker container rm -f mpdpopm-dev-arch + # 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-dev-pkg $1" diff --git a/admin/build-dev-arch-pkg-cnt b/admin/build-dev-arch-pkg-cnt index 970d5c5..901b2d3 100755 --- a/admin/build-dev-arch-pkg-cnt +++ b/admin/build-dev-arch-pkg-cnt @@ -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 diff --git a/admin/build-dev-debian-pkg b/admin/build-dev-debian-pkg index dd34468..da98178 100755 --- a/admin/build-dev-debian-pkg +++ b/admin/build-dev-debian-pkg @@ -20,7 +20,6 @@ tarball=${here}/$1 docker_args="-it" docker_args="$docker_args -v ${script}:/build-dev-pkg:ro" docker_args="$docker_args -v ${tarball}:/$1:ro" -docker_args="$docker_args -v ${license}:/LICENSE" docker_args="$docker_args --mount type=bind,source=${here},target=/mpdpopm" docker_args="$docker_args --privileged" docker_args="$docker_args --ulimit core=-1" diff --git a/admin/build-dev-debian-pkg-cnt b/admin/build-dev-debian-pkg-cnt index b360472..f546ef0 100755 --- a/admin/build-dev-debian-pkg-cnt +++ b/admin/build-dev-debian-pkg-cnt @@ -8,14 +8,13 @@ cp -v /"$1" /tmp cd /tmp tar -xf "$1" cd mpdpopm-${version} -cp -v /LICENSE . ./configure cd mpdpopm cargo deb -sudo dpkg --debug=2 -i target/debian/mpdpopm_${version}_amd64.deb +sudo dpkg --debug=2 -i target/debian/mpdpopm_${version}-1_amd64.deb mppopm --version mppopm --help test -f /usr/local/share/info/mpdpopm.info sudo dpkg --debug=2 -r mpdpopm -sudo cp -v target/debian/mpdpopm_${version}_amd64.deb /mpdpopm +sudo cp -v target/debian/mpdpopm_${version}-1_amd64.deb /mpdpopm diff --git a/admin/test-aur-packages b/admin/test-aur-packages new file mode 100755 index 0000000..ac4eab2 --- /dev/null +++ b/admin/test-aur-packages @@ -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 diff --git a/admin/test-aur-packages-cnt b/admin/test-aur-packages-cnt new file mode 100755 index 0000000..a18e385 --- /dev/null +++ b/admin/test-aur-packages-cnt @@ -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 diff --git a/configure.ac b/configure.ac index db9b036..9bf5a28 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([mpdpopm], [0.3.2], [sp1ff@pobox.com], [mpdpopm], [https://github.com/sp1ff/mpdpopm]) +AC_INIT([mpdpopm], [0.3.3], [sp1ff@pobox.com], [mpdpopm], [https://github.com/sp1ff/mpdpopm]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_SRCDIR([mpdpopm/Cargo.toml.in]) AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability -Wno-override gnits std-options dist-xz dist-zstd]) @@ -25,7 +25,7 @@ dnl Ditto for etc/mppopmd.conf.am.in and etc/mppopmd.service.am.in AC_CONFIG_FILES([mpdpopm/src/vars.rs.am]) AC_CONFIG_FILES([mpdpopm/mppopmd.conf.am:etc/mppopmd.conf.am.in]) AC_CONFIG_FILES([mpdpopm/mppopmd.service.am:etc/mppopmd.service.am.in]) -AC_CONFIG_FILES([PKGBUILD:admin/PKGBUILD.in]) +AC_CONFIG_FILES([admin/PKGBUILD]) AC_CONFIG_FILES([Makefile mpdpopm/Makefile mpdpopm/Cargo.toml]) AC_CONFIG_FILES([doc/Makefile]) diff --git a/doc/version.texi b/doc/version.texi index bc3e595..9ed0582 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -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