How to: Compile Synology Packages

I’ve been doing some toying around, trying to get node.js up and running on my DS1513+ NAS. My end goal was to get the Spotify2 plugin by fuzeman working, which requires node.js. Here’s a quick guide on how to create your packages using Ubuntu and Git.

 

We want to make use of SPKSRC, a cross compilation framework which can be used to create native packages for Synology devices.

 

In theory these steps should work for similar projects hosted on Git that you would like to convert into an .SPK file.

Difficulty:

Intermediate

Requirements:

Ubuntu, Virtualbox (if required)

I started off by installing a 64-bit copy of Ubuntu within Virtualbox on Windows. Once you’re logged into Ubuntu you need to fire up the Terminal application.

1. Now we check for any updates that may be available:

sudo apt-get update

2. Next, we can install our required list of packages:

sudo apt-get install build-essential debootstrap python-pip automake libgmp3-dev libltdl-dev libunistring-dev libffi-dev ncurses-dev imagemagick libssl-dev pkg-config zlib1g-dev gettext git curl subversion check  intltool gperf flex bison xmlto php5 expect libgc-dev mercurial cython lzip

3. Now we’ll install a package called libboost, check the latest version here. If this doesn’t work for you try installing bjam instead.

sudo apt-get install libboost1.55-dev

4. Now that we’re set up we can clone the SPKSRC repo on Github:

git clone https://github.com/SynoCommunity/spksrc.git

5. Now we can start to compile our package, in this case node.js. I’m also specifying the correct architecture for my NAS here (cedarview). If different, check yours here. This process can take a little time.

cd spksrc/spk/node
make arch-cedarview

6. If all went well, congratulations! You should find your new .spk within the /spksrc/packages folder.