While installing LMS from a binary package (deb, rpm) is convenient and
simple, there is one disadvantage to this approach: Some OS/perl updates
tend to break the installed LMS, with no easy fix until the package has
been updated as well.

On a Linux/Unix system, there is an elegant solution to this, provided
you have some basic technical knowledge: don't use a pre-packaged LMS
(rpm etc.), but build your own with it's own perl installation:

- build a supported perl (e.g. 5.14) and install it somewhere outside of
the regular file hierarchy (e.g. in /opt/perl-5.14.2-LMS/). Any perl
modules needed for LMS also should be installed using this perl.
- build LMS using this perl, and not the standard perl 

Using this approach, you are independent of the OS updates and the
problems with perl versions (and even worse, the specific perl module
versions required by LMS) completely disappear. On my server, the LMS
and LMS-perl installation has been unchanged since the initial build
over a year ago, while the standard OS perl (and all it's modules) have
been upgraded several times.

A SHORT GUIDE TO BUILDING LMS

- download the perl sources from 'here'
(http://www.cpan.org/src/README.html). Untar and run the configuration:

Code:
--------------------
    
  ./Configure -des -Dprefix=/opt/perl-5.14.2-LMS -Dusethreads
  
--------------------

- compile and install perl

Code:
--------------------
    
  make
  make test
  make install-strip
  
--------------------


- download the LMS source distribution
(logitechmediaserver-7.7.2-noCPAN.tgz) from 'here'
(http://downloads.slimdevices.com/LogitechMediaServer_v7.7.2/) 
- untar into /opt (which will give you
/opt/logitechmediaserver-7.7.2-33893-noCPAN/ as the full path) and fix
ownership:


Code:
--------------------
    
  chown -R root:root /opt/logitechmediaserver-7.7.2-33893-noCPAN/ 
  
--------------------


- create a directory to build the binary perl modules and download
everything from 'here'
(https://github.com/Logitech/slimserver-vendor/tree/public/7.7/CPAN)
into it
- adjust the buildme.sh script to use the perl in /opt. Look for the
lines:

Code:
--------------------
    
  # Path to Perl 5.14.1
  if [ -x "$HOME/perl5/perlbrew/perls/perl-5.14.1/bin/perl5.14.1" ]; then
  PERL_514=$HOME/perl5/perlbrew/perls/perl-5.14.1/bin/perl5.14.1
  fi
  
--------------------


and add the following after these:


Code:
--------------------
    
  if [ -x "/opt/perl-5.14.2-LMS/bin/perl5.14.2" ]; then
  PERL_514=/opt/perl-5.14.2-LMS/bin/perl5.14.2
  fi
  
--------------------



(Note: the '7.8 script'
(https://github.com/Logitech/slimserver-vendor/blob/public/7.8/CPAN/buildme.sh)
(not used in this guide) has been updated to make this easier: No edits
required, just run it:
PERL_514=/opt/perl-5.14.2-LMS/bin/perl5.14.2 ./buildme.sh
)

- run the builme.sh script. It should output "Building with Perl 5.14 at
/opt/perl-5.14.2-LMS/bin/perl5.14.2" at the beginning. If it uses a
different perl 5.14, something went wrong (note that it might build the
modules for several perls (e.g. your system perl is 5.12, the the
modules for 5.12 and 5.14 will be build)
- if you get errors during the build, you'll have to fix them. The only
recent issue I'm aware of is in Font::FreeType (fix described 'here'
(http://forums.slimdevices.com/showthread.php?99566-Perl-5-14-vs-5-16-vs-5-18&p=756120&viewfull=1#post756120)).
- if the build was successful, you'll find the modules in
build/arch/5.14/<architecture e.g. x86_64-linux-thread-multi>/
- copy the build/arch directory to
/opt/logitechmediaserver-7.7.2-33893-noCPAN/CPAN/ (the full final path
will be e.g
/opt/logitechmediaserver-7.7.2-33893-noCPAN/CPAN/arch/5.14/x86_64-linux-thread-multi/auto/Audio
etc.)

After that, you'll need a start/stop script - the easiest way is
probably to take the existing one for your linux distribution (e.g
'debian'
(https://github.com/Logitech/slimserver-platforms/blob/public/7.8/debian/logitechmediaserver.init),
'gentoo'
(https://github.com/hickinbottoms/logitechmediaserver-bin-ebuild-for-gentoo/blob/master/files/logitechmediaserver.init.d),
...) and simply adjust the directory/file paths. E.g. for Debian:


Code:
--------------------
    
  DAEMON=/opt/logitechmediaserver-7.7.2-33893-noCPAN/slimserver.pl
  
--------------------

and change the line

Code:
--------------------
    
  --exec $DAEMON_SAFE \
  
--------------------

to

Code:
--------------------
    
  --exec $DAEMON \
  
--------------------

Copy the script to the appropriate location:

Code:
--------------------
    
  cp logitechmediaserver.init /etc/init.d/logitechmediaserver
  
--------------------


Then create a user (matching the one specified in the init script, e.g.
squeezeboxserver for debian), create any missing directories referenced
in the init script (usually something like /etc/squeezeboxserver,
/var/lib/squeezeboxserver, and /var/log/squeezeboxserver), and finally,
set the owner for these directories, e.g.

Code:
--------------------
    
  chown squeezeboxserver:nogroup /etc/squeezeboxserver -R
  chown squeezeboxserver:nogroup /var/lib/squeezeboxserver -R
  chown squeezeboxserver:nogroup /var/log/squeezeboxserver -R
--------------------


The last step is to edit scanner.pl and slimserver.pl (both in
/opt/logitechmediaserver-7.7.2-33893-noCPAN/) and change the first line
from
#!/usr/bin/perl
to
#!/opt/perl-5.14.2-LMS/bin/perl5.14.2



[ extGUI4LMS - an alternative web interface: 'forum'
(http://forums.slimdevices.com/showthread.php?98186-Announce-Alternative-Web-Interface-(beta))
/ 'homepage' (http://code.google.com/p/extgui4lms/) ]
------------------------------------------------------------------------
Roland0's Profile: http://forums.slimdevices.com/member.php?userid=56808
View this thread: http://forums.slimdevices.com/showthread.php?t=99648

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to