Re: [Spacewalk-devel] [PATCH] build rhncfg on openSUSE

2011-04-15 Thread Jan Pazdziora
On Fri, Apr 15, 2011 at 01:38:21PM +0200, Michael Calmer wrote:
> Hi,
> 
> Am Freitag, 8. April 2011, 14:57:56 schrieb Michael Calmer:
> > Hi,
> > 
> > here is the patch for rhncfg.
> > 
> > 0007-build-rhncfg-on-SUSE.patch:
> > - only some specfile modifications
> 
> I splitted this into seperate patches. One SUSE specific and one general one
> like you suggested. 

Pushed to master as dae10073c35f9cbba7d1160014788316c56c37aa
and baf0e0467eb5d6c924532399537a02b3ad26cf4a
and tagged as rhncfg-5.10.2-1

Thanks,

-- 
Jan Pazdziora
Principal Software Engineer, Satellite Engineering, Red Hat

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


Re: [Spacewalk-devel] [PATCH] build rhncfg on openSUSE

2011-04-15 Thread Michael Calmer
Hi,

Am Freitag, 8. April 2011, 14:57:56 schrieb Michael Calmer:
> Hi,
> 
> here is the patch for rhncfg.
> 
> 0007-build-rhncfg-on-SUSE.patch:
> - only some specfile modifications

I splitted this into seperate patches. One SUSE specific and one general one
like you suggested. 

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From b31b81520f06693b299f962eb20bec4c4bd7d01a Mon Sep 17 00:00:00 2001
From: Michael Calmer 
Date: Thu, 14 Apr 2011 18:13:25 +0200
Subject: [PATCH 05/13] build rhncfg build on SUSE

- provide on SUSE missing directories
---
 client/tools/rhncfg/rhncfg.spec |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/client/tools/rhncfg/rhncfg.spec b/client/tools/rhncfg/rhncfg.spec
index 43384e6..f760038 100644
--- a/client/tools/rhncfg/rhncfg.spec
+++ b/client/tools/rhncfg/rhncfg.spec
@@ -17,7 +17,12 @@ BuildRequires: python
 Requires: python
 Requires: rhnlib >= 2.5.32
 Requires: rhn-client-tools
+%if 0%{?suse_version}
+# provide rhn directories and no selinux on suse
+BuildRequires: rhn-client-tools
+%else
 Requires: libselinux-python
+%endif
 
 %description 
 The base libraries and functions needed by all rhncfg-* packages.
@@ -68,6 +73,9 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root,-)
+%if 0%{?suse_version}
+%dir %{_sharedstatedir}
+%endif
 %{rhnroot}/config_common
 %{_sharedstatedir}/rhncfg/backups
 %doc LICENSE PYTHON-LICENSES.txt
-- 
1.7.3.4

From 73cb7d7a4d15ddf533d537f3ec3bcfe016a88d3d Mon Sep 17 00:00:00 2001
From: Michael Calmer 
Date: Thu, 14 Apr 2011 18:24:47 +0200
Subject: [PATCH 06/13] add missing directories to filelist

---
 client/tools/rhncfg/rhncfg.spec |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/client/tools/rhncfg/rhncfg.spec b/client/tools/rhncfg/rhncfg.spec
index f760038..0d55a8b 100644
--- a/client/tools/rhncfg/rhncfg.spec
+++ b/client/tools/rhncfg/rhncfg.spec
@@ -76,6 +76,7 @@ rm -rf $RPM_BUILD_ROOT
 %if 0%{?suse_version}
 %dir %{_sharedstatedir}
 %endif
+%dir %{_sharedstatedir}/rhncfg
 %{rhnroot}/config_common
 %{_sharedstatedir}/rhncfg/backups
 %doc LICENSE PYTHON-LICENSES.txt
@@ -96,7 +97,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files actions
 %defattr(-,root,root,-)
-%{rhnroot}/actions/*
+%{rhnroot}/actions
 %{_bindir}/rhn-actions-control
 %config(noreplace) %{client_caps_dir}/*
 %{_mandir}/man8/rhn-actions-control.8*
-- 
1.7.3.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] [PATCH] build rhncfg on openSUSE

2011-04-12 Thread Miroslav Suchy

Dne 12.4.2011 16:57, Michael Calmer napsal(a):

Ahh, different philosophies apply here :-)

Aha. Our "philosophy" is here:
http://fedoraproject.org/wiki/PackagingGuidelines#File_and_Directory_Ownership


So let me explain.

OBS does not build this RPM, because during build, every directory is checked
if it is owned by some package. rhn-client-tools is in Requires, but not

How the check is done? The package is installed with --nodeps?


1) add a BuildRequires: rhn-client-tools


Can be. But definitelly wrapped with  %if suse_version since this 
Requires is not needed in Fedora and RHEL (well probably not needed even 
in SUSE, only in OBS)



2) add the %dir statement like above, maybe with %if suse_version around. RPM
work fine with directories owned by multiple packages.


Yes, suse wrapper is ok.
I'm against ownership by multiple packages because:
a) it is explicitly forbidden in Fedora Guidelines:
"... If your package already requires that package for other reasons, 
then your package should not also own that directory."
b) I worked on several BZs in my life, where file/directory was owned by 
multiple packages but some of them use %attr(X), which was incompatible 
with %attr(Y) of that other package. And rpm will set attribute of that 
file/directory to that one, who will be installed last... So I learned 
the hard way to follow our Guidelines.



At SUSE we prefer to add the %dir statement to not accidently introduce build
cycles.

Please tell me what you would prefer. I will send a new patch later this week.


Both options are fine if you wrap it with "%if suse_version". So choose 
yourself.


Mirek

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


Re: [Spacewalk-devel] [PATCH] build rhncfg on openSUSE

2011-04-12 Thread Michael Calmer
Hi,

Am Montag, 11. April 2011, 16:53:41 schrieb Miroslav Suchý:
> On 04/08/2011 02:57 PM, Michael Calmer wrote:
> > Hi,
> > 
> > here is the patch for rhncfg.
> > 
> > 0007-build-rhncfg-on-SUSE.patch:
> > - only some specfile modifications
> 
> If I put aside the fact that I would prefer more commits about this
> splitting things which "allow build rhncfg on SUSE" like:
> +%if 0%{?rhel}
>  Requires: libselinux-python
>  %endif
> +%endif
> from general fixes, like:
> +%dir %{_sharedstatedir}/rhncfg
> 
> Then I have problem with:
> +%dir %{_sharedstatedir}
> This is owned by filesystem package on Fedora. If this is not owned by
> any base package on SUSE wrap it with if/endif

ok.
 
> +%dir %{rhnconf}
> This should not be there. This directory is owned by rhn-client-tools
> and we Require it.
> 
> +%dir %{client_caps_dir}
> This is the same. This directory is owned by rhn-client-tools and we
> Require it.

Ahh, different philosophies apply here :-)
So let me explain.

OBS does not build this RPM, because during build, every directory is checked 
if it is owned by some package. rhn-client-tools is in Requires, but not 
installed during the build process. This is the reason, why I get this error 
message. So I have two possibilities:

1) add a BuildRequires: rhn-client-tools

2) add the %dir statement like above, maybe with %if suse_version around. RPM 
work fine with directories owned by multiple packages.

At SUSE we prefer to add the %dir statement to not accidently introduce build 
cycles. 

Please tell me what you would prefer. I will send a new patch later this week. 

-- 
MFG

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


Re: [Spacewalk-devel] [PATCH] build rhncfg on openSUSE

2011-04-11 Thread Miroslav Suchý
On 04/08/2011 02:57 PM, Michael Calmer wrote:
> Hi,
> 
> here is the patch for rhncfg.
> 
> 0007-build-rhncfg-on-SUSE.patch:
> - only some specfile modifications

If I put aside the fact that I would prefer more commits about this
splitting things which "allow build rhncfg on SUSE" like:
+%if 0%{?rhel}
 Requires: libselinux-python
 %endif
+%endif
from general fixes, like:
+%dir %{_sharedstatedir}/rhncfg

Then I have problem with:
+%dir %{_sharedstatedir}
This is owned by filesystem package on Fedora. If this is not owned by
any base package on SUSE wrap it with if/endif

+%dir %{rhnconf}
This should not be there. This directory is owned by rhn-client-tools
and we Require it.

+%dir %{client_caps_dir}
This is the same. This directory is owned by rhn-client-tools and we
Require it.

-- 
Miroslav Suchy
Red Hat Satellite Engineering

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


[Spacewalk-devel] [PATCH] build rhncfg on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

here is the patch for rhncfg.

0007-build-rhncfg-on-SUSE.patch:
- only some specfile modifications

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From e121739043aef3810620b7a5a3d0c8d4206e7bea Mon Sep 17 00:00:00 2001
From: Michael Calmer 
Date: Mon, 4 Apr 2011 15:53:50 +0200
Subject: [PATCH 07/17] build rhncfg on SUSE

- modify specfile
---
 client/tools/rhncfg/rhncfg.spec |   12 +++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/client/tools/rhncfg/rhncfg.spec b/client/tools/rhncfg/rhncfg.spec
index cd92e13..4965430 100644
--- a/client/tools/rhncfg/rhncfg.spec
+++ b/client/tools/rhncfg/rhncfg.spec
@@ -21,8 +21,10 @@ Requires: rhnlib >= 2.5.32
 Requires: up2date
 %else
 Requires: rhn-client-tools
+%if 0%{?rhel}
 Requires: libselinux-python
 %endif
+%endif
 
 %description 
 The base libraries and functions needed by all rhncfg-* packages.
@@ -73,12 +75,17 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root,-)
+%dir %{rhnroot}
+%dir %{_sharedstatedir}
+%dir %{_sharedstatedir}/rhncfg
+%dir %{_sharedstatedir}/rhncfg/backups
 %{rhnroot}/config_common
 %{_sharedstatedir}/rhncfg/backups
 %doc LICENSE PYTHON-LICENSES.txt
 
 %files client
 %defattr(-,root,root,-)
+%dir %{rhnconf}
 %{rhnroot}/config_client
 %{_bindir}/rhncfg-client
 %attr(644,root,root) %config(noreplace) %{rhnconf}/rhncfg-client.conf
@@ -86,6 +93,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files management
 %defattr(-,root,root,-)
+%dir %{rhnconf}
 %{rhnroot}/config_management
 %{_bindir}/rhncfg-manager
 %attr(644,root,root) %config(noreplace) %{rhnconf}/rhncfg-manager.conf
@@ -93,7 +101,9 @@ rm -rf $RPM_BUILD_ROOT
 
 %files actions
 %defattr(-,root,root,-)
-%{rhnroot}/actions/*
+%dir %{rhnconf}
+%dir %{client_caps_dir}
+%{rhnroot}/actions
 %{_bindir}/rhn-actions-control
 %config(noreplace) %{client_caps_dir}/*
 %{_mandir}/man8/rhn-actions-control.8*
-- 
1.7.3.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel