Re: help using openpkg [newbie question]

2004-07-28 Thread Simon Mudd
Aaron Bostick [EMAIL PROTECTED] writes:

 This works in 2.0.  2.1 may be a little different.  You have to install
 these in this order on all machines to get the 'build' tool working:
 
 openpkg
 make
 binutils
 gcc
 perl
 openpkg-tools

[snip]

 
 If you have a lot of servers, you may want to have just one server
 compile them, then put the binary packages on an NFS share for the
 others to install from.  This helps solve a chicken and egg problem of
 compiling the compiling before your sandbox is ready.  For solaris, I
 had to grab the sunfreeware.com's binary gcc to get my build host
 bootstrapped.  If you installed the development stuff with Solaris, you
 may not have to do this.
 
 Once that is done, you can then run commands like:
 
 /opkg/bin/openpkg build ntp | /bin/sh -

It looks like this should work fine with a remote ftp archive just
with openpkg and openpkg-tools installed. However I had an issue with
the ftp connection to ftp.openpkg.org giving errors. I don't notice
this with other ftp sites so am unsure what the problem is (if any)
but had the same issue at the office too (to ftp://ftp.opengpkg.org).

Using an http mirror (specifically
http://ftp.ale.org/pub/mirrors/openpkg) resolved the problem so it
appears to be an ftp issue (not sure if my end or openpkg.org's).

 This will automagically find, build, and install ntp and its package
 dependencies in the proper order.  Its somewhere in between a Mandrake
 urpmi and gentoo's emerge IMO.

Yes, similar too to FreeBSD's ports system (but perhaps better
dependency checking?).

 Again, if you have a lot of servers, you will want to rsync nightly
 against the openpkg servers and then run your build commands against a
 local mirror.  It is much faster this way and saves bandwidth for CW.

Yes, I imagine their servers are heavily loaded.  Using other mirrors is
probably a good idea too.

 The mirror command I use in cron is:
 
 0 0 * * * /opkg/bin/rsync -azv --exclude BIN/ --exclude ISO/
 rsync://rsync.openpkg.org/openpkg-ftp/release/2.0/ /mirror/release/2.0/
 
 If you have custom packages and need to rebuild your index then you can
 cron this as well:
 
 0 4 * * * /opkg/bin/openpkg index -c -r OpenPKG-2.0/Source/ -o
 /mirror/release/2.0/SRC/00INDEX.rdf.bz2 -i /mirror/release/2.0/SRC/
 
 After you have your mirror setup, the build command above changes to:
 
 /opkg/bin/openpkg build -f ftp://your server
 name/release/2.0/00INDEX.rdf ntp | /bin/sh -
 
 You obviously also need to setup anonymous ftp on the mirror server.

Thanks for the pointers, though while I'm trying things out setting up
a mirror seems like overkill.

However I'd like to use this in the office where we have various
flavours of Linux, Solaris and AIX (does openpkg build on AIX or
should I just try?) and this is where I can see the advantage of
depending less on the underlying OS (which for certain applications
may not be changeable) and more on the packaging system
where you can guarantee common behaviour.

 I know it took me some time to figure these steps out so hopefully this
 will help you.

There's quite a bit of documentation about the first-time build
process which is good, but less about the using it afterwards which
is what I'm looking at now.  Certainly the /openpkg/bin/openpkg build
package facility is very nice after installing just 2 packages.

Thanks for the pointers I'll probably be using them soon if I can
convince my colleagues to take a look at this fine packaging system.

Simon
__
The OpenPKG Projectwww.openpkg.org
User Communication List  [EMAIL PROTECTED]


Re: help using openpkg [newbie question]

2004-07-26 Thread Michael van Elst

Hi everyone,

On Mon, Jul 26, 2004 at 02:20:57PM -0500, Aaron Bostick wrote:
 This works in 2.0.  2.1 may be a little different.  You have to install
 these in this order on all machines to get the 'build' tool working:
 
 openpkg
 make
 binutils
 gcc
 perl
 openpkg-tools

yes and no. The build tool uses perl, but it is not necessary to
build perl manually for using the tool. It will try to use any
perl it finds.

With a native perl from the OS (on all Linux machines, even on
Solaris nowadays) I run the bootstrap, then as the 'opkg' user
I run something like:

openpkg rpm -i ftp://ftp.openpkg.org/release/2.1/SRC/openpkg-tool\*
openpkg rpmbuild RPM/SRC/openpkg-tools/openpkg-tools.spec
openpkg rpm -U RPM/PKG/openpkg-tools*
openpkg build -Ua | sh

to install openpkg-tools and pull in any updates. The nice thing
about this procedure is that I don't have to care about what
version is available and can put those commands in a small script.

The basic rpm commands like -i can use wildcards. The --rebuild
command (which combines -i of the source rpm and the rpmbuild
run) can't.

Finally I make a ~opkg/.openpkg/build containing something like:

-P /usr/pkg/bin/sudo

with a reasonable configured sudo on the system :-) or else:

-P -su root -c

so that I can run builds as the opkg user.

 If you have custom packages and need to rebuild your index then you can
 cron this as well:
 
 0 4 * * * /opkg/bin/openpkg index -c -r OpenPKG-2.0/Source/ -o
 /mirror/release/2.0/SRC/00INDEX.rdf.bz2 -i /mirror/release/2.0/SRC/

With many source packages (such as a full release repository) you really
do want to use caching using -C (and you need to have the perl DB_File
module installed).


 After you have your mirror setup, the build command above changes to:
 
 /opkg/bin/openpkg build -f ftp://your server
 name/release/2.0/00INDEX.rdf ntp | /bin/sh -

If you regularly build from a mirror you may want to put the -f
option (and/or -r option) into $HOME/.openpkg/build



Greetings,
-- 
Michael van Elst
Internet: [EMAIL PROTECTED]
A potential Snark may lurk in every tree.
__
The OpenPKG Projectwww.openpkg.org
User Communication List  [EMAIL PROTECTED]


Re: help using openpkg [newbie question]

2004-07-22 Thread Thomas Lotterer
On Wed, Jul 21, 2004, Simon J Mudd wrote:

Re Simon,

 I'm using Whitebox Linux (a RedHat Enterprise 3 clone) [...]
 
If you know better than rpm that a binary package can be used on a
particular system or you just want to give it a try then convince rpm
using the --ignoreos or --ignorearch options. The situation you are
describing sounds promising when ix86-rhel3 binaries are used.

 2. After building and executing  [...]
 However this whole process is manual [...]
 I've since seen that there is openpkg-index and openpkg-build [...] 
 
First install the openpkg-tools package. It requires make, gcc and perl.
Having only the bootstrap available the whole thing can be setup using

$ openpkg install openpkg-tools

With the tools being installed use something like

$ openpkg build apache | sh

The build tool reads the indices from the OpenPKG ftp server based on
the bootstrap you're using, takes package options as arguments, computes
the dependency chain and writes the commands you would have to enter
manually to stdout. The example above directly pipes these commands into
the shell. Try these and learn:

$ openpkg build apache
$ openpkg build -D with_mod_ssl=yes apache
$ openpkg man build

 I'd like to keep OpenPKG uptodate. [...]
 
Frequently run

$ openpkg build -Ua | sh

Be aware that updates for release are created very carefully and in
almost all cases they can be applied and everything will continue to
work. In contrast, if you run CURRENT then every update can completely
change world order ... You find two paragraphs describing this at the
top of the Release Notes below General Notes about Upgrading.

[1] http://cvs.openpkg.org/openpkg-re/releasenotes.txt

--
[EMAIL PROTECTED], Cable  Wireless
__
The OpenPKG Projectwww.openpkg.org
User Communication List  [EMAIL PROTECTED]


Re: help using openpkg [newbie question]

2004-07-22 Thread Simon Mudd
Hi Thomas,

Thomas Lotterer [EMAIL PROTECTED] writes:

 On Wed, Jul 21, 2004, Simon J Mudd wrote:
 
  I'm using Whitebox Linux (a RedHat Enterprise 3 clone) [...]
  
 If you know better than rpm that a binary package can be used on a
 particular system or you just want to give it a try then convince rpm
 using the --ignoreos or --ignorearch options. The situation you are
 describing sounds promising when ix86-rhel3 binaries are used.

OK. I was not aware that this was possible. Certainly the rpm --force
command was completely ignored.

I also tried to adjust the shtool included in the original bootstrap
tar image to recognise whitebox linux as rhel3.

--- shtool.orig 2004-07-22 20:37:04.0 +0200
+++ shtool  2004-07-22 15:55:01.0 +0200
@@ -2713,6 +2713,9 @@
 slackware   ) n=Slackware[ Linux] ;;
 turbolinux  ) n=TurboLinux;;
 unitedlinux ) n=UnitedLinux   ;;
+
+whitebox) n=Red Hat Enterprise Linux ;;
+
 *   ) n=${n}[ GNU/Linux]  ;;
 esac
 case $n in

producing the following 2 files:

-rw-r--r--1 root root  6051007 Jul 22 16:02 
openpkg-2.1.0-2.1.0.ix86-rhel3.0-ope.rpm
-rw-r--r--1 root root  6301696 Jul 22 16:02 
openpkg-2.1.0-2.1.0.ix86-rhel3.0-ope.sh

This installed correctly but downloading the binary rhel3 packages
gave me an error inspite of the change (I guess I need to change other
things (in rpm?) too.

[EMAIL PROTECTED] PKG]# /openpkg/bin/openpkg rpm -Uvh
ncftp-3.1.8-2.1.0.ix86-rhel3-openpkg.rpm
Preparing...
### [100%]
package ncftp-3.1.8-2.1.0 is intended for a rhel3 operating system
[EMAIL PROTECTED] PKG]# echo $?
1

  2. After building and executing  [...]
  However this whole process is manual [...]
  I've since seen that there is openpkg-index and openpkg-build [...] 
  
 First install the openpkg-tools package. It requires make, gcc and perl.
 Having only the bootstrap available the whole thing can be setup using
 
 $ openpkg install openpkg-tools
 
 With the tools being installed use something like
 
 $ openpkg build apache | sh
 
 The build tool reads the indices from the OpenPKG ftp server based on
 the bootstrap you're using, takes package options as arguments, computes
 the dependency chain and writes the commands you would have to enter
 manually to stdout. The example above directly pipes these commands into
 the shell. Try these and learn:
 
 $ openpkg build apache
 $ openpkg build -D with_mod_ssl=yes apache
 $ openpkg man build

I either missed this on the web page or it's not clearly enough
explained. This is great (I've just tried it), and very similar to
FreeBSD's ports system.

  I'd like to keep OpenPKG uptodate. [...]
  
 Frequently run
 
 $ openpkg build -Ua | sh

OK. This is what I was missing. I must have missed it from the web
site. I need to look again to see why I did that.

 Be aware that updates for release are created very carefully and in
 almost all cases they can be applied and everything will continue to
 work. In contrast, if you run CURRENT then every update can completely
 change world order ... You find two paragraphs describing this at the
 top of the Release Notes below General Notes about Upgrading.

OK. That is logical, and similar to other OS' current versus
release/stable packages.

Thank you for the pointers. I feel a bit dumb for not having seen them
before.

Simon
__
The OpenPKG Projectwww.openpkg.org
User Communication List  [EMAIL PROTECTED]


Re: help using openpkg [newbie question]

2004-07-22 Thread Thomas Lotterer
On Thu, Jul 22, 2004, Simon Mudd wrote:

Re,

   I'm using Whitebox Linux (a RedHat Enterprise 3 clone) [...]
 I also tried to adjust the shtool [...] producing the following 2 files:
 
 openpkg-2.1.0-2.1.0.ix86-rhel3.0-ope.rpm
 openpkg-2.1.0-2.1.0.ix86-rhel3.0-ope.sh
 
 This installed [...] but binary rhel3 packages gave me an error [...]
 
please examine the content of the platform file (it has no newline).
Our reference machine reads:

$ echo `cat /openpkg/etc/openpkg/platform`
ix86-any-rhel3

PS: why do you fight so hard with binaries when sources work well?

--
[EMAIL PROTECTED], Cable  Wireless
__
The OpenPKG Projectwww.openpkg.org
User Communication List  [EMAIL PROTECTED]


Re: help using openpkg [newbie question]

2004-07-22 Thread Simon Mudd
Thomas Lotterer [EMAIL PROTECTED] writes:

 On Thu, Jul 22, 2004, Simon Mudd wrote:
 
 Re,
 
I'm using Whitebox Linux (a RedHat Enterprise 3 clone) [...]
  I also tried to adjust the shtool [...] producing the following 2 files:
  
  openpkg-2.1.0-2.1.0.ix86-rhel3.0-ope.rpm
  openpkg-2.1.0-2.1.0.ix86-rhel3.0-ope.sh
  
  This installed [...] but binary rhel3 packages gave me an error [...]
  
 please examine the content of the platform file (it has no newline).
 Our reference machine reads:
 
 $ echo `cat /openpkg/etc/openpkg/platform`
 ix86-any-rhel3

ok. I had not noticed this difference (was not sure what to look for
to be honest).

 PS: why do you fight so hard with binaries when sources work well?

I had not found the how to download and install a package (with
dependencies) in the OpenPKG documentation.  Maybe I missed it. There
are examples of doing the steps by hand, using /openpkg/bin/openpkg
rpm --rebuild,  /openpkg/bin/openpkg rpm -Uvh  but I did not
find the reference (or documenation) to the /openpkg/bin/openpkg build
command and how to use it. rpm -ql openpkg-tools does not provide much
information unless I read the perl source.

I had thought it would simply be easier to download the binary
packages (that's how yum/apt-get work), but it's true the openpkg
build | sh idea works very similarly to FreeBSD's ports tree and is
very clean.

I only struggle with something if I don't understand how to do
something and that was the problem I was facing.  It seems that the
binary environment is not really needed: the src.rpms are fine.

I also think that when deploying to multiple machines it would be a
waste of resources to build multiple times and in that case it would
be nice to be able to download and install binary rpms automatically,
even if these binary rpms are built on one source machine.  I'll have
to look at the openpkg build parameters to see if this is possible
too.

Thanks again for your help and time in answering my questions.

Regards,

Simon
__
The OpenPKG Projectwww.openpkg.org
User Communication List  [EMAIL PROTECTED]


Re: help using openpkg [newbie question]

2004-07-22 Thread Simon Mudd
Thomas Lotterer [EMAIL PROTECTED] writes:

 On Thu, Jul 22, 2004, Simon Mudd wrote:
 
 Re Simon,
 
  openpkg-tools [...] not provide much
  information unless I read the perl source.
  
 you don't have to. Try
 
 $ openpkg man build

Yes, I see (now).  I was just surprised to not see the man pages in
the rpm -ql openpkg-tools output. I guess I'm too used to a standard
rpm distribution.

  I also think that when deploying to multiple machines [...]
  
 It is possible to use one machine as a build host and deploy the
 binaries to others. This can be automated in a private environment the
 same way you use openpkg build to fetch from the official OpenPKG
 site. The key is the creation of private index files which requires
 purchase of the OpenPKG enterprise edition [1] - just kidding :-)
 The solution is already on your harddrive. Try
 
 $ openpkg man index
 
 [1] http://www.openpkg.com/

Thanks for taking the time to give me these pointers: I now think I
have a better grasp of the big picture.

Regards,

Simon
__
The OpenPKG Projectwww.openpkg.org
User Communication List  [EMAIL PROTECTED]