darold / squidanalyzer

Squid Analyzer parses Squid proxy access log and reports general statistics about hits, bytes, users, networks, top URLs, and top second level domains. Statistic reports are oriented toward user and bandwidth control.
http://squidanalyzer.darold.net/
126 stars 36 forks source link

Installation failure on OpenBSD -- attempts install to /auto/SquidAnalyzer #136

Closed dspruell closed 8 years ago

dspruell commented 8 years ago

OpenBSD 5.7 (i386) Perl 5.20.1 (perl -V output)

Attempting to install SquidAnalyzer 6.5. Using standard installation steps:

perl Makefile.PL
make
sudo make install

The installation fails as it seems that SquidAnalyzer.pm is not installed into the Perl environment correctly.

Complete output from installation steps:

$ perl Makefile.PL QUIET=1 
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for SquidAnalyzer
Writing MYMETA.yml and MYMETA.json

$ make && sudo make install
cp SquidAnalyzer.pm blib/lib/SquidAnalyzer.pm
cp squid-analyzer blib/script/squid-analyzer
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/squid-analyzer
Manifying blib/man3/SquidAnalyzer.3
Installing blib/arch/SquidAnalyzer.pm
sh install_all.sh
Appending installation info to /usr/libdata/perl5/i386-openbsd/5.20.1/perllocal.pod

The installation failure is seen when attempting to run the program outside of the directory containing sources:

$ squid-analyzer -v                                                                                    
Can't locate SquidAnalyzer.pm in @INC (you may need to install the SquidAnalyzer module) (@INC contains: /usr/local/libdata/perl5/site_perl/i386-openbsd /usr/libdata/perl5/site_perl/i386-openbsd /usr/local/libdata/perl5/site_perl /usr/libdata/perl5/site_perl /usr/libdata/perl5/i386-openbsd/5.20.1 /usr/local/libdata/perl5/i386-openbsd/5.20.1 /usr/libdata/perl5 /usr/local/libdata/perl5 .) at /usr/local/bin/squid-analyzer line 6.
BEGIN failed--compilation aborted at /usr/local/bin/squid-analyzer line 6.

The following directory structure is created by the installation, I think indicating a build/installation failure:

$ ls -lRA /auto/
total 4
drwxr-xr-x  2 root  wheel  512 Jun 18 01:13 SquidAnalyzer

/auto/SquidAnalyzer:
total 4
-rw-r--r--  1 root  wheel  27 Jun 18 01:13 .packlist

Output from make -n and make -n install included:

make_n.txt make_n_install.txt

dspruell commented 8 years ago

Tried recommended advice for installing on FreeBSD at https://github.com/darold/squidanalyzer/blob/master/README - appears to have resolved this issue on OpenBSD. The INSTALLDIRS=site option appears to be key. I used the following commands to install SquidAnalyzer 6.5:

perl Makefile.PL \
    INSTALLDIRS=site \
    QUIET=1 \
    LOGFILE=/var/log/squid.log \
    CONFDIR=/etc/squidanalyzer \
    HTMLDIR=/var/www/squidreport \
    BASEURL=/squidreport
make
sudo make install

This results in installation files/directories at the following paths:

/usr/local/libdata/perl5/site_perl/SquidAnalyzer.pm
/usr/local/bin/squid-analyzer
/etc/squidanalyzer/                                                     
/var/www/squidreport/

Should the installation default be INSTALLDIRS=site?

darold commented 8 years ago

The default install dir will be site in next release v6.6 to avoid BSD issue. Done in commit 0d67250.