Merge commit 'd740b7f1b14b80eb39a0'

Conflicts:
	INSTALL
	README
	shairport.pl

Manually merged all conflicts.
This commit is contained in:
Albert Zeyer
2011-04-12 12:21:28 +02:00
4 changed files with 50 additions and 16 deletions
+11
View File
@@ -19,7 +19,18 @@ MacOSX:
* install homebrew (https://github.com/mxcl/homebrew)
* export ARCHFLAGS="-arch x86_64"
* brew install pkg-config libao
* make
* perl -MCPAN -e 'install Crypt::OpenSSL::RSA'
* perl -MCPAN -e 'install IO::Socket::INET6'
* perl shairport.pl
OSX 10.5 only bundles perl 5.8, which won't work with shairport.
After getting a update here (http://www.perl.org/get.html), it worked.
How to run as a daemon on Mac 10.6
------
* cp hairtunes shairport.pl /usr/local/bin
* vi /usr/local/bin/shairport.pl, change the path of hairtunes from ./hairtunes to /usr/local/bin/hairtunes
* cp org.mafipulation.shairport.plist ~/Library/LaunchAgents/
* launchctl load org.mafipulation.shairport.plist
* launchctl unload org.mafipulation.shairport.plist (to remove)
-1
View File
@@ -34,4 +34,3 @@ Changelog
0.03 April 11, 2011
bugfix: ipv6 didn't work -
IO::Socket::INET6 is required too
+16
View File
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.mafipulation.shairport</string>
<key>RunAtLoad</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/shairport.pl</string>
<string>--apname</string>
<string>RJ</string>
</array>
</dict>
</plist>
+23 -15
View File
@@ -1,18 +1,5 @@
#!/usr/bin/perl
# Configure the following two options:
# AP name - as will be shown in iTunes' menu
# example:
# my $apname = "SteePort";
my $apname = "ShairPort $$ on " . `hostname`;
# password - required to connect
# for no password, set:
# my $password = '';
my $password = '';
# that's all!
# ShairPort - Airtunes compatible server
# Copyright (c) 2011 James Laird
# All rights reserved.
@@ -36,6 +23,9 @@ my $password = '';
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
use Getopt::Long;
use FindBin;
use IO::Select;
use IO::Socket;
use MIME::Base64;
@@ -47,6 +37,24 @@ use Digest::MD5 qw/md5_hex/;
use POSIX ":sys_wait_h";
eval "use IO::Socket::INET6;";
# Configure the following two options:
# AP name - as will be shown in iTunes' menu
# example:
# my $apname = "SteePort";
my $apname = "ShairPort $$ on " . `hostname`;
# password - required to connect
# for no password, set:
my $password = '';
# suppose hairtunes is under same directory
my $hairtunes_cli = $FindBin::Bin . '/hairtunes';
GetOptions("apname=s" => \$apname,
"password=s" => \$password);
# use --apname MyName --password secret as arguments
chomp $apname;
my @hw_addr = (0, map { int rand 256 } 1..5);
@@ -72,7 +80,7 @@ if ($avahi_publish==0) {
"5000",
"tp=UDP","sm=false","sv=false","ek=1","et=0,1","cn=0,1","ch=2","ss=16","sr=44100","pw=false","vn=3","txtvers=1";
die "could not run avahi-publish-service nor dns-sd";
}
}
sub REAP {
if ($avahi_publish == waitpid(-1, WNOHANG)) {
@@ -282,7 +290,7 @@ sub conn_handle_request {
$resp->header('Session', 'DEADBEEF');
my $dec = sprintf("./hairtunes iv %s key %s fmtp %s cport %s tport %s dport %s host %s",
my $dec = sprintf("$hairtunes_cli iv %s key %s fmtp %s cport %s tport %s dport %s host %s",
map { "'$_'" } (
unpack('H*', $conn->{aesiv}),
unpack('H*', $conn->{aeskey}),