(re-sending this to the list for archival purposes - Zbigniew replied to
the list, but the message was rejected because he wasn't subscribed)
On 01/08/2015 03:01 PM, Zbigniew Jędrzejewski-Szmek wrote:
On Thu, Jan 08, 2015 at 02:22:18PM -0500, Laine Stump wrote:
> Zbigniew Jędrzejewski-Szmek pushed the patch below to the netcf.spec in
> the Fedora package, and I had a couple questions about the changes so I
> figured I would post them here before making a similar patch for
> upstream. (Note that the "packaging guidelines" referenced are for
> Fedora, here:
http://fedoraproject.org/wiki/Packaging:Guidelines . They
> obviously don't apply to all ports of netcf, but I think only the Red
> Hat, CentOS, and Fedora ports of netcf use rpm anyway).
>
> On 01/08/2015 11:26 AM, Zbigniew Jędrzejewski-Szmek wrote:
>> commit d9f2694d2a67869728cfe1e3d874715f2fdcbc48
>> Author: Zbigniew Jędrzejewski-Szmek <zbyszek(a)in.waw.pl>
>> Date: Thu Jan 8 11:19:39 2015 -0500
>>
>> Update to packaging guidelines
>>
>> netcf.spec | 18 +++++-------------
>> 1 files changed, 5 insertions(+), 13 deletions(-)
>> ---
>> diff --git a/netcf.spec b/netcf.spec
>> index 6ba566e..1289cd3 100644
>> --- a/netcf.spec
>> +++ b/netcf.spec
>> @@ -23,11 +23,10 @@ BuildRoot:
%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
>> %endif
>>
>> %if %{with_systemd}
>> -BuildRequires: systemd-units
>> -Requires(post): systemd-units
>> -Requires(post): systemd-sysv
>> -Requires(preun): systemd-units
>> -Requires(postun): systemd-units
>> +BuildRequires: systemd
>> +Requires(post): systemd
>> +Requires(preun): systemd
>> +Requires(postun): systemd
> The justifications for this chunk, as I understand it are:
>
> 1) the systemd-units package was merged into the base systemd package as
> of (at least) whatever version was first in Fedora 20.
>
> * As far as I can see, systemd-units is still a separate package in
> systemd-208, which is what is in RHEL7 and CentOS7. So that means we
> should only make this change for Fedora >= 20 and RHEL >= 8 (which of
> course doesn't exist yet), correct?
>
> 2) the systemd-sysv package was never really used, and has now been
> completely removed.
>
> * see:
https://fedorahosted.org/fpc/ticket/308 for Lennart's statement
> about this
> * Is it safe to remove this even for RHEL7/CentOS7, where systemd-sysv
> still exists?
I'd think so.
>> %endif
>> %if 0%{?enable_autotools}
>> BuildRequires: autoconf
>> @@ -112,13 +111,9 @@ sed -i /StandardOutput=journal+console/d
src/netcf-transaction.service.in
>> make %{?_smp_mflags}
>>
>> %install
>> -rm -rf $RPM_BUILD_ROOT
>> make install DESTDIR=$RPM_BUILD_ROOT SYSTEMD_UNIT_DIR=%{_unitdir} \
>> INSTALL="%{__install} -p"
>> -find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
>> -
>> -%clean
>> -rm -rf $RPM_BUILD_ROOT
>> +find $RPM_BUILD_ROOT -name '*.la' -delete
>
> Zbigniew - I can't find the place in the Fedora packaging guidelines
> that recommends against doing this (and I'm by no means a specfile
> expert, even this one was originally written by someone else). Can you
> point me to the justification for removing the rm -rf's
It's not expressly forbidden to have a %clean section, but it's certainly
discouraged in new packages (e.g. fedora-review will complain). Cleanup is
done automatically by rpm in F13+ and EPEL6+ [1], so %clean can be removed to
save a few lines and simplify the spec file.
[1]
http://fedoraproject.org/wiki/EPEL:Packaging#Cleaning_BuildRoot_in_.25clean
> (and replacement in %clean with the find that only rm's *.la)?
Note that the rm's are still in %install (-delete is equivalent to the
-exec rm invocation).
>> %preun libs
>>
>> @@ -148,12 +143,10 @@ fi
>> %endif
>>
>> %files
>> -%defattr(-,root,root,-)
>> %{_bindir}/ncftool
>> %{_mandir}/man1/ncftool.1*
>>
>> %files libs
>> -%defattr(-,root,root,-)
>> %{_datadir}/netcf
>> %{_libdir}/*.so.*
>> %if %{with_systemd}
>> @@ -165,7 +158,6 @@ fi
>> %doc AUTHORS COPYING NEWS
>>
>> %files devel
>> -%defattr(-,root,root,-)
>> %doc
>> %{_includedir}/*
>> %{_libdir}/*.so
> I found in the Fedora guidelines where is says that defattr() isn't
> necessary for rpm 4.4 and greater. While we want netcf to build and work
> properly on some older systems, even RHEL6 is using rpm 4.8, so I think
> it is safe to remove these.
>
> BTW, all of these items should also be considered for libvirt (including
> the change to "rm -rf blah" in %install and %clean)
Zbyszek