Skip to contentSkip to conversation

mapping centos RPM(s) to OE recipe: example involving openssl-perl

DISCUSSION Robert P. J. Day 1 participant 1 message Oct 29, 2016

lore
Share & tools
lore
#0 lore raw

finally figured out enough to ask intelligent(?) questions about how
to map CentOS RPMs to equivalent OE recipes and config settings, so here goes -- feel free to tell me where i've screwed up, and i'll be putting all this on a public wiki page when i'm done.

scenario: existing x86 system based on CentOS 7 and lots of custom
RPMs to be ported to PPC using OE (actually, wind river linux, but i'm starting with OE/YP for simplicity), have a massive list of RPMs installed on current x86 system, so methodically going through list and figuring out the OE equivalent. sometimes, it's obvious; sometimes not. and while i'm doing this, trying to write a guide for how others with little to no OE familiarity can do this.

(side note: starting with "core-image-minimal" image so that already
sucks up a fair number of required packages.)

first note i'm going to make -- while centos system requires
installation of individual and sometimes closely-related RPMs, a single OE recipe has the ability to generate multiple RPMs. so if centos system has pile of installed RPMs:

* X
* X-a
* X-b
* X-c etc ...

it is entirely possible that those centos RPMs map to a single OE recipe for "X" (with possibly PACKAGECONFIG settings added to generate those subpackages). simple example -- OE recipe for dhcp:

PACKAGES += "dhcp-server dhcp-server-config dhcp-client dhcp-relay dhcp-omshell"

  FILES_${PN} = ""
  RDEPENDS_${PN}-dev = ""
  RDEPENDS_${PN}-staticdev = ""

  FILES_${PN}-server = "${sbindir}/dhcpd   ${sysconfdir}/init.d/dhcp-server"
  RRECOMMENDS_${PN}-server = "dhcp-server-config"

  FILES_${PN}-server-config = "${sysconfdir}/default/dhcp-server ${sysconfdir}/dhcp/dhcpd.conf"

  FILES_${PN}-relay = "${sbindir}/dhcrelay ${sysconfdir}/init.d/dhcp-relay ${sysconfdir}/default/dhcp-relay"

  FILES_${PN}-client = "${base_sbindir}/dhclient ${base_sbindir}/dhclient-script ${sysconfdir}/dhcp/dhclient.conf"

  FILES_${PN}-omshell = "${bindir}/omshell"

so in cases like that, it should be easy to see how a set of dhcp RPMs would map to the single OE recipe, that part seems easy.

i was particularly interested in RPMs that represent language APIs
for a package; lots of RPMs with names like "X-perl" and "Y-python", which would normally be installed explicitly on centos, but which in many cases are generated by the OE recipe for "X" or "Y", depending on the configuration. or so i thought, until i started picking on examples.

case in point -- centos system needs "openssl-perl" RPM, so i
queried that package on my fedora system to check its contents:

  $ rpm -ql openssl-perl
  /etc/pki/tls/misc/CA.pl
  /etc/pki/tls/misc/tsget
  /usr/bin/c_rehash
  /usr/share/man/man1/CA.pl.1ssl.gz
  /usr/share/man/man1/c_rehash.1ssl.gz
  /usr/share/man/man1/tsget.1ssl.gz
  $

ignoring docs files, apparently, that package installs three perl scripts "for converting certificates and keys from other formats to the formats used by the OpenSSL toolkit."

fair enough, so i just assumed there was an openssl recipe setting
that would generate a separate "openssl-perl" rpm file if one was requested. instead, i found this in the "openssl.inc" file:

  PACKAGECONFIG[perl] = ",,,"
  ...
  PACKAGES =+ "libcrypto libssl ${PN}-misc openssl-conf"
  ...
  FILES_${PN}-misc = "${libdir}/ssl/misc"

and further down ...

  do_install () {
        ... snip ...

        if [ "${@bb.utils.contains('PACKAGECONFIG', 'perl', 'perl', '', d)}" = "perl" ]; then
                sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/CA.pl
                sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/tsget
        else
                rm -f ${D}${libdir}/ssl/misc/CA.pl ${D}${libdir}/ssl/misc/tsget
        fi

so, rather than generating a separate "openssl-perl" package, as i read this, the openssl recipe, by default, installs those two scripts "CA.pl" and "tsget", then unless you explicitly add "perl" to PACKAGECONFIG, it removes them during installation.

it has the same effect, i guess, but it seems a bit weird. is there
a rationale for doing this? i might have a couple more questions about this particular recipe after i read further.

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================