[opensuse-packaging] How to specify a 'same build' RPM dependency?
Hello, I have a package made from a single source tar ball where I split stuff which requires X11 into a sub-package so that the main-package can be installed on a system without X11. Because the stuff in the sub-package could have any kind of subtle dependency on the stuff in the main-package, I like to make sure that the sub-package requires the 100% exact matching main-package. Furthermore, when the sub-package is installed, I like to make sure that the main-package cannot be changed without changing the sub-package accordingly. In the end I like that the sub-package and the main-package must come from the same build where both the main-package and its sub-package have been made. An approximation could be: foo.spec ---------------------------------------------------------- Name: foo Conflicts: foo-x11 < %{version}-%{release} Conflicts: foo-x11 > %{version}-%{release} ... %package x11 Requires: foo = %{version}-%{release} ---------------------------------------------------------- But then it is still possible that main-package and sub-package with exact matching version-release are installed but both come from totally different OBS projects/repositories (e.g. with different patches or whatever kind of differences). Is there a way to specify a 'same build' RPM dependency? By the way: The RPM documentation http://www.rpm.org/max-rpm/s1-rpm-depend-manual-dependencies.html and /usr/share/doc/packages/rpm/manual/dependencies (in rpm-4.8.0 in openSUSE 11.4) does not show a comparison operator for "not equal" so that two Conflicts with '<' and '>' are used. Kind Regards Johannes Meixner -- SUSE LINUX Products GmbH -- Maxfeldstrasse 5 -- 90409 Nuernberg -- Germany HRB 16746 (AG Nuernberg) GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Though this isn't really elegant, I supposed you could try: - package #1 (...) Requires: awesome-stuff - package #2 (...) Provides: awesome-stuff That would most likely do the trick. I'm not sure if people should abuse virtual provides, but... it's a way. NM 2012/2/16 Johannes Meixner <jsmeix@suse.de>:
Hello,
I have a package made from a single source tar ball where I split stuff which requires X11 into a sub-package so that the main-package can be installed on a system without X11.
Because the stuff in the sub-package could have any kind of subtle dependency on the stuff in the main-package, I like to make sure that the sub-package requires the 100% exact matching main-package.
Furthermore, when the sub-package is installed, I like to make sure that the main-package cannot be changed without changing the sub-package accordingly.
In the end I like that the sub-package and the main-package must come from the same build where both the main-package and its sub-package have been made.
An approximation could be:
foo.spec ---------------------------------------------------------- Name: foo Conflicts: foo-x11 < %{version}-%{release} Conflicts: foo-x11 > %{version}-%{release} ... %package x11 Requires: foo = %{version}-%{release} ----------------------------------------------------------
But then it is still possible that main-package and sub-package with exact matching version-release are installed but both come from totally different OBS projects/repositories (e.g. with different patches or whatever kind of differences).
Is there a way to specify a 'same build' RPM dependency?
By the way: The RPM documentation http://www.rpm.org/max-rpm/s1-rpm-depend-manual-dependencies.html and /usr/share/doc/packages/rpm/manual/dependencies (in rpm-4.8.0 in openSUSE 11.4) does not show a comparison operator for "not equal" so that two Conflicts with '<' and '>' are used.
Kind Regards Johannes Meixner -- SUSE LINUX Products GmbH -- Maxfeldstrasse 5 -- 90409 Nuernberg -- Germany HRB 16746 (AG Nuernberg) GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
-- Nelson Marques /* http://www.marques.so nmo.marques@gmail.com */ -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Hello, On Feb 16 14:08 Nelson Marques wrote (excerpt):
- package #1 (...) Requires: awesome-stuff
- package #2 (...) Provides: awesome-stuff
It seems I do not understand what you mean. Could you explain how this would make sure that both packages must come from the same build where both the main-package and its sub-package have been made? Kind Regards Johannes Meixner -- SUSE LINUX Products GmbH -- Maxfeldstrasse 5 -- 90409 Nuernberg -- Germany HRB 16746 (AG Nuernberg) GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On 16.02.2012 15:05, Johannes Meixner wrote:
An approximation could be:
foo.spec ---------------------------------------------------------- Name: foo Conflicts: foo-x11 < %{version}-%{release} Conflicts: foo-x11 > %{version}-%{release}
... %package x11 Requires: foo = %{version}-%{release} ----------------------------------------------------------
But then it is still possible that main-package and sub-package with exact matching version-release are installed but both come from totally different OBS projects/repositories (e.g. with different patches or whatever kind of differences).
Is there a way to specify a 'same build' RPM dependency? If you _really_ wanted to avoid the IMO rather small chance of matching %release in different repositories, you can generate a large random number in your build and require it as provided by foo.
Greetings, Stephan -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Thu, Feb 16, 2012 at 03:05:37PM +0100, Johannes Meixner wrote:
foo.spec ---------------------------------------------------------- Name: foo Conflicts: foo-x11 < %{version}-%{release} Conflicts: foo-x11 > %{version}-%{release} ... %package x11 Requires: foo = %{version}-%{release} ----------------------------------------------------------
I don't think those "Conflicts" make much sense if you also have the Requires line. (Also note that the conflicts don't work with multiversion packages.) Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX Products GmbH, GF Jeff Hawn, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Johannes Meixner wrote:
[...] An approximation could be:
foo.spec ---------------------------------------------------------- Name: foo Conflicts: foo-x11 < %{version}-%{release} Conflicts: foo-x11 > %{version}-%{release} ... %package x11 Requires: foo = %{version}-%{release} ----------------------------------------------------------
But then it is still possible that main-package and sub-package with exact matching version-release are installed but both come from totally different OBS projects/repositories (e.g. with different patches or whatever kind of differences).
Is that really a problem that needs a solution? Adding arbitrary repos can lead to all kinds of problems anyways. Also, since %release consists of checkin and rebuild counter in obs finding two completely independent packages with the same value seems to be quite unusual too. cu Ludwig -- (o_ Ludwig Nussel //\ V_/_ http://www.suse.de/ SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Thu, Feb 16, 2012 at 9:05 AM, Johannes Meixner <jsmeix@suse.de> wrote:
Hello,
I have a package made from a single source tar ball where I split stuff which requires X11 into a sub-package so that the main-package can be installed on a system without X11.
Because the stuff in the sub-package could have any kind of subtle dependency on the stuff in the main-package, I like to make sure that the sub-package requires the 100% exact matching main-package.
Furthermore, when the sub-package is installed, I like to make sure that the main-package cannot be changed without changing the sub-package accordingly.
In the end I like that the sub-package and the main-package must come from the same build where both the main-package and its sub-package have been made.
An approximation could be:
foo.spec ---------------------------------------------------------- Name: foo Conflicts: foo-x11 < %{version}-%{release} Conflicts: foo-x11 > %{version}-%{release} ... %package x11 Requires: foo = %{version}-%{release} ----------------------------------------------------------
But then it is still possible that main-package and sub-package with exact matching version-release are installed but both come from totally different OBS projects/repositories (e.g. with different patches or whatever kind of differences).
Is there a way to specify a 'same build' RPM dependency?
By the way: The RPM documentation http://www.rpm.org/max-rpm/s1-rpm-depend-manual-dependencies.html and /usr/share/doc/packages/rpm/manual/dependencies (in rpm-4.8.0 in openSUSE 11.4) does not show a comparison operator for "not equal" so that two Conflicts with '<' and '>' are used.
Kind Regards Johannes Meixner
2 ideas, neither elegant (ie. both ugly) 1) Use a version suffix that is unique to each repo: Version: 1.2.3+%reponame Then you would need to define reponame uniquely in each specfile. I believe the syntax for version allows alphanumeric after a + sign, so at least the reponame could be meaningful to a human. Is there a predefined %reponame like variable? If so, that would be far preferred over a manually maintained one. I don't know what side effects this would have for zypper managing updates, etc. 2) Similar but use the Release instead. I think the release has to be numeric? Anyway, I have noticed that if you specify a release as 2.0, etc., then OBS will leave the 2 unchanged and do its auto-release numbering just to the trailing 0. So you could do: Release: %reponumber.0 Then have a well enumerated list of reponumbers defined in the specfile. One obvious negative with this is that zypper would prefer higher numbered Releases, but since zypper up won't change repos, it should not be *too bad* for the enduser to track. fyi: I don't know if this treatment of Releases is by design, or a side-effect of the implementation process. If a side-effect it might fail in the future. Greg -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Quoting Johannes Meixner <jsmeix@suse.de>:
Hello,
I have a package made from a single source tar ball where I split stuff which requires X11 into a sub-package so that the main-package can be installed on a system without X11.
Because the stuff in the sub-package could have any kind of subtle dependency on the stuff in the main-package, I like to make sure that the sub-package requires the 100% exact matching main-package.
Furthermore, when the sub-package is installed, I like to make sure that the main-package cannot be changed without changing the sub-package accordingly.
In the end I like that the sub-package and the main-package must come from the same build where both the main-package and its sub-package have been made.
An approximation could be:
foo.spec ---------------------------------------------------------- Name: foo Conflicts: foo-x11 < %{version}-%{release} Conflicts: foo-x11 > %{version}-%{release} ... %package x11 Requires: foo = %{version}-%{release} ----------------------------------------------------------
you could probably do something alone those lines (paraphrasing): foo.spec %define build_md5 %(md5sum(%date%-%time)) [...] Provides: foo(%build_md5) = %{version}-%{release} %package x11 Requires: foo(%build_md5} = %{version}-%{release} === %date%-%time% above of course needs to be written in proper shell to give you something useful.. you can mix in anything you wish... This should help to have foo-x11 really only installable in the same situation. (Of course in theory this can still be matched by a rogue packager to get your md5 and tweak version/release to be installable... but then you have a rogue packager and nobody could stop the user from doing rpm -i --nodeps anyway. Hope that gets you on track, Dominique -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (7)
-
Dominique Leuenberger a.k.a DimStar
-
Greg Freemyer
-
Johannes Meixner
-
Ludwig Nussel
-
Michael Schroeder
-
Nelson Marques
-
Stephan Kulow