[PATCH] Remove extraneous single quotes from IPV6ADDR_SECONDARIES
by jiahu
The IPV6ADDR_SECONDARIES setting in ifcfg files was being set
with an extra set of single quotes.
For example:
After defining a interface with multi-ipv6 addresses
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-enp2s0
DEVICE=enp2s0
ONBOOT=yes
IPV6INIT=yes
IPV6_AUTOCONF=no
DHCPV6C=no
IPV6ADDR=2002::200/64
IPV6ADDR_SECONDARIES="'2002::201/64 2002::202/64'"
Should like below:
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-enp2s0
DEVICE=enp2s0
ONBOOT=yes
IPV6INIT=yes
IPV6_AUTOCONF=no
DHCPV6C=no
IPV6ADDR=2002::200/64
IPV6ADDR_SECONDARIES="2002::201/64 2002::202/64"
Since the extra quotes are added in all cases, this patch just
unconditionally removes them.
---
data/xml/redhat-get.xsl | 2 --
data/xml/suse-get.xsl | 2 --
tests/redhat/schema/ipv6-static-multi.xml | 2 +-
tests/suse/schema/ipv6-static-multi.xml | 2 +-
4 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/data/xml/redhat-get.xsl b/data/xml/redhat-get.xsl
index 923dde0..a3970de 100644
--- a/data/xml/redhat-get.xsl
+++ b/data/xml/redhat-get.xsl
@@ -226,14 +226,12 @@
<xsl:if test="count(ip) > 1">
<node label="IPV6ADDR_SECONDARIES">
<xsl:attribute name="value">
- <xsl:text>'</xsl:text>
<xsl:for-each select="ip[1]/following-sibling::ip[following-sibling::ip]">
<xsl:value-of select="@address"/><xsl:if test="@prefix">/<xsl:value-of select="@prefix"/></xsl:if><xsl:value-of select="string(' ')"/>
</xsl:for-each>
<xsl:for-each select="ip[last()]">
<xsl:value-of select="@address"/><xsl:if test="@prefix">/<xsl:value-of select="@prefix"/></xsl:if>
</xsl:for-each>
- <xsl:text>'</xsl:text>
</xsl:attribute>
</node>
</xsl:if>
diff --git a/data/xml/suse-get.xsl b/data/xml/suse-get.xsl
index 182d292..bc5eb72 100644
--- a/data/xml/suse-get.xsl
+++ b/data/xml/suse-get.xsl
@@ -243,14 +243,12 @@
<xsl:if test="count(ip) > 1">
<node label="IPV6ADDR_SECONDARIES">
<xsl:attribute name="value">
- <xsl:text>'</xsl:text>
<xsl:for-each select="ip[1]/following-sibling::ip[following-sibling::ip]">
<xsl:value-of select="@address"/><xsl:if test="@prefix">/<xsl:value-of select="@prefix"/></xsl:if><xsl:value-of select="string(' ')"/>
</xsl:for-each>
<xsl:for-each select="ip[last()]">
<xsl:value-of select="@address"/><xsl:if test="@prefix">/<xsl:value-of select="@prefix"/></xsl:if>
</xsl:for-each>
- <xsl:text>'</xsl:text>
</xsl:attribute>
</node>
</xsl:if>
diff --git a/tests/redhat/schema/ipv6-static-multi.xml b/tests/redhat/schema/ipv6-static-multi.xml
index d865a05..f1f82cd 100644
--- a/tests/redhat/schema/ipv6-static-multi.xml
+++ b/tests/redhat/schema/ipv6-static-multi.xml
@@ -7,6 +7,6 @@
<node label="IPV6_AUTOCONF" value="no"/>
<node label="DHCPV6C" value="no"/>
<node label="IPV6ADDR" value="3ffe:ffff:0:5::1/128"/>
- <node label="IPV6ADDR_SECONDARIES" value="'3ffe:ffff:0:5::3/128 3ffe:ffff:0:5::5/128'"/>
+ <node label="IPV6ADDR_SECONDARIES" value="3ffe:ffff:0:5::3/128 3ffe:ffff:0:5::5/128"/>
</tree>
</forest>
diff --git a/tests/suse/schema/ipv6-static-multi.xml b/tests/suse/schema/ipv6-static-multi.xml
index d865a05..f1f82cd 100644
--- a/tests/suse/schema/ipv6-static-multi.xml
+++ b/tests/suse/schema/ipv6-static-multi.xml
@@ -7,6 +7,6 @@
<node label="IPV6_AUTOCONF" value="no"/>
<node label="DHCPV6C" value="no"/>
<node label="IPV6ADDR" value="3ffe:ffff:0:5::1/128"/>
- <node label="IPV6ADDR_SECONDARIES" value="'3ffe:ffff:0:5::3/128 3ffe:ffff:0:5::5/128'"/>
+ <node label="IPV6ADDR_SECONDARIES" value="3ffe:ffff:0:5::3/128 3ffe:ffff:0:5::5/128"/>
</tree>
</forest>
--
1.8.1.4
9 years, 1 month
[PATCH] Don't return error if /sys/class/net/$dev/operstate isn't found
by Laine Stump
This can happen for alias "interfaces", e.g: "eth0:1" (which aren't
really an interface, but are a deprecated method of adding multiple IP
addresses to a single interface). Since only the base interface
("eth0") is really a device, only it has an entry in /sys/class/net.
It's not important that such interfaces have truly meaningful
information in their <link> element (as we don't really have any truly
meaningful state, and haven't historically provided other status for
alias interfaces (e.g. IP address). What *is* important is that we
don't return an error, as this breaks applications that rely on being
able to get back a successful (if empty) status for any interface
listed.
This resolves the regression with virt-manager described here:
https://bugzilla.redhat.com/show_bug.cgi?id=1185850
---
src/dutil_linux.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/dutil_linux.c b/src/dutil_linux.c
index 19e36ca..00c378f 100644
--- a/src/dutil_linux.c
+++ b/src/dutil_linux.c
@@ -1081,8 +1081,14 @@ static void add_link_info(struct netcf *ncf,
xasprintf(&path, "/sys/class/net/%s/operstate", ifname);
ERR_NOMEM(!path, ncf);
state = read_file(path, &length);
- ERR_THROW_STRERROR(!state, ncf, EFILE, "Failed to read %s : %s",
- path, errbuf);
+ if (!state) {
+ /* missing operstate is *not* an error. It could be due to an
+ * alias interface, which has not entry in /sys/class/net at
+ * all, for example.
+ */
+ state = strdup("");
+ ERR_NOMEM(!state, ncf);
+ }
if ((nl = strchr(state, '\n')))
*nl = 0;
prop = xmlSetProp(link_node, BAD_CAST "state", BAD_CAST state);
--
1.9.3
9 years, 3 months
[PATCH] Better messages on failure reading /sys/class/net/$dev/(operstate|speed)
by Laine Stump
add_link_info() sets an error message when it fails to read
/sys/class/net/$dev/operstate, but unfortunately frees the path string
just prior to setting the error message, so the error string has
"(null)" instead (thanks to glibc's asprintf noticing the null
pointer).
Additionally, the macro used to create the log message,
ERR_THROW_STRERROR() already turns errno into a string in the locally
defined errbuf, but we aren't including it in the format string, so it
doesn't get printed.
This patch makes sure the path isn't freed until it is really no
longer needed, and adds errbuf to the log message.
This will hopefully help to find the root cause of
https://bugzilla.redhat.com/show_bug.cgi?id=1185850
---
src/dutil_linux.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/dutil_linux.c b/src/dutil_linux.c
index 71160ee..87d0d45 100644
--- a/src/dutil_linux.c
+++ b/src/dutil_linux.c
@@ -1,7 +1,7 @@
/*
* dutil_linux.c: Linux utility functions for driver backends.
*
- * Copyright (C) 2009-2012, 2014 Red Hat Inc.
+ * Copyright (C) 2009-2012, 2014-2015 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -1081,14 +1081,15 @@ static void add_link_info(struct netcf *ncf,
xasprintf(&path, "/sys/class/net/%s/operstate", ifname);
ERR_NOMEM(!path, ncf);
state = read_file(path, &length);
- FREE(path);
- ERR_THROW_STRERROR(!state, ncf, EFILE, "Failed to read %s", path);
+ ERR_THROW_STRERROR(!state, ncf, EFILE, "Failed to read %s : %s",
+ path, strerror);
if ((nl = strchr(state, '\n')))
*nl = 0;
prop = xmlSetProp(link_node, BAD_CAST "state", BAD_CAST state);
ERR_NOMEM(!prop, ncf);
if (!strcmp(state, "up")) {
+ FREE(path);
xasprintf(&path, "/sys/class/net/%s/speed", ifname);
ERR_NOMEM(path == NULL, ncf);
speed = read_file(path, &length);
@@ -1100,7 +1101,8 @@ static void add_link_info(struct netcf *ncf,
speed = strdup("0");
ERR_NOMEM(!speed, ncf);
}
- ERR_THROW_STRERROR(!speed, ncf, EFILE, "Failed to read %s", path);
+ ERR_THROW_STRERROR(!speed, ncf, EFILE, "Failed to read %s : %s",
+ path, strerror);
if ((nl = strchr(speed, '\n')))
*nl = 0;
} else {
--
1.9.3
9 years, 3 months
Re: [netcf-devel] [netcf] Update to packaging guidelines
by Laine Stump
(also re-sending this to the list because the original post was
auto-rejected. Zbigniew's address is now in the whitelist, so it
shouldn't happen again)
On 01/08/2015 03:49 PM, Zbigniew Jędrzejewski-Szmek wrote:
> On Thu, Jan 08, 2015 at 03:42:03PM -0500, Laine Stump wrote:
>> 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
>>>>>
>>>>> @@ -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).
>> Ah, right - I missed the fact that the %clean line was also deleted. But
>> this leaves open the question of why you have %install only deleting
>> *.la in buildroot. The EPEL doc you reference implies that %install also
>> automatically cleans up buildroot for RHEL6+ (but doesn't exactly say
>> it). If this is the case, why do we need to remove *.la?
> .la files are removed because libtool insists on installing them but they
> are completely useless. This is unrelated to cleaning the buildroot.
>
> Zbyszek
>
9 years, 3 months
Re: [netcf-devel] [netcf] Update to packaging guidelines
by Laine Stump
(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
>
9 years, 3 months
Re: [netcf-devel] [netcf] Update to packaging guidelines
by Laine Stump
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
>>>
>>> @@ -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).
Ah, right - I missed the fact that the %clean line was also deleted. But
this leaves open the question of why you have %install only deleting
*.la in buildroot. The EPEL doc you reference implies that %install also
automatically cleans up buildroot for RHEL6+ (but doesn't exactly say
it). If this is the case, why do we need to remove *.la?
9 years, 3 months
Re: [netcf-devel] [netcf] Update to packaging guidelines
by Laine Stump
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?
> %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 (and replacement
in %clean with the find that only rm's *.la)?
>
> %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)
9 years, 3 months