Now we are ready to compile Oscam.
    Thanks to the respective authors for guides on how to do this ('dui' for getting the info from another forum and 'pr2' for tweaking it) - but I want to put a clear one together for the benefit of all.
    For the sake of this, we are going to compile Oscam with Smartreader and PCSC Support.
    First, you need to get your packages;
    Code:
    apt-get update 
    apt-get -y install apt-utils dialog usbutils
    apt-get -y install gcc g++ wget
    apt-get -y install build-essential subversion libpcsclite1 libpcsclite-dev
    apt-get -y install libssl-dev cmake make 
    apt-get -y install libusb-1.0-0-dev nano
    apt-get install pcscd pcsc-tools
    Then create the following symbolic link so Smartreader support is added during the compile;
    Code:
    ln -s /usr/lib/arm-linux-gnueabihf/libusb-1.0.a  /usr/local/lib/libusb-1.0.a
    Get the Oscam sources;
    Code:
    cd /usr/src
    svn co 
http://www.streamboard.tv/svn/oscam/trunk oscam-svn
    Compile Oscam (note the two dots after the 5th line are there because they need to be).
    Code:
    cd oscam-svn
    mkdir build
    chmod 755 build
    cd build
    cmake -DHAVE_LIBUSB=1 -DHAVE_PCSC=1 -DWEBIF=1 -DHAVE_LIBCRYPTO=1 -DWITH_SSL=1 ..
    make
    Make yourself a coffee - you have a bit of time and deserve one!
    Now it is installed - we need to move it;
    Code:
    cd /usr/src/oscam-svn/build
    cp oscam /var/local/
    and move the list_smargo tool;
    Code:
    cd /usr/src/oscam-svn/build/utils
    cp list_smargo /var/local/
    They are both now in /var/local - now we need to change permissions;
    Code:
    cd /var/local
    chmod 755 oscam
    chmod 755 list_smargo
    Now oscam needs to start at boot by adding it to rc.local, and you can edit with nano;
    Code:
    nano /etc/rc.local
    arrow down to a line just above 'exit 0' and below 'fi', and add the following;
    Code:
    /var/local/oscam &
    To save, exit with 'CTRL' and 'x' - select 'y' and 'enter'.
    Oscam will now run at boot.
    To get it to restart daily at 5.45 am and to free memory every hour, edit the crontab file;
    Code:
    nano /etc/crontab
    add the following two new lines;
    Code:
    05 * * * * root echo 3 > /proc/sys/vm/drop_caches
    45 05 * * * root /sbin/reboot
    and to save, exit with 'CTRL' and 'x' - select 'y' and 'enter'.
    I won't go on about log files here because Oscam runs without them, and can be added later if you need them. Your config files (oscam.conf, oscam.user and oscam.server) go in /usr/local/etc
    If you want, you can now delete the sources, which are found in /usr/src - just delete the oscam.svn folder.
    you need to forward the port to the internal IP address of your Raspberry pi - this should have been fixed in your router as I went over earlier on, alternatively edit the /etc/network/interfaces file. Take care in doing this if you haven't got an input device and display for your Raspberry Pi as if you set this wrong then you will have no means to connect to your device. See the following for more info on this
    Code:
    
http://wiki.debian.org/NetworkConfiguration
    From this point, I prefer to use an scp client to edit and add my config files. As a start - you can create an oscam.conf file in /usr/local/etc and add;
    Code:
    [webif]
    httpport                      = 8888
    httprefresh                   = 5
    httpallowed                   = 127.0.0.1,192.168.0.0-192.168.255.255
    Save this.
    Reboot your Raspberry Pi. You should now have Oscam running on reboot and you will be able to access the webinterface as well.
    You can log on to webinterface locally on the Raspberry Pi if you use startx to run GUI and after running a web browser, use;
    Code:
    127.0.0.1:8888
    or from a remote computer by using the local IP address of the Raspberry Pi and port 8888 again
    From this you can do all the setting up of your server - rather than add files to /usr/local/etc you can also cut and paste the info from your configs in the files section of webinterface if you prefer
    This works with 2 Omnikey readers, one in each USB port and with a Hub, as tested by myself. For further info about card configs etc, this info is all over the forum so the search bar is your next step!
    Enjoy! 
    Last edited by musogeek; 11-23-2012 at 10:19 PM. Reason: added more install options in cmake as my last buildl had problems 
    * Share
          o Share this post on
          o Digg
          o Del.icio.us
          o Technorati
          o Twitter
mrgmx, master G, wozbwfc and 2 others like this.