[opensuse-buildservice] %make_install in prjconfig
I want to build tmux for many older versions of suse. The current .spec from factory uses %{make_install} OS versions before 11.2 do not have that macro. I got it working by making this change to the .spec from the current version 1.8 in factory: - %{?make_install} + %{?make_install} %{!?make_install:%%{__make} install DESTDIR=%{buildroot}} I have had other packages with the same problem, and I would like my branched copies of packages to stay clean of differences as possible so they keep tracking the devel packages instead of going stale or breaking when the devel package changes. And a lot of package maintainers are not interested in accepting SR's that add support for old targets like that, they would rather have the .spec file be small and pretty than functional. So now I want to move the fix from all the individual .spec files to my prjconfig, so the spec files can stay as upstream has them. I put this in my prjconfig %{!?make_install: %define make_install %{__make} install DESTDIR=%{buildroot}} And restored the .spec file to just assuming %{make_install} will always exist. It didn't work. OS 11.2 and up built fine as normal, 11.1 and below failed as normal. What did I do wrong? Can I actually centralize this this way? Is there a problem with trying to resolve %buildroot maybe? Can I escape the % in buildroot to cause it to be expanded later or something? Thanks -- bkw -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On Thursday 2013-11-07 23:56, Brian K. White wrote:
The current .spec from factory uses %{make_install} OS versions before 11.2 do not have that macro.
I got it working by making this change to the .spec from the current version 1.8 in factory:
- %{?make_install}
+ %{?make_install} %{!?make_install:%%{__make} install DESTDIR=%{buildroot}}
You can see how horrible that looks. (And it won't be any better if you stash it in a prjconf.) Just write make install DESTDIR="%buildroot" like suggested in all openSUSE (en) wiki entries that mention installation. -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On Thu, Nov 7, 2013 at 10:27 PM, Jan Engelhardt
On Thursday 2013-11-07 23:56, Brian K. White wrote:
The current .spec from factory uses %{make_install} OS versions before 11.2 do not have that macro.
I got it working by making this change to the .spec from the current version 1.8 in factory:
- %{?make_install}
+ %{?make_install} %{!?make_install:%%{__make} install DESTDIR=%{buildroot}}
You can see how horrible that looks. (And it won't be any better if you stash it in a prjconf.) Just write
make install DESTDIR="%buildroot"
like suggested in all openSUSE (en) wiki entries that mention installation.
I wish spec-cleaner would leave that in place. I often run spec-cleaner and simply take the output, but then someone who cares about SLES has to come along after me and clean that up. Thinking of SLES, when is it expected SLES 10 SP3 will be dropped from OBS as a repo? At the end of General Availability, or at the end of the extended availability period. (I'm sure I have the names of the support periods wrong, but you get the idea.) Greg -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On Friday 2013-11-08 15:51, Greg Freemyer wrote:
You can see how horrible that looks. (And it won't be any better if you stash it in a prjconf.) Just write
make install DESTDIR="%buildroot"
like suggested in all openSUSE (en) wiki entries that mention installation.
I wish spec-cleaner would leave that in place. [I wish spec-cleaner would leave `make install DESTDIR="%buildroot"` instead of substituting it by %make_install]
zypper in hxtools-scripts and you get a "spec-beautifier". Because clean is not enough :) -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
Dne Pá 8. listopadu 2013 09:51:02, Greg Freemyer napsal(a):
On Thu, Nov 7, 2013 at 10:27 PM, Jan Engelhardt
wrote: I wish spec-cleaner would leave that in place. I often run spec-cleaner and simply take the output, but then someone who cares about SLES has to come along after me and clean that up.
We are now in process of cleaning this thing up so definitely people are welcome on working on spec-cleaner [1]. Seriously we should do this in 2 phases. One where we create the spec file which is as clean as possible (eg the %make_install macro is used) and then on obs side we need to ensure these macros are provided for older versions of the distribution or other rpm based ones. Bigger problem is solving collision with the same name. %makeinstall doing completely different stuff between fedora and opensuse. Cheers Tom [1] https://github.com/openSUSE/spec-cleaner/commits/master
On Friday 2013-11-08 16:16, Tomáš Chvátal wrote:
Dne Pá 8. listopadu 2013 09:51:02, Greg Freemyer napsal(a):
On Thu, Nov 7, 2013 at 10:27 PM, Jan Engelhardt
wrote: I wish spec-cleaner would leave that in place. I often run spec-cleaner and simply take the output, but then someone who cares about SLES has to come along after me and clean that up.
We are now in process of cleaning this thing up so definitely people are welcome on working on spec-cleaner [1].
Seriously we should do this in 2 phases. One where we create the spec file which is as clean as possible (eg the %make_install macro is used)
Sorry, I do not consider the use of that being "clean". It's another instance of overdoing it with macros, as it is with %__cp. Such (%__cp) is -at most- only useful if you run with a non-GNU toolchain (meaning you go __cp = gcp), and that is not very likely happening anytime soon in openSUSE. -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
Dne Pá 8. listopadu 2013 16:47:29, Jan Engelhardt napsal(a):
Sorry, I do not consider the use of that being "clean". It's another instance of overdoing it with macros, as it is with %__cp.
Such (%__cp) is -at most- only useful if you run with a non-GNU toolchain (meaning you go __cp = gcp), and that is not very likely happening anytime soon in openSUSE.
Did you read what the tool does? It replaces the %__cp with cp or should in the end, same with install/rm... I just think the install macro should be unified for which purpose this stands. So it actually does what you want. Also as I said more workforce and list of replacements creators welcome. Cheers Tom
On Friday 2013-11-08 16:55, Tomáš Chvátal wrote:
Dne Pá 8. listopadu 2013 16:47:29, Jan Engelhardt napsal(a):
Sorry, I do not consider the use of that being "clean". It's another instance of overdoing it with macros, as it is with %__cp.
Such (%__cp) is -at most- only useful if you run with a non-GNU toolchain (meaning you go __cp = gcp), and that is not very likely happening anytime soon in openSUSE.
Did you read what the tool does? It replaces the %__cp with cp or should in the end, same with install/rm... I just think the install macro should be unified for which purpose this stands. So it actually does what you want.
It cleans up half and uglifies the other, like adding {} around every possible instance. And sometimes, it just does plain wrong things, like replacing PreReq by Requires(pre). Code talks, so here is """ The following changes since commit 3399f4e7fff8b319f1f5451b7979775689757d32: Use spdx identifier for licenses (2011-11-30 13:35:09 +0100) are available in the git repository at: git://git.inai.de/spec-cleaner master for you to fetch changes up to 57ed24ebe499b866fdb9726fda7e5e8e122a9430: spec-cleaner: uppercase URL (2013-11-08 17:34:38 +0100) ---------------------------------------------------------------- Jan Engelhardt (2): spec-cleaner: avoid any form of %make(_)install spec-cleaner: uppercase URL spec-cleaner | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) """ I still favor the result of spec-beautifier. -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On 11/8/2013 10:16 AM, Tomáš Chvátal wrote:
Dne Pá 8. listopadu 2013 09:51:02, Greg Freemyer napsal(a):
On Thu, Nov 7, 2013 at 10:27 PM, Jan Engelhardt
wrote: I wish spec-cleaner would leave that in place. I often run spec-cleaner and simply take the output, but then someone who cares about SLES has to come along after me and clean that up.
We are now in process of cleaning this thing up so definitely people are welcome on working on spec-cleaner [1].
Seriously we should do this in 2 phases. One where we create the spec file which is as clean as possible (eg the %make_install macro is used) and then on obs side we need to ensure these macros are provided for older versions of the distribution or other rpm based ones. Bigger problem is solving collision with the same name. %makeinstall doing completely different stuff between fedora and opensuse.
Cheers
Tom
Shouldn't OBS aim to provide an environment that is as close as possible to a native system install of the target? IE: Whatever a real fedora 4 box does for %makeinstall, that's what OBS should do in a fedora 4 prjconfig. It might be nice if a new spec file that uses %{make_install} would work even when building for an opensuse 11.0 target, but it would not be nice when the src.rpm is not buildable on a real opensuse 11.0 system. The whole point of src.rpm, and the whole point of being religious about putting only pristine unmodified upstream sources in them, with all patches in the form of patches, and all build steps self-documented in the .spec file, is so that no matter what, if you have an installable package, and the matching src.rpm, (and whatever dependencies that src.rpm specifies) then you can build that package, even if the rest of the world is gone and it's just you and your pc and nothing else. It's a promise the distribution makes that you are always supposed to be able to rely on. Another approach might be, if obs starts doing that, maybe we could create a package that includes these obs-only macros, and have the src.rpm buildrequires that package if any such macro was used. Then if you are on a 11.1 box, and you try to build the src.rpm of a package, rather than fail, it will tell you you just need to go get a package, just like any other package. Also that way the .spec is once again fully self-documenting. The only reason I was thinking about providing the macro in my own prjconfig was because it's only my own home project, and a maintainer of tmux happened to say in another list that he was not interested in cluttering up the spec file with support for old targets, so I didn't think it was worth SR-ing a change that changed out %make_install just to support targets older than opensuse 11.2, and I weighed the two evils, magic marco that won't work on the target boxes, or modify .spec in my branch and thus break my branch from staying up to date with the devel one. I didn't really want to do that prjconfig change at all. -- bkw -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
* Tomáš Chvátal
[-- Attachment #1 --] [-- Type: text/plain, Encoding: quoted-printable, Size: 1.0K --]
Dne Pá 8. listopadu 2013 09:51:02, Greg Freemyer napsal(a):
On Thu, Nov 7, 2013 at 10:27 PM, Jan Engelhardt
wrote: I wish spec-cleaner would leave that in place. I often run spec-cleaner and simply take the output, but then someone who cares about SLES has to come along after me and clean that up.
We are now in process of cleaning this thing up so definitely people are welcome on working on spec-cleaner [1].
Seriously we should do this in 2 phases. One where we create the spec file which is as clean as possible (eg the %make_install macro is used) and then on obs side we need to ensure these macros are provided for older versions of the distribution or other rpm based ones. Bigger problem is solving collision with the same name. %makeinstall doing completely different stuff between fedora and opensuse.
Because of its brokenness its usage has been outlawed in Fedora packaging policy anyway. %make_install has been available since Fedora 13 and there is an initiative to prefer %make_install over make install DESTDIR=%{?buildroot} ( https://fedoraproject.org/wiki/Make_install_packaging_draft ) So this problem should eventually solve itself. -- Guido Berhoerster -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On 11/7/2013 10:27 PM, Jan Engelhardt wrote:
On Thursday 2013-11-07 23:56, Brian K. White wrote:
The current .spec from factory uses %{make_install} OS versions before 11.2 do not have that macro.
I got it working by making this change to the .spec from the current version 1.8 in factory:
- %{?make_install}
+ %{?make_install} %{!?make_install:%%{__make} install DESTDIR=%{buildroot}}
You can see how horrible that looks. (And it won't be any better if you stash it in a prjconf.) Just write
make install DESTDIR="%buildroot"
like suggested in all openSUSE (en) wiki entries that mention installation.
I would love it if the devel package actually did that. I'll SR that and maybe request a maintainer role. Thanks -- bkw ps: Also there's a typo above, there was only one % in %{__make} I had doubled all the %'s when I made that line into a comment, and when I wrote the email it was by copying the comment and then hand editing to de-dupe the %'s -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
* Brian K. White
On 11/7/2013 10:27 PM, Jan Engelhardt wrote:
On Thursday 2013-11-07 23:56, Brian K. White wrote:
The current .spec from factory uses %{make_install} OS versions before 11.2 do not have that macro.
I got it working by making this change to the .spec from the current version 1.8 in factory:
- %{?make_install}
+ %{?make_install} %{!?make_install:%%{__make} install DESTDIR=%{buildroot}}
You can see how horrible that looks. (And it won't be any better if you stash it in a prjconf.) Just write
make install DESTDIR="%buildroot"
like suggested in all openSUSE (en) wiki entries that mention installation.
I would love it if the devel package actually did that. I'll SR that and maybe request a maintainer role.
Just to let you know, I have rejected Jan's sr's with such changes to my packages in the past and I will reject such a sr to tmux for the reasons Tomáš mentioned. This can be worked around through projconf and ultimately needs be fixed in SLE, not using a macro means that future policy/autotools changes will be much harder to implement in an automated fashion. -- Guido Berhoerster -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On Friday 2013-11-08 17:51, Guido Berhoerster wrote:
I would love it if the devel package actually did that. I'll SR that and maybe request a maintainer role.
Just to let you know, I have rejected Jan's sr's with such changes to my packages in the past and I will reject such a sr to tmux for the reasons Tomáš mentioned. This can be worked around through projconf
There is your problem - you are adding workarounds when we should be having *less* of them.
not using a macro means that future policy/autotools changes will be much harder to implement in an automated fashion.
This reeks of some secret agency wanting wiretaps so as to defend against future terrorists. It does not work. First, there is no change in sight, and second, when change comes, it may be of a kind that your macro cannot address. -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On 11/8/2013 11:51 AM, Guido Berhoerster wrote:
* Brian K. White
[2013-11-08 16:30]: On 11/7/2013 10:27 PM, Jan Engelhardt wrote:
On Thursday 2013-11-07 23:56, Brian K. White wrote:
The current .spec from factory uses %{make_install} OS versions before 11.2 do not have that macro.
I got it working by making this change to the .spec from the current version 1.8 in factory:
- %{?make_install}
+ %{?make_install} %{!?make_install:%%{__make} install DESTDIR=%{buildroot}}
You can see how horrible that looks. (And it won't be any better if you stash it in a prjconf.) Just write
make install DESTDIR="%buildroot"
like suggested in all openSUSE (en) wiki entries that mention installation.
I would love it if the devel package actually did that. I'll SR that and maybe request a maintainer role.
Just to let you know, I have rejected Jan's sr's with such changes to my packages in the past and I will reject such a sr to tmux for the reasons Tomáš mentioned. This can be worked around through projconf and ultimately needs be fixed in SLE, not using a macro means that future policy/autotools changes will be much harder to implement in an automated fashion.
I thought as much. This is why I didn't both SR before. Thanks for caring. That's why I love working on and with openSUSE so much the last few years. For the record, I think this attitude sucks. So, rest of list, given this jerks position, how might one work around it? To summarize the point I raised in my other post: Be it a change in OBS itself or a change in a prjconfig, providing a macro (or anything else for that matter) in OBS for a target that doesn't natively have it, produces a .rpm that will install, yet produce a src.rpm that will NOT build. Off hand I can think of two possible ways to work around this: 1) Make a new package that provides the missing macros? You can then just install the package on the target like any other buildrequires, thus making the src.rpm valid again. 2) Something even fancier in prjconfig? Can you get prjconfig to actually write out a different .spec into the src.rpm than the one that was used to create it? So, the .spec says %{make_install}, and when OBS writes out the src.rpm, it edits .spec on the fly and writes some pre-defined substitution in place of %{make_install} in the .spec in the src.rpm. The .spec in the OBS project remains unchanged. It should NOT simply expand %{make_install}, because that will result in the src.rpm has a .spec with hard coded path and other values. Even if it would always build the same, which I'm not actually sure of, it doesn't reflect what the .spec author wrote and it's a less useful .spec in it's own right to take as a starting point for local manual editing or learning from. So it has to be a fixed closest approximation that somebody works out ahead of time that probably uses %makinstall for some targets and %__make and %buildroot for others, etc. Whatever is best for each target. #2 would probably be the best. This way everyone's happy. OBS can stay all nice and tidy, taking advantage of the most current system, and yet the generated src.rpm still builds on a native system, and no need to find and install a weird new package that isn't going to be found in any of the normal repos. -- bkw -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On Friday 2013-11-08 18:24, Brian K. White wrote:
Be it a change in OBS itself or a change in a prjconfig, providing a macro (or anything else for that matter) in OBS for a target that doesn't natively have it, produces a .rpm that will install, yet produce a src.rpm that will NOT build.
2) Something even fancier in prjconfig? Can you get prjconfig to actually write out a different .spec into the src.rpm than the one that was used to create it?
There is a mechanism in prjconfig called "Substitutes:", however it is only used for (Build)Require, not for macros or arbitrary lines. This would cause substitution of the spec before being passed to rpmbuild, so that rpmbuild will include the so-changed .spec in the .src.rpm. -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
participants (5)
-
Brian K. White
-
Greg Freemyer
-
Guido Berhoerster
-
Jan Engelhardt
-
Tomáš Chvátal