ltib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ltib] Re: Attempting to port netcat 1.84 to PPC


From: Stuart Hughes
Subject: Re: [Ltib] Re: Attempting to port netcat 1.84 to PPC
Date: Fri, 30 May 2008 15:03:01 +0100

Hi John,

Yes there is: ./ltib  -m addsrpms <srpm_path>

Note though that I've updated this to fix a patch ordering bug (starting
0 versus 1) since the last merge out to Savannah.  Unfortunately the
patch isn't contained in only bin/Ltibaddsrpms.pm.  This doesn't matter
too much though as it just adds a little to the spec file tweaking that
you already guessed you'd have to do.

One hunk that is stand-alone and may be useful is:

@@ -131,9 +131,19 @@
         # add an entry into pkg_map
         my $key = 'PKG_' . uc($tok->{name});
         $key =~ s,-,_,g;
+        my $pmap = "$cf->{config_dir}/userspace/pkg_map";
+
+        open(PMAP, $pmap) or die("open $pmap : $!\n");
+        while(<PMAP>) {
+            my ($ckey) = m,^\s*(PKG_\w+)\s* =,;
+            next unless $ckey;
+            warn("$key already exists in pkg_map, not updating\n"),
+                                                    next SRPM if $ckey eq 
$key;+        }
+        close PMAP;

         local $^I = '.bak';
-        @ARGV = "$cf->{config_dir}/userspace/$cf->{pkg_map}";
+        @ARGV = "$cf->{config_dir}/userspace/pkg_map";
         while(<>) {
             s,^(# leave these as the),$key = $tok->{name}\n\n$1,;
             print;



A note of warning though: be a little careful about using too many srpms
from real distributions as in many cases they're overly complicated and
the benefits of the patches and complexity and generally outweighed by
the extra dependencies and extra work they demand of you.


Regards, Stuart


On Fri, 2008-05-30 at 08:04 -0500, John Weber wrote:
> Hi Stuart -
> 
> That's interesting, since I was trying to port nc-1.84-10.fc6.src.rpm.
>  I must have missed something in the spec file.
> 
> BTW - is there an easy way to import (for lack of a better word) an
> srpm into LTIB?  I think you'd still need to do some spec file
> doctoring in any case.
> 
> John
> 
> On Fri, May 30, 2008 at 4:13 AM, Stuart Hughes <address@hidden> wrote:
> > Hi John,
> >
> > I already added this internally (but as netcat).  I didn't want to have
> > the dependency on glibc2.  I ended up using nc110.tgz (the original).  I
> > believe this supports UDP.
> >
> > BTW: LTIB has it's own pkg-config which uses the rootfs prefix so you
> > should never need to add an PKG_CONFIG_PATHs to spec files. I also
> > happened to port nc from nc-1.84-16.fc9.src.rpm.  I didn't need to to
> > anything fancy for pkg-config so long as I select glib2 in the config.
> >
> > I've attached the 2 srpms generated by my ltib.  I will be merging the
> > netcat version later on.
> >
> > Regards, Stuart
> >
> > On Thu, 2008-05-29 at 23:05 -0500, John Weber wrote:
> >> OK - I've actually made it build - here's what I did -
> >>
> >> Found out that pkg-config does exist in the LTIB install under
> >> /opt/freescale/ltib/usr/bin/pkg-config
> >>
> >> I made a directory called /opt/freescale/ltib/usr/bin/pkg-configs and
> >> copied the glib-2.0.pc there.
> >>
> >> Then I set the PKG_CONFIG_PATH to
> >> /opt/freescale/ltib/usr/bin/pkg-configs and exported it (this was
> >> key).
> >>
> >> Ran ./ltib -m scbuild -p nc.spec and it worked fine.  I now have a
> >> compiled nc binary that works on the PPC.
> >>
> >> Why did I do this?  I need a version of netcat that allows UDP...  The
> >> busybox version doesn't support a -u switch.
> >>
> >> John
> >>
> >> On Thu, May 29, 2008 at 9:50 PM, John Weber <address@hidden> wrote:
> >> > Hi there -
> >> >
> >> > OK - I've figured out from looking at the email archives that having
> >> > "Requires" and "BuildRequires" in a package meant to be built by LTIB
> >> > is not a good idea.  So, I've commented these out and the prep step
> >> > works fine.  I now have patched source for nc.
> >> >
> >> > However, the next issue is that nc really does depend on glib2.  I've
> >> > prepped the source for glib2 into rpm/BUILD/glib-2.14.3.
> >> >
> >> > So, what I get from ./ltib -m scbuild -p nc.spec is the following:
> >> >
> >> > rpmbuild --dbpath /mnt/FREESCALE/LTIB/ltib-mpc837xerdb-20080409/rpmdb
> >> > --target ppc --define '_unpackaged_files_terminate_build 0' --define
> >> > '_target_cpu ppc' --define '__strip strip' --define '_topdir
> >> > /mnt/FREESCALE/LTIB/ltib-mpc837xerdb-20080409/rpm' --define '_prefix
> >> > /usr' --define '_tmppath
> >> > /mnt/FREESCALE/LTIB/ltib-mpc837xerdb-20080409/tmp' --define '_mandir
> >> > /usr/share/man' --define '_sysconfdir /etc' --define '_localstatedir
> >> > /var' -bc --short-circuit
> >> > /mnt/FREESCALE/LTIB/ltib-mpc837xerdb-20080409/dist/lfs-5.1/nc/nc.spec
> >> > Building target platforms: ppc
> >> > Building for target ppc
> >> > Executing(%build): /bin/sh -e
> >> > /mnt/FREESCALE/LTIB/ltib-mpc837xerdb-20080409/tmp/rpm-tmp.88506
> >> > + umask 022
> >> > + cd /mnt/FREESCALE/LTIB/ltib-mpc837xerdb-20080409/rpm/BUILD
> >> > + cd nc
> >> > ++ pkg-config --cflags --libs glib-2.0
> >> > Package glib-2.0 was not found in the pkg-config search path.
> >> > Perhaps you should add the directory containing `glib-2.0.pc'
> >> > to the PKG_CONFIG_PATH environment variable
> >> > No package 'glib-2.0' found
> >> > ...
> >> >
> >> > I've confirmed that a glib-2.0.pc exists in the directory 
> >> > rpm/BUILD/glib-2.14.3/
> >> >
> >> > I've tried creating an environment variable called PKG_CONFIG_PATH
> >> > with the path to this file and the LTIB builder doesn't seem to see
> >> > it.
> >> >
> >> > How can I make pkg-config (verified installed on my Centos5 based
> >> > machine) work with LTIB?  Saw some threads on a pkg-config patch on
> >> > this list, but all referenced a file in
> >> > /opt/freescale/usr/bin/pkg-config.  This doesn't get installed with
> >> > the default ISO download of the MPC837x BSP from Freescale.  The only
> >> > directory in that is /opt/freescale/usr/local - that's it.
> >> >
> >> > I've verified that the version of LTIB, as reported in the ./ltib
> >> > --version is 7.4.1.
> >> >
> >> > Thanks,
> >> > John
> >> >
> >> > On Thu, May 29, 2008 at 5:01 PM, John Weber <address@hidden> wrote:
> >> >> Has anyone attempted to port nc (netcat) to PPC?  Not the GNU netcat,
> >> >> but the OpenBSD netcat.
> >> >>
> >> >> Downloaded the SRPM and installed it with rpm -i in order to get at
> >> >> the spec and source files.
> >> >>
> >> >> The issue is that the spec file has a dependency on a couple of things
> >> >> - pkg-config and glibc-2.0.
> >> >>
> >> >> Here is a snippet of the spec file:
> >> >>
> >> >> Version: 1.84
> >> >> Release: 10%{?dist}
> >> >> URL:     http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/
> >> >> Source0: nc-%{version}.tar.bz2
> >> >> Patch0: nc-1.84-glib.patch
> >> >> Patch1: nc-1.78-pollhup.patch
> >> >> Patch2: nc-1.82-reuseaddr.patch
> >> >> Patch3: nc-gcc_signess.patch
> >> >> Patch4: nc-1.84-connect_with_timeout.patch
> >> >> Patch5: nc-1.84-udp_stop.patch
> >> >> Patch6: nc-1.84-udp_port_scan.patch
> >> >> Patch7: nc-1.84-crlf.patch
> >> >> Patch8: nc-1.84-verb.patch
> >> >> License: GPL
> >> >> Group: Applications/Internet
> >> >> BuildRoot: %{_tmppath}/%{name}-root
> >> >> BuildRequires: pkgconfig, glib2-devel
> >> >> Requires: glib2
> >> >>
> >> >> I know that I can add the glib2 package, so run time support shouldn't
> >> >> be a problem.  How do I get around the other dependencies, though?
> >> >>
> >> >> John
> >> >>
> >> >
> >>
> >>
> >> _______________________________________________
> >> LTIB home page: http://bitshrine.org
> >>
> >> Ltib mailing list
> >> address@hidden
> >> http://lists.nongnu.org/mailman/listinfo/ltib
> >





reply via email to

[Prev in Thread] Current Thread [Next in Thread]