0

I am using Bash to install a customised version of JBoss, and one of the things I would like to do is install the correct version of the Apache Portable Runtime, which is a native binary.

This script could be run on both 32 and 64 bit versions of RHEL.

What are my options for identifying which version of the APR to install?

I think we only have 32bit and x64-based systems here. I would still like to identify i64 systems so that the script can refuse to install on that type of machine.

I am aware of using uname -m and grepping /proc/cpuinfo to find out, but was wondering which approach others would recommend?

Rich
  • 1,333
  • 5
  • 27
  • 39

1 Answers1

0

If you're installing on RHEL systems, you should just use the native package management facilities -- such as yum -- to install APR. This will take care of architecture selection for you, and will make sure that any other dependencies are pulled in.

larsks
  • 41,276
  • 13
  • 117
  • 170
  • Thanks, but I'm not sure that'll work on our heavily-customised JBoss installation. The JBoss we're installing isn't being managed by yum, so I don't know if a yum-installed APR would work? The usual place to put APR is inside a folder on JBoss, though I suppose it could be configured to look elsewhere... – Rich Jan 06 '11 at 12:49
  • It should work, but if you've already got a process that you're using it's probably easiest to stick with it. If you really want/need to do it yourself, using `uname -m` as your determining factor is probably fine...you could also explicitly check to see if the 64 bit C library is installed (`rpm -q glibc.x86_64`). – larsks Jan 06 '11 at 14:24
  • Thanks for the update - in the end I went for the `arch` command as that's what a UNIX guy here recommended. I think `arch` does the same as `uname -m`, so I'm going to accept your answer :) – Rich Jan 07 '11 at 09:55