From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp486.redcondor.net (smtp486.redcondor.net [208.80.204.86]) by mail.openembedded.org (Postfix) with ESMTP id 1AB5860017 for ; Sat, 29 Oct 2016 09:10:25 +0000 (UTC) Received: from astoria.ccjclearline.com ([64.235.106.9]) by smtp486.redcondor.net ({6695537a-536a-45f9-a249-877c85428649}) via TCP (outbound) with ESMTPS id 20161029091025003_0486 for ; Sat, 29 Oct 2016 09:10:25 +0000 X-RC-FROM: X-RC-RCPT: Received: from [174.118.92.171] (port=57880 helo=crashcourse.ca) by astoria.ccjclearline.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.80) (envelope-from ) id 1c0Ped-0000tz-3u for openembedded-core@lists.openembedded.org; Sat, 29 Oct 2016 05:10:19 -0400 Date: Sat, 29 Oct 2016 05:09:20 -0400 (EDT) From: "Robert P. J. Day" X-X-Sender: rpjday@localhost.localdomain To: OE Core mailing list Message-ID: User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 X-MAG-OUTBOUND: ccj.redcondor.net@64.235.106.9/32 Subject: mapping centos RPM(s) to OE recipe: example involving openssl-perl X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Oct 2016 09:10:26 -0000 Content-Type: text/plain; charset=US-ASCII 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 -- ======================================================================== Robert P. J. Day Ottawa, Ontario, CANADA http://crashcourse.ca Twitter: http://twitter.com/rpjday LinkedIn: http://ca.linkedin.com/in/rpjday ========================================================================