Skip to content

Building MiniDLNA for OpenIndiana

MiniDLNA is a lightweight media server available for Linux platforms. It also may work on a wider range of Unix systems, but that capability does not come out of the box.

This post provides some instructions on building MiniDLNA on OpenIndiana, Hipster release.

Build dependencies

Install GCC-7 compiler and and GNU Make build utility

pfexec pkg install git gcc-7 gnu-make

Product dependencies

MiniDLNA README lists the following prerequisites:

Prerequisites


  • libexif
  • libjpeg
  • libid3tag
  • libFLAC
  • libvorbis
  • libsqlite3
  • libavformat (the ffmpeg libraries)

Most of them are available as OpenIndiana packages. To install them run the following command:

pfexec pkg install libexif libjpeg libid3tag flac libvorbis database/sqlite-3

libavformat

This library is a part of FFmpeg project, its sources are available via videolan.org. To build it, execute the following commands:

git clone https://git.videolan.org/git/ffmpeg.git
git checkout  n3.4.1
./configure  --disable-x86asm --disable-swscale-alpha --disable-swresample --disable-swscale --disable-debug
gmake -j4
pfexec gmake install-libavcodec-headers install-libavcodec-static install-libavutil-headers \
       install-libavutil-static install-libavformat-static install-libavformat-headers

Instead of n3.4.1 you may use any recent stable release. Option –disable-swscale-* is needed for dropping out dependencies on another library, not available on OpenIndiana.

MiniDLNA build

1. Obtain latest sources of MiniDLNA

wget https://kent.dl.sourceforge.net/project/minidlna/minidlna/1.2.1/minidlna-1.2.1.tar.gz
tar xf minidlna-1.2.1_static.tar.gz

2. Download and apply patch

cd minidlna-1.2.1/
wget https://hutorny.in.ua/common/minidlna-1.2.1-openindiana.patch
patch -p1  < minidlna-1.2.1-openindiana.patch

This patch provides:

  • fix of configuration error (added linker group for avaformat libs)
  • fix of compilation error (added MIN/MAX to utility.h)
  • fix of compilation error (opted out use of d_type in monitor.c)
  • OpenIndiana service manifest file

3. Configure and build MiniDLNA

LD_LIBRARY_PATH=/usr/local/lib LIBS="-llzma -lz -lbz2 -lsendfile" ./configure
LD_LIBRARY_PATH=/usr/local/lib CFLAGS="-std=gnu90" gmake

4. Install binaries

pfexec gmake install

On OpenIndiana this step does much less than on Linux, so there is a need for extra steps on manual configuration

5. Prepare environment

## 5.1. Add user
pfexec useradd -g nogroup minidlna
## 5.2. Create configuration directory
pfexec mkdir -p /etc/minidlna
## 5.3. Copy configuration file
pfexec cp minidlna.conf /etc/minidlna/
## 5.4. Adjust configuration per your needs
## 5.5. Create directories for the database and logs
##      This example assumes /tank/var/minidlna/ and /tank/var/minidlna/log
##      were used in /etc/minidlna/minidlna.conf
pfexec mkdir -p /tank/var/minidlna/log
pfexec chown -R minidlna /tank/var/minidlna
## 5.6. Register SMF 
pfexec svccfg validate minidlna.xml
pfexec svccfg -v import minidlna.xml
## 5.7. Enable service  
pfexec svcadm enable minidlna

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*

*