Skip to content

Commit

Permalink
mpdpopm release 0.3.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
sp1ff committed Jul 22, 2023
1 parent 1d15aa1 commit 599cd06
Show file tree
Hide file tree
Showing 16 changed files with 98 additions and 63 deletions.
25 changes: 23 additions & 2 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
2021-12-30 Michael Herstine <sp1ff@pobox.com>
2023-07-15 Michael Herstine <sp1ff@pobox.com>

Update the Continuous Integration job & upgrade Clap to v4.
I suppose I conflated two changes in one commit. This patch:

- updated the CI job & got it working again
- upgraded to Clap v4
- updates README & NEWS accordingly

Getting Clap v4. to *compile* was one thing-- the upgrade also
required a broad revision of the use of the Clap API (substituting
`get_flag()` for `contains_id()`, for instance.

2023-07-15 Michael Herstine <sp1ff@pobox.com>

Upgraded to tokio 1.0.

2021-12-18 Michael Herstine <sp1ff@pobox.com>
2023-07-15 Michael Herstine <sp1ff@pobox.com>

Remove Snafu.
After some thought & some research, I decided I want to hand-craft
Expand All @@ -14,8 +27,16 @@
- `cargo test` passes
- `cargo doc` builds cleanly

2022-01-24 Michael Herstine <sp1ff@pobox.com>

Commented out testing code in the release GHA

Updated the pinned rust toolchain version to 1.56.1 because that's the first release to support the 2021 edition and cargo-deb now requires that

2021-10-11 Michael Herstine <sp1ff@pobox.com>

working on release workflow

Address issue #5.
`mppopmd` can now communicate with the mpd server over a local
(Unix) socket.
Expand Down
7 changes: 3 additions & 4 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ mpdpopm News -- history of user-visible changes -*- outline -*-

* 0.3 builds

** 0.3.2 build
** 0.3.1 build

No user-visible changes; strictly a hygiene build:

- fixed the CI job
- updated to Tokio 1.0
- updated to Clap 4
- updated the Rust edition to 2021
** 0.3.1 build

No user-visible changes; strictly a hygiene build (re-vamped error-handling throughout).
- re-vamped error-handling throughout
** 0.3.0 build

*** Bugfixes
Expand Down
32 changes: 18 additions & 14 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
#+AUTHOR: Michael Herstine
#+DESCRIPTION: mpdpopm
#+EMAIL: sp1ff@pobox.com
#+DATE: <2023-07-15 Sat 17:12>
#+DATE: <2023-07-20 Thu 07:49>
#+AUTODATE: t

* Introduction
1

[[https://github.com/sp1ff/mpdpopm][mpdpopm]] provides a companion daemon to [[https://www.musicpd.org/][MPD]] for maintaining play counts, ratings and last-played timestamps, along with an associated CLI for talking to the companion daemon. Similar to [[https://github.com/vincent-petithory/mpdfav][mpdfav]], but written in Rust (which I prefer to Go), it will maintain this information in your sticker database. Along the lines of [[https://alip.github.io/mpdcron][mpdcron]], it will also allow you to keep that information up-to-date in your tags by invoking external (user-provided & -configured) commands.

This README focuses on obtaining & installing [[https://github.com/sp1ff/mpdpopm][mpdpopm]]; the user manual is distributed with the package in [[https://www.gnu.org/software/texinfo/][Texinfo]] format. The HTML version of the user manual is hosted on my personal [[https://www.unwoundstack.com/doc/mpdpopm/curr][site]].
Expand All @@ -29,6 +29,10 @@ mppopm findadd "(lastplayed <= \"2022-07-15\")"

to add all songs that haven't been played in the last year.

* Licsense

[[https://github.com/sp1ff/mpdpopm][mpdpopm]] is GPL v3 software.

* Prerequisites

[[https://www.musicpd.org/][Music Player Daemon]]: "Music Player Daemon (MPD) is a flexible, powerful, server-side application for playing music. Through plugins and libraries it can play a variety of sound files while being controlled by its network protocol." If you're reading this, I assume you're already running MPD, so this document won't have much to say on installing & configuring it other than that you *do* need to setup the sticker database by setting =sticker_file= in your configuration.
Expand Down Expand Up @@ -56,10 +60,10 @@ Thanks to a suggestion by [[https://github.com/m040601][m040601]], you can down

#+BEGIN_SRC bash
cd /tmp
curl -L --output mpdpopm-0.3.2.tar.gz https://github.com/sp1ff/mpdpopm/releases/download/0.3.2/mpdpopm-0.3.2-x86_64-unknown-linux.tar.gz
tar xf mpdpopm-0.3.2.tar.gz
tree mpdpopm-0.3.2-x86_64-unknown-linux/
mpdpopm-0.3.2-x86_64-unknown-linux/
curl -L --output mpdpopm-0.3.1.tar.gz https://github.com/sp1ff/mpdpopm/releases/download/0.3.1/mpdpopm-0.3.1-x86_64-unknown-linux.tar.gz
tar xf mpdpopm-0.3.1.tar.gz
tree mpdpopm-0.3.1-x86_64-unknown-linux/
mpdpopm-0.3.1-x86_64-unknown-linux/
├── bin
│ ├── mppopm
│ └── mppopmd
Expand Down Expand Up @@ -89,8 +93,8 @@ If you're running on a Debian-based Linux distribution, and you're on an x86_64

#+BEGIN_SRC bash
cd /tmp
curl -L -O https://github.com/sp1ff/mpdpopm/releases/download/0.3.2/mpdpopm_0.3.2_amd64.deb
sudo dpkg -i mpdpopm_0.3.2_amd64.deb
curl -L -O https://github.com/sp1ff/mpdpopm/releases/download/0.3.1/mpdpopm_0.3.1_amd64.deb
sudo dpkg -i mpdpopm_0.3.1_amd64.deb
#+END_SRC

The binaries will be placed in =/usr/local/bin=, and you can proceed to [[#getting_started][Getting Started]], below.
Expand All @@ -101,8 +105,8 @@ If you're running on an Arch-based Linux distribution, and you're on an x86_64 p

#+BEGIN_SRC bash
cd /tmp
curl -L -O https://github.com/sp1ff/mpdpopm/releases/download/0.3.2/mpdpopm_0.3.2-1-x86_64.pkg.tar.zst
sudo pacman -U mpdpopm_0.3.2-1-x86_64.pkg.tar.zst
curl -L -O https://github.com/sp1ff/mpdpopm/releases/download/0.3.1/mpdpopm_0.3.1-1-x86_64.pkg.tar.zst
sudo pacman -U mpdpopm_0.3.1-1-x86_64.pkg.tar.zst
#+END_SRC

The binaries will be placed in =/usr/local/bin=, and you can proceed to [[#getting_started][Getting Started]], below.
Expand All @@ -113,9 +117,9 @@ If you've got the Rust toolchain as well as Autotools installed, you can build f

#+BEGIN_SRC bash
cd /tmp
curl -L -O https://github.com/sp1ff/mpdpopm/releases/download/0.3.2/mpdpopm-0.3.2.tar.xz
tar xf mpdpopm-0.3.2.tar.xz
cd mpdpopm-0.3.2
curl -L -O https://github.com/sp1ff/mpdpopm/releases/download/0.3.1/mpdpopm-0.3.1.tar.xz
tar xf mpdpopm-0.3.1.tar.xz
cd mpdpopm-0.3.1
./configure
make
make check
Expand Down Expand Up @@ -188,7 +192,7 @@ At this point, [[https://github.com/sp1ff/mpdpopm][mpdpopm]] will happily monito
mppopm set-rating '*****'
#+END_SRC

to set the current track's rating to five "stars" (say =mppopm --help= for an explanation of the rating system; in brief-- it's Winamp's). NB. the set rating command by default produces no output; if you want confirmation that somethings happening, use the =-v= flag.
to set the current track's rating to five "stars" (say =mppopm --help= for an explanation of the rating system; in brief-- it's Winamp's). NB. the set rating command by default produces no output; if you want confirmation that something's happening, use the =-v= flag.

The CLI offers "get" & "set" commands for play counts, last played timestamps & the rating. It also provides commands for searching your songs on the basis of play count, rating & last played times in addition to the usual artist, title &c. Say =mppopm --help= for a full list of options, including how to tell it where the mpd server can be found on your network.

Expand Down
72 changes: 41 additions & 31 deletions admin/Dockerfile-debian
Original file line number Diff line number Diff line change
@@ -1,44 +1,54 @@
# Docker image for building, debugging & packaging -*- mode: dockerfile -*-
# There _is_ a "rust" Docker image, but the purpose of these tests
# is to start with a bare-bones *Debian* system & see what I need to
# do to get mpdpopm installed.
FROM debian:stable-slim AS base

ARG DEBIAN_FRONTEND
ENV DEBIAN_FRONTEND=${DEBIAN_FRONTEND:-noninteractive}

RUN set -ex && \
apt-get update && \
apt-get install -y --no-install-recommends \
# Wow... \
ca-certificates \
# mpdpopm pre-requisistes \
rustc cargo locales texinfo \
# for my sanity \
less procps gdb sudo info vim && \
# tidy-up \
apt-get clean && \
rm -rf /tmp/* /var/tmp/* && \
# set the timezone to civilization (i.e. the Pacific) \
ln -fs /usr/share/zoneinfo/US/Pacific /etc/localtime && dpkg-reconfigure -f noninteractive tzdata && \
# Setup the en_US.UTF-8 locale \
cp -v /etc/locale.gen /etc/locale.gen.orig && \
sed 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen >> /tmp/locale.gen.$$ && \
mv -v /tmp/locale.gen.$$ /etc/locale.gen && \
locale-gen en_US.UTF-8 && \
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 && \
# re-include the doc directories \
(test -d /usr/share/man/man1 || mkdir /usr/share/man/man1) && \
echo "path-include /usr/share/doc/scribbu" >> /etc/dpkg/dpkg.cfg.d/docker && \
echo "path-include /usr/share/man/man1/scribbu*" >> /etc/dpkg/dpkg.cfg.d/docker && \
echo "path-include /usr/share/info/scribbu.info" >> /etc/dpkg/dpkg.cfg.d/docker && \
useradd -ms /bin/bash -G users,sudo mgh && \
echo 'mgh:mgh' | chpasswd && \
cp -v /etc/sudoers /etc/sudoers.orig && \
echo 'mgh ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
echo "Installing pre-requisites..." && \
apt-get update && \
apt-get upgrade && \
apt-get install -y --no-install-recommends \
# Wow... \
ca-certificates \
# mpdpopm pre-requisistes (we'll install rust separately, below) \
gcc gcc-multilib locales texinfo \
# not needed; just for my sanity while debugging \
less procps gdb sudo info vim curl && \
# tidy-up \
apt-get clean && \
rm -rf /tmp/* /var/tmp/* && \
# set the timezone to civilization (i.e. the Pacific) \
ln -fs /usr/share/zoneinfo/US/Pacific /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata && \
# Setup the en_US.UTF-8 locale \
cp -v /etc/locale.gen /etc/locale.gen.orig && \
sed -i 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen en_US.UTF-8 && \
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 && \
# re-include the doc directories \
(test -d /usr/share/man/man1 || mkdir /usr/share/man/man1) && \
echo "path-include /usr/share/doc/scribbu" >> /etc/dpkg/dpkg.cfg.d/docker && \
echo "path-include /usr/share/man/man1/scribbu*" >> /etc/dpkg/dpkg.cfg.d/docker && \
echo "path-include /usr/share/info/scribbu.info" >> /etc/dpkg/dpkg.cfg.d/docker && \
echo "Installing pre-requisites... done." && \
# Finally, setup a non-privileged user \
useradd -ms /bin/bash -G users,sudo mgh && \
echo 'mgh:mgh' | chpasswd && \
cp -v /etc/sudoers /etc/sudoers.orig && \
echo 'mgh ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# The test suite won't work if this isn't set:
ENV LANG="en_US.UTF-8"

USER mgh

RUN cargo install cargo-deb

ENV PATH="/home/mgh/.cargo/bin:${PATH}"
RUN set -ex && \
# install the Rust toolchain \
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -o /tmp/rustup.sh && \
chmod a+x /tmp/rustup.sh && /tmp/rustup.sh -y && \
. /home/mgh/.cargo/env && \
cargo install cargo-deb
1 change: 1 addition & 0 deletions admin/build-dev-debian-pkg-cnt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

set -ex
source $HOME/.cargo/env
base="$(basename $1 .tar.gz)"
version="${base:8}"
cp -v /"$1" /tmp
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([mpdpopm], [0.3.2], [sp1ff@pobox.com], [mpdpopm], [https://github.com/sp1ff/mpdpopm])
AC_INIT([mpdpopm], [0.3.1], [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])
Expand Down
4 changes: 2 additions & 2 deletions doc/version.texi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@set UPDATED 29 March 2021
@set UPDATED-MONTH March 2021
@set EDITION 0.3.2
@set VERSION 0.3.2
@set EDITION 0.3.1
@set VERSION 0.3.1
2 changes: 1 addition & 1 deletion mpdpopm/Cargo.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ tokio = { version = "1.15.0", features = ["io-util", "macros", "net", "process",

[package.metadata.deb]
maintainer = "@PACKAGE_AUTHOR@"
copyright = "Copyright (C) 2020-2021 @PACKAGE_AUTHOR@"
copyright = "Copyright (C) 2020-2023 @PACKAGE_AUTHOR@"
extended-description = """
mpdpopm provides a companion daemon to mpd <https://www.musicpd.org>/ \
for maintaining play counts, ratings and last-played timestamps, \
Expand Down
2 changes: 1 addition & 1 deletion mpdpopm/src/clients.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020-2021 Michael Herstine <sp1ff@pobox.com>
// Copyright (C) 2020-2023 Michael Herstine <sp1ff@pobox.com>
//
// This file is part of mpdpopm.
//
Expand Down
2 changes: 1 addition & 1 deletion mpdpopm/src/commands.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020-2021 Michael Herstine <sp1ff@pobox.com>
// Copyright (C) 2020-2023 Michael Herstine <sp1ff@pobox.com>
//
// This file is part of mpdpopm.
//
Expand Down
2 changes: 1 addition & 1 deletion mpdpopm/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2021 Michael Herstine <sp1ff@pobox.com>
// Copyright (C) 2021-2023 Michael Herstine <sp1ff@pobox.com>
//
// This file is part of mpdpopm.
//
Expand Down
2 changes: 1 addition & 1 deletion mpdpopm/src/filters.lalrpop
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020-2021 Michael Herstine <sp1ff@pobox.com> -*- mode: rust; rust-format-on-save: nil -*-
// Copyright (C) 2020-2023 Michael Herstine <sp1ff@pobox.com> -*- mode: rust; rust-format-on-save: nil -*-
//
// This file is part of mpdpopm.
//
Expand Down
2 changes: 1 addition & 1 deletion mpdpopm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020-2021 Michael Herstine <sp1ff@pobox.com>
// Copyright (C) 2020-2023 Michael Herstine <sp1ff@pobox.com>
//
// This file is part of mpdpopm.
//
Expand Down
2 changes: 1 addition & 1 deletion mpdpopm/src/messages.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020-2021 Michael Herstine <sp1ff@pobox.com>
// Copyright (C) 2020-2023 Michael Herstine <sp1ff@pobox.com>
//
// This file is part of mpdpopm.
//
Expand Down
2 changes: 1 addition & 1 deletion mpdpopm/src/playcounts.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020-2021 Michael Herstine <sp1ff@pobox.com>
// Copyright (C) 2020-2023 Michael Herstine <sp1ff@pobox.com>
//
// This file is part of mpdpopm.
//
Expand Down
2 changes: 1 addition & 1 deletion mpdpopm/src/ratings.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020-2021 Michael Herstine <sp1ff@pobox.com>
// Copyright (C) 2020-2023 Michael Herstine <sp1ff@pobox.com>
//
// This file is part of mpdpopm.
//
Expand Down

0 comments on commit 599cd06

Please sign in to comment.