From 3fee661bd321ecd8343b6e902db5f5656d5e0e74 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Mon, 9 Sep 2024 15:03:10 +0800 Subject: [PATCH] cleanup spec (cherry picked from commit c9afec694b98034291d3ee7fd722e4a7f243c292) --- liblockfile.spec | 60 ++++++++++++++++++++++++++++-------------------- liblockfile.yaml | 2 +- 2 files changed, 36 insertions(+), 26 deletions(-) diff --git a/liblockfile.spec b/liblockfile.spec index 9228cc5..5ce5700 100644 --- a/liblockfile.spec +++ b/liblockfile.spec @@ -1,12 +1,13 @@ Name: liblockfile Version: 1.17 -Release: 2 +Release: 3 Summary: Library providing functions to lock standard mailboxes -License: GPLv2+ and LGPLv2+ +License: GPL-2.0-or-later AND LGPL-2.0-or-later URL: https://github.com/miquels/liblockfile Source0: https://github.com/miquels/liblockfile/archive/v%{version}.tar.gz -BuildRequires: gcc +BuildRequires: gcc make +BuildRequires: ldconfig %description This library implements a number of functions found in -lmail on SysV @@ -20,49 +21,58 @@ Requires: liblockfile = %{version}-%{release} The liblockfile-devel package contains libraries and header files for liblockfile development. -%package help -Summary: Liblockfile help docs and manual pages -Requires: liblockfile = %{version}-%{release} -Buildarch: noarch - -%description help -The liblockfile-help package contains help docs and manual pages for liblockfile. +%package_help %prep %autosetup -n liblockfile-%{version} -p1 -sed -i "s/-g root//" Makefile.in +# There are occurrences of "install -g GROUP ...". +# +# Changing the group requires permissions that are normally not +# available while packaging. +# +# Let's remove "-g GROUP". +sed -Ei "/install/ s/-g [^ ]+//" Makefile.in + +# Makefile.in mixes and messes with DESTDIR and prefix. +# See the following pull requests submitted upstream: +# https://github.com/miquels/liblockfile/pull/11 +# https://github.com/miquels/liblockfile/pull/15 +sed -i \ + -e '/^prefix/s,\$(DESTDIR),,' \ + -e 's,\(\$(\(lib\|include\|man\|nfslock\|bin\)dir)\),$(DESTDIR)\1,' \ + -e '/-DLOCKPROG/s,\$(DESTDIR),,' Makefile.in %build -%configure --enable-shared --prefix=%{buildroot} --bindir=%{buildroot}%{_bindir} --mandir=%{buildroot}%{_mandir} --libdir=%{buildroot}%{_libdir} --includedir=%{buildroot}%{_includedir} +%configure --enable-shared %make_build %install %make_install -ldconfig -N -n %{buildroot}/%{_libdir} - -%post -/sbin/ldconfig - -%postun -/sbin/ldconfig +/sbin/ldconfig -N -n %{buildroot}/%{_libdir} %files -%doc COPYRIGHT -%{_bindir}/dotlockfile -%{_libdir}/{liblockfile.so.1.0,liblockfile.so.1} +%license COPYRIGHT +%attr(2755,root,mail) %{_bindir}/dotlockfile +%{_libdir}/liblockfile.so.* %files devel -%{_libdir}/{liblockfile.so,liblockfile.a} -%{_includedir}/{maillock.h,lockfile.h} +%{_libdir}/liblockfile.so +%{_libdir}/liblockfile.a +%{_includedir}/maillock.h +%{_includedir}/lockfile.h %files help %doc README Changelog %{_mandir}/man1/dotlockfile.1* -%{_mandir}/man3/{lockfile_create.3*,maillock.3*} +%{_mandir}/man3/lockfile_create.3* +%{_mandir}/man3/maillock.3* %changelog +* Thu Sep 19 2024 Funda Wang - 1.17-3 +- cleanup spec + * Tue Aug 20 2024 Bowen Wang - 1.17-2 - Added 'Buildarch: noarch' to the help subpackage diff --git a/liblockfile.yaml b/liblockfile.yaml index 4906c9a..0df2a27 100644 --- a/liblockfile.yaml +++ b/liblockfile.yaml @@ -1,4 +1,4 @@ version_control: github src_repo: miquels/liblockfile tag_prefix: ^v -seperator: . +separator: .