Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

How does one install gwhois on a Mac? I'm already up and running with Homebrew; I assume that there's some magic perl configuration required before it will run.

I've tried the following:

brew install libidn
sudo cpan Net::LibIDN
sudo cpan LWP::Simple
sudo cp pattern /etc/gwhois/
sudo cp gwhois /usr/bin/
sudo cp gwhois.1 /usr/share/man/man1/

And when I run gwhois I get

Can't locate Net/LibIDN.pm in @INC (@INC contains: /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.4 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 ...) at /usr/bin/gwhois line 81.
    BEGIN failed--compilation aborted at /usr/bin/gwhois line 81.

I can't get LibIDN to install correctly; the output from brew install libidn is:


going to read '/Users/user/.cpan/Metadata'
  Database was generated on Sun, 27 Jan 2013 16:53:02 GMT
Running install for module 'Net::LibIDN'
Running make for T/TH/THOR/Net-LibIDN-0.12.tar.gz
Checksum for /Users/user/.cpan/sources/authors/id/T/TH/THOR/Net-LibIDN-0.12.tar.gz ok

  CPAN.pm: Going to build T/TH/THOR/Net-LibIDN-0.12.tar.gz

ld: warning: ignoring file /usr/local/lib/libidn.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /usr/local/lib/libidn.dylib
Undefined symbols for architecture i386:
  "_idna_to_ascii_8z", referenced from:
      _main in __test1-uIxi6i.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: warning: ignoring file /usr/local/lib/libidn.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /usr/local/lib/libidn.dylib
Undefined symbols for architecture i386:
  "_idna_to_ascii_8z", referenced from:
      _main in cceb1x8C.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccGGlAwg.out (No such file or directory)
This module requires GNU Libidn, which could not be found.
No 'Makefile' created'YAML' not installed, will not store persistent state
  THOR/Net-LibIDN-0.12.tar.gz
  /usr/bin/perl Makefile.PL -- NOT OK
Running make test
  Make had some problems, won't test
Running make install
  Make had some problems, won't install
share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

See decription above. We need Xcode (I use 4.5.1 including the CLI tools which you can download in the preferences tab of Xcode) and Lion (I use 10.7.5 but should work also fine in 10.8).

Lynx :

cd $HOME
mkdir Source
cd Source
curl -L ftp://gd.tuwien.ac.at/infosys/browsers/lynx//lynx2.8.7/lynx2.8.7.tar.gz -o lynx2.8.7.tar.gz
tar -xzvf lynx2.8.7.tar.gz
cd lynx2-8-7
./configure && make && sudo make install

LibIDN :

cd ..
curl -L http://ftp.gnu.org/gnu/libidn/libidn-1.26.tar.gz -o libidn-1.26.tar.gz
tar -xzvf libidn-1.26.tar.gz
cd libidn-1.26
export CFLAGS="-arch x86_64 -arch i386"
./configure CC="clang" && make && sudo make install

Check the LibIDN build :

cd /usr/local/lib
lipo -info libidn.11.dylib

That should tell : Architectures in the fat file: libidn.11.dylib are: x86_64 i386

Perl modules :

sudo cpan LWP::Simple
sudo cpan Net::LibIDN

If cpan reports some errors, re-run the command, it needs a stable connection.

Gwhois :

cd $HOME/Source
curl -L http://gwhois.de/gwhois/gwhois_20120626.tar.gz -o gwhois_20120626.tar.gz
tar -xzvf gwhois_20120626.tar.gz
cd gwhois-20120626
sudo mkdir /etc/gwhois/
sudo cp ./pattern /etc/gwhois/
sudo cp ./gwhois /usr/bin/
sudo cp ./gwhois.1 /usr/share/man/man1/

Have fun and run in terminal for example :

gwhois orf.at

... or, whatever you like.

share|improve this answer
    
Ugh; brew was only installing the x86_64 symbols for libidn; perl wanted i386 as well. So I uninstalled libidn with brew, built it from source, installed Net::LibIDN, and everything started working. THANK YOU! –  loseeka Jan 28 '13 at 15:41
    
;-) brew does nothing else then to look which dependencies are need and build all what is needed. But at the end, the configure script uses the settings of your machine thats why only x86_64 builds are there. Don´t know which Lynx you use but mine don´t supports SSL (thats a little problem). Run ./configure --help=short (in the directory of the Lynx source) to see all build options. You can check that in terminal using lynx https://asslsite. –  NaWi at Mac Jan 28 '13 at 16:14
    
Thanks; some day I may write a brew formula that sorts all this out. For now, I'm just glad I've got it working :) –  loseeka Jan 29 '13 at 13:45
add comment

I don´t use brew but download gwhois_20120626.tar.gz, extract it and look inside the file INSTALL.

You need lynx (maybe you get it using brew, otherwise load it down and build it using Xcode and the CLI tools). Curl and Perl is already there. To install LWP::Simple run

sudo cpan LWP::Simple

in terminal. And to copy of the files in point 1 - 3 works with this

sudo cp pattern /etc/gwhois/
sudo cp gwhois /usr/bin/
sudo cp gwhois.1 /usr/share/man/man1/

I haven´t tried it but it should work. Then you can run gwhois in terminal.

share|improve this answer
    
Thanks; still didn't work though. I think that the LWP::Simple module can't be found in @INC; I've updated my original question to show the error message. –  loseeka Jan 27 '13 at 17:30
    
So, you need a libidn.dylib which was build for 32 and also 64 bit and I don´t know how to fix this with brew (builds by default a 64 bit lib). As I told, I don´t use MacPorts, Fink or Homebrew ... so I post a new answer the long way to build all from source. –  NaWi at Mac Jan 28 '13 at 8:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.