From 983db5dd2f9b2a22e5beb44f019f2b1538c25b5f Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Wed, 20 Nov 2024 00:46:43 +0300 Subject: [PATCH] import lprint-1.3.1-8.el10 --- SOURCES/lprint.conf | 1 + SPECS/lprint.spec | 42 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/SOURCES/lprint.conf b/SOURCES/lprint.conf index 4a3d235..962317e 100644 --- a/SOURCES/lprint.conf +++ b/SOURCES/lprint.conf @@ -1,3 +1,4 @@ +# Default configuration # multi-queue - Support multiple print queues. # web-interface - Web UI. # raw-socket - Provide a raw ("JetDirect") socket for each printer on port 91xx. diff --git a/SPECS/lprint.spec b/SPECS/lprint.spec index a05977e..d4f8234 100644 --- a/SPECS/lprint.spec +++ b/SPECS/lprint.spec @@ -3,7 +3,7 @@ Name: lprint Version: 1.3.1 -Release: 3%{?dist} +Release: 8%{?dist} Summary: A Label Printer Application License: Apache-2.0 @@ -40,6 +40,8 @@ BuildRequires: systemd-rpm-macros # lprint server can run as a systemd service, but to don't require systemd by default, # require filesystem (provides /usr/lib/systemd/system too) Requires: filesystem +# RHEL-67908 lprint requires avahi-daemon.socket, but does not install avahi +Requires: avahi %description LPrint is a label printer application for macOS and Linux. Basically, @@ -71,16 +73,35 @@ export CC=%{__cc} install -p -D -m 0644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/lprint.conf %pre +# migration scriptlet to take care of incorrect conf locations if [ $1 -gt 1 ] then + # daemon moved /etc/lprint.conf into /var/lib/lprint.state if the latter was missing and + # no HOME env set - this is incorrect, move it back to /etc (server-options are present only in + # system conf file). It was daemon solution for migration of configuration after fixing the bug + # which gets fixed by next scriptlet (the state was written into /etc) + if test -f /var/lib/lprint.state + then + ! grep -q "^server-options" /var/lib/lprint.state || mv -f /var/lib/lprint.state /etc/lprint.conf + fi + + # the original issue - state was written into /etc instead of /var/lib - check if the /etc/lprint.conf + # is an actual state file, and if it is, move it into right directory if state file does not exist. if test ! -f /var/lib/lprint.state -a -f /etc/lprint.conf then # if the lprint.conf is the default one from RPM, do not move - grep -q "^# Fedora default configuration" lprint.conf || mv -f /etc/lprint.conf /var/lib/lprint.state + grep -q "^server-options" /etc/lprint.conf || mv -f /etc/lprint.conf /var/lib/lprint.state fi fi %post +# generate an empty state file to prevent /etc config file being moved into +# /var/lib/ - it will be rewritten by the daemon either way +if test ! -f /var/lib/lprint.state +then + touch /var/lib/lprint.state +fi + %systemd_post lprint.service %preun @@ -111,9 +132,26 @@ fi %{_mandir}/man1/lprint.1* %{_mandir}/man5/lprint.conf.5* %{_unitdir}/lprint.service +%ghost %verify(not mode) %{_sharedstatedir}/lprint.state %changelog +* Mon Nov 18 2024 Zdenek Dohnal - 1.3.1-8 +- RHEL-62834 ignore the mode on lprint.state + +* Mon Nov 18 2024 Zdenek Dohnal - 1.3.1-7 +- RHEL-62834 Fix post scriptlet + +* Mon Nov 18 2024 Zdenek Dohnal - 1.3.1-6 +- RHEL-67908 lprint requires avahi-daemon.socket, but does not install avahi + +* Tue Oct 29 2024 Troy Dawson - 1.3.1-5 +- Bump release for October 2024 mass rebuild: + Resolves: RHEL-64018 + +* Wed Oct 16 2024 Zdenek Dohnal - 1.3.1-4 +- RHEL-62834 Fix post scriptlet + * Thu Aug 08 2024 Zdenek Dohnal - 1.3.1-3 - rebuilt with updated pappl