Hello,
I am creating a tool to automate RPM build process (at least reduce maintenance process).
I have found a wonderful (for my tests) RPM spec => http://pkgs.fedoraproject.org/cgit/rpms/git.git/tree/git.spec
According to section 10.1 in http://rpm5.org/docs/rpm-guide.pdf commas are not allowed in BuildRequires, but I have found
****************************************** BuildRequires: perl(Error), perl(ExtUtils::MakeMaker)
******************************************
How can I help for this ?
Regards,
On 07/12/17 09:29, Marwan Rabbâa wrote:
I am creating a tool to automate RPM build process (at least reduce maintenance process).
I have found a wonderful (for my tests) RPM spec => http://pkgs.fedoraproject.org/cgit/rpms/git.git/tree/git.spec
According to section 10.1 in http://rpm5.org/docs/rpm-guide.pdf commas are not allowed in BuildRequires, but I have found
Note that rpm5.org describes a fork of rpm and not the version used in Fedora.
They're certainly not necessary - a space works fine to separate multiple dependencies on the same line. A quick test suggests that they seem to be allowed, in the sense of basically being ignored and not affecting what dependencies are created in the src.rpm.
Tom
Do you have actually spec that specified BuildRequires with separated spaces ?
2017-12-07 10:42 GMT+01:00 Tom Hughes tom@compton.nu:
On 07/12/17 09:29, Marwan Rabbâa wrote:
I am creating a tool to automate RPM build process (at least reduce
maintenance process).
I have found a wonderful (for my tests) RPM spec => http://pkgs.fedoraproject.org/cgit/rpms/git.git/tree/git.spec
According to section 10.1 in http://rpm5.org/docs/rpm-guide.pdf commas are not allowed in BuildRequires, but I have found
Note that rpm5.org describes a fork of rpm and not the version used in Fedora.
They're certainly not necessary - a space works fine to separate multiple dependencies on the same line. A quick test suggests that they seem to be allowed, in the sense of basically being ignored and not affecting what dependencies are created in the src.rpm.
Tom
-- Tom Hughes (tom@compton.nu) http://compton.nu/
On 07/12/17 14:06, Marwan Rabbâa wrote:
Do you have actually spec that specified BuildRequires with separated spaces ?
Sure, lots, for example:
https://src.fedoraproject.org/rpms/libosmium/blob/master/f/libosmium.spec#_1...
Tom
Interesting.
Un fact I'm trying tout parse this lines.
An since spaces could be used for version separation and package separation it seems off tout parse
Le 7 déc. 2017 15:17, "Tom Hughes" tom@compton.nu a écrit :
On 07/12/17 14:06, Marwan Rabbâa wrote:
Do you have actually spec that specified BuildRequires with separated
spaces ?
Sure, lots, for example:
https://src.fedoraproject.org/rpms/libosmium/blob/master/f/l ibosmium.spec#_18
Tom
-- Tom Hughes (tom@compton.nu) http://compton.nu/
On 07/12/17 14:21, Marwan Rabbâa wrote:
Interesting.Â
Un fact I'm trying tout parse this lines.
An since spaces could be used for version separation and package separation it seems off tout parse
Not really, you just need a proper parser ;-)
Assuming that you have a lexer that splits tokens on whitespace and can identify tokens as NAME, OPERATOR or VERSION then a basic yacc/bison grammar for the value of a BuildRequire would look something like:
build-requires : build-requires build-require | build-require ;
build-require : NAME | NAME OP VERSION ;
Obviously that ignores the newer stuff around and/or and parentheses etc but I'm sure that's a SMOP ;-)
Tom
Build requies could be multilines ?
Le 7 déc. 2017 15:26, "Tom Hughes" tom@compton.nu a écrit :
On 07/12/17 14:21, Marwan Rabbâa wrote:
Interesting.Â
Un fact I'm trying tout parse this lines.
An since spaces could be used for version separation and package separation it seems off tout parse
Not really, you just need a proper parser ;-)
Assuming that you have a lexer that splits tokens on whitespace and can identify tokens as NAME, OPERATOR or VERSION then a basic yacc/bison grammar for the value of a BuildRequire would look something like:
build-requires : build-requires build-require | build-require ;
build-require : NAME | NAME OP VERSION ;
Obviously that ignores the newer stuff around and/or and parentheses etc but I'm sure that's a SMOP ;-)
Tom
-- Tom Hughes (tom@compton.nu) http://compton.nu/
On Thu, 7 Dec 2017, Marwan Rabbâa wrote:
Build requies could be multilines ?
One may use multiple BuildRequires: lines, and avoid the comma vs whitespace issue, altogether
randomly grabbed:
$ grep -i ^Build *spec ... nagios-plugins-bonding.spec:BuildRequires: libxslt nagios-plugins-bonding.spec:BuildRequires: libxml2 nagios-plugins-bonding.spec:BuildRequires: docbook-style-xsl ...
-- Russ herrold
On 12/07/2017 09:26 AM, Tom Hughes wrote:
On 07/12/17 14:21, Marwan Rabbâa wrote:
Interesting.Â
Un fact I'm trying tout parse this lines.
An since spaces could be used for version separation and package separation it seems off tout parse
Not really, you just need a proper parser ;-)
No, actually RPM spec files need a proper grammar.
Let's be honest, RPM spec file syntax is nothing other than a big bag of of inconsistent hacks :-( After having been down this road a few times I've come to the conclusion the only parser that works is the one embedded into RPM and only the RPM parser knows what the syntax is. Ever wonder why the grammar is not published? I suspect because it's impossible to define it because of all the inconsistencies. (Sorry, this is one of my pet peeves).
On Thu, Dec 07, 2017 at 10:29:28AM +0100, Marwan Rabbâa wrote:
According to section 10.1 in http://rpm5.org/docs/rpm-guide.pdf commas are not allowed in BuildRequires,
This is about RPM 5.
but I have found
BuildRequires: perl(Error), perl(ExtUtils::MakeMaker)
Fedora uses RPM 4.
How can I help for this ?
Only the "rpm" package maintainer in Fedora knows if this is indended feature or a backward-compatibility feature. But provided the commans are widely used in Fedora, I believe your tool should deal with them.
I don't know what exactly you are trying to do, but I have a SPEC parser https://pagure.io/RPM-SpecEditor/ that cannot do much, but these dependencies are parsed correctly.
-- Petr
Then wich distro use RPM 5 ?
2017-12-07 10:51 GMT+01:00 Petr Pisar ppisar@redhat.com:
On Thu, Dec 07, 2017 at 10:29:28AM +0100, Marwan Rabbâa wrote:
According to section 10.1 in http://rpm5.org/docs/rpm-guide.pdf commas
are
not allowed in BuildRequires,
This is about RPM 5.
but I have found
BuildRequires: perl(Error), perl(ExtUtils::MakeMaker)
Fedora uses RPM 4.
How can I help for this ?
Only the "rpm" package maintainer in Fedora knows if this is indended feature or a backward-compatibility feature. But provided the commans are widely used in Fedora, I believe your tool should deal with them.
I don't know what exactly you are trying to do, but I have a SPEC parser https://pagure.io/RPM-SpecEditor/ that cannot do much, but these dependencies are parsed correctly.
-- Petr
packaging mailing list -- packaging@lists.fedoraproject.org To unsubscribe send an email to packaging-leave@lists.fedoraproject.org
* Marwan Rabbâa [07/12/2017 10:54] :
Then wich distro use RPM 5 ?
From wikipedia's page on rpm:
"This version is used by distributions such as Wind River Linux (until Wind River Linux 10), Rosa Linux, and OpenMandriva Lx (former Mandriva Linux which switched to rpm5 in 2011) and also by the OpenPKG project which provides packages for other common UNIX-platforms. OpenMandriva Lx considered switching back to rpm.org before folding. OpenEmbedded switched back to rpm.org due to issues in RPM5."
Emmanuel
On Thu, Dec 07, 2017 at 10:54:59AM +0100, Marwan Rabbâa wrote:
Then wich distro use RPM 5 ?
https://en.wikipedia.org/wiki/Rpm_(software)#RPM_v5.
-- Petr
packaging@lists.fedoraproject.org