On Sat, Jul 10, 2010 at 2:24 AM, Thiago Macieira <[email protected]> wrote: > On Saturday 10. July 2010 00.32.56 Felipe Contreras wrote: >> On Sat, Jul 10, 2010 at 12:18 AM, Thiago Macieira <[email protected]> wrote: >> > On Friday 9. July 2010 21.45.26 Felipe Contreras wrote: >> >> It's about having a spec file that works on Fedora, openSUSE, >> >> Mandriva, etc. Those are called distro-agnostic, or multi-distro. >> >> >> >> Here's one example: >> >> http://git.kernel.org/?p=git/git.git;a=blob;f=git.spec.in >> >> >> >> Such spec files build fine on MeeGo, but are rejected for >> >> integration because they "don't follow the guidelines". >> > >> > That file would be most likely be rejected in Mandriva too, for not >> > following the guidelines. >> >> Can you point out which specific sections of the guidelines are not >> met by the distro-agnostic spec file? Or are you just guessing? >> >> > Compare with the Mandriva equivalent of the same file: >> > http://svn.mandriva.com/cgi- >> > bin/viewvc.cgi/packages/cooker/git/current/SPECS/git.spec?revision=538411 >> > &view=markup >> >> I already argued that the fact the distribution has a different spec, >> doesn't mean that the upstream spec doesn't comply. > > The fact that it builds doesn't mean it complies either. And in this case, it > doesn't even build (on Mandriva, %{_libexec} is /usr/lib, so the > %{_libexec}/git-core/*svn* glob fails) > > Other things I noticed that aren't per recommendation: > * the Release isn't using %mkrel > * the BuildRequires line lists many packages on the same line -- it should be > one per line > * the %build section uses make directly instead of the %make macro > * changelog in the file, as opposed to the SVN log
Fair enough. >> > I'm sorry, but I don't know .spec files to be really cross-distro. It's >> > something you can base on and adapt to your distro. >> >> Unfortunately it seems to be the case. But ideally no changes should >> be required, and if the changes can be minimized, that's good. > > Like I said, the fact that you can build is great. That means you must use the > lowest common denominator for the macros available. > > That doesn't mean the .spec file will be accepted by distros without > modification. In fact, I doubt any of them take upstream .spec files without > modifying a little. Yeah, it seems so, but at least Fedora and openSUSE are mostly compatible, exept for the .changes file. But according the the openSUSE mailing list, spec files with %changes are ok: http://lists.opensuse.org/opensuse-packaging/2009-10/msg00116.html >> > At the very *least*, package names differ from distro to disto. >> > Therefore, all the Requires and BuildRequires rules are distro-specific. >> >> No. Nowadays distros find the Requires automatically (at least for >> binary packages) based on the link dependencies. Also there's now the >> pkgconfig() capability, so you don't need to mention the specific -dev >> package that provides certain .pc file in the BuildRequires. > > That's assuming that there is a .pc file for the specific package. There are > many development packages without, like for example zlib. If I write in my > .spec file BuildRequires: zlib1-devel (that's the package name on Mandriva), > will it work on other distros? Possibly not, but zlib is an exception. And zlib *does* have a pkgconfig file, Mandriva must not be packaging it. In the general case where the dependencies have pkgconfig files, hard-coding package names is not needed. > How about tools for use in scripts? Let's take one example, which is a tool I > wrote: qdbus. On Mandriva it's on the qt4-qtdbus package. Where is it on other > distros? Yes, for that there's no way but to specify the package name. But that's what '%if 0%{?mdk}' or whatever can be used. > Of course there will be similarities. And of course, with a bit of effort on > your part and on the goodwill of the distros, you'll be able to write cross- > distro .spec files. > > But my experience is that there's enough difference that cross-distro .spec > files aren't a reality. True, which is a shame. But at least in my particular case, my spec files can be cross-distro, if MeeGo allowed the %{dist} tag and %changelog, OBS is perfectly fine with those spec files, so it's only a matter of modifying the policy. But if nobody cares about cross-distro compatibility, even adding a few lines on the guidelines is impossible. -- Felipe Contreras _______________________________________________ MeeGo-dev mailing list [email protected] http://lists.meego.com/listinfo/meego-dev
