~phatforge/xbmc/airplayer-packaging

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
General requirements
====================

To run airplayer, you'll need:

* Python (>= 2.5)
* Pip
* A compatible DNS-SD library (such as Avahi), on OSX this is installed by default

Platform specific requirements
==============================

Linux
-----

On Linux you'll have to install a compatible DNS-SD library.
For Ubuntu you should install the following package:
    
    apt-get install libavahi-compat-libdnssd1

On other Linux distributions you'll have to install a similar package.
    
Mac OS X
--------

There are no specific requirements for Mac OS X.

Windows
-------

For Windows you'll have to install the Bonjour SDK.  
Get it at `http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20737`.
(beware, login required).

Installation
============
Make sure all requirements are met (see above) and execute the following command:

    pip install -r requirements.txt
    
This will install the required python packages airplayer depends on.

Running
=======

Edit settings.py to reflect your setup. For help, read the comments in settings.py.

Airplayer can be run in the foreground in your terminal and in the background as a system daemon (on Linux and OS X).
It is advised to first try to run airplayer in your terminal before trying to run it in the background,
as it will be easier to spot (configuration) issues when running in the foreground.

Foreground
----------

To run airplayer in the foreground execute:

    python airplayer.py
    
Background
----------

There are scripts included to make Airplayer run in the background on Ubuntu and Mac OS X.
By installing this scripts, Airplayer will also start when your computer boots.

### Ubuntu

For Ubuntu (and other Debian like systems) there's a init script included in scripts/ubuntu,
to make airplayer run as a system daemon.  
You should edit the DAEMON, USER, GROUP value to reflect your setup.
Then place the file in /etc/init.d/ and make it executable (chmod +x). Also make sure the
airplayer.py file itself is executable.

You can now start airplayer in the background by executing `/etc/init.d/airplayer start`.
To make airplayer start at boot, execute:

    update-rc.d airplayer defaults
    
### Mac OS X

There's an launchd script included in scripts/macosx/ to make airplayer run in the background
as a LaunchAgent.  
Edit the `path/to/airplayer.py` string to match where you've put airplayer.py and
make sure airplayer.py is executable by running `chmod +x airplayer.py`.  
Then, place the launchd script in /Users/YOUR_USERNAME_/Library/LaunchAgents/. You can
now start and stop airplayer by issuing the following command:

    launchctl start|stop org.pwiddershoven.airplayer

Airplayer will also automatically start when you login. Logs are stored in
/Users/YOUR_USERNAME/Library/Logs/airplayer.log.

### Windows

This feauture is currently not supported on Windows. I'm not a Windows user myself, so I have no idea
what's required to make a python script run as a Windows Service or something. If someone is interested
in tinkering with this and writing some instructions, let me know.