diff --git a/net-misc/gerbera/Manifest b/net-misc/gerbera/Manifest
new file mode 100644
index 0000000000000..a0e6539fedc15
--- /dev/null
+++ b/net-misc/gerbera/Manifest
@@ -0,0 +1 @@
+DIST gerbera-1.0.0.tar.gz 805102 SHA256 297c26e0b4223ea96cc6db403e2a2e8f81c51b64284535f3bc644abf24f66975 SHA512 ddc269ce65ba6cd4778c3a7d7dd7f368d659e2813cee962ed167e1ab5a887d8dae32c0197e95733a799c2bb4835904c94f11e1411d4dfab4ed05f39519d4f42d WHIRLPOOL fc568d3e0c58b415b4cfe45a36418c821afcd3909dfd08a99c4ace1c8995d51ea8f7a8f90e13858d60605d5c8ab6aa08b1cb2a10cb02133cef45bfdc2d320ec0
diff --git a/net-misc/gerbera/files/gerbera-1.0.0.confd b/net-misc/gerbera/files/gerbera-1.0.0.confd
new file mode 100644
index 0000000000000..7f5c00830251a
--- /dev/null
+++ b/net-misc/gerbera/files/gerbera-1.0.0.confd
@@ -0,0 +1,28 @@
+# /etc/conf.d/mediatomb: config file for /etc/init.d/mediatomb
+
+# See the mediatomb(1) manpage for more info.
+
+# MediaTomb Web UI port.
+# NOTE: The minimum value allowed is 49152
+MEDIATOMB_PORT=49152
+
+# Run MediaTomb as this user.
+# NOTE: For security reasons do not run MediaTomb as root.
+MEDIATOMB_USER="mediatomb"
+
+# Run MediaTomb as this group.
+# NOTE: For security reasons do not run MediaTomb as root.
+MEDIATOMB_GROUP="mediatomb"
+
+# Path to MediaTomb config file.
+MEDIATOMB_CONFIG="/etc/mediatomb/config.xml"
+
+# Path to MediaTomb log file.
+MEDIATOMB_LOGFILE="/var/log/mediatomb.log"
+
+# Path to MediaTomb pid file.
+MEDIATOMB_PIDFILE="/var/run/mediatomb.pid"
+
+# Other options you want to pass to MediaTomb.
+# Add "--interface ${MEDIATOMB_INTERFACE}" to bind to a named interface.
+MEDIATOMB_OPTIONS=""
diff --git a/net-misc/gerbera/files/gerbera-1.0.0.config b/net-misc/gerbera/files/gerbera-1.0.0.config
new file mode 100644
index 0000000000000..94bdb936e145e
--- /dev/null
+++ b/net-misc/gerbera/files/gerbera-1.0.0.config
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+
+
+ Gerbera
+
+ /var/lib/gerbera
+ /usr/share/gerbera/web
+
+
+ gerbera.db
+
+
+ host
+ database
+ username
+ password
+
+
+
+
+
+
+ 160
+ 10
+ no
+ no
+ 8
+
+
+ *
+
+ video
+
+
+
+ username
+ password
+
+
+
+
+
+ /usr/share/gerbera/js/common.js
+ /usr/share/gerbera/js/playlists.js
+
+ /usr/share/gerbera/js/import.js
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ audio/L16
+ no
+ yes
+ yes
+ no
+ 44100
+ 2
+
+
+
+
+ video/mpeg
+ no
+ yes
+ yes
+ yes
+ 48000
+ 2
+
+
+
+
+
+
diff --git a/net-misc/gerbera/files/gerbera-1.0.0.initd b/net-misc/gerbera/files/gerbera-1.0.0.initd
new file mode 100644
index 0000000000000..2e41089189772
--- /dev/null
+++ b/net-misc/gerbera/files/gerbera-1.0.0.initd
@@ -0,0 +1,29 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+ # In order to properly support this (need vs use), we would have to
+ # parse ${MEDIATOMB_CONFIG} and see if mysql is enabled and if it is
+ # pointing to the local system. #368409
+ use mysql
+}
+
+start() {
+ ebegin "Starting MediaTomb"
+ start-stop-daemon --start --quiet --exec /usr/bin/mediatomb \
+ --pidfile ${MEDIATOMB_PIDFILE} -- --daemon \
+ --pidfile ${MEDIATOMB_PIDFILE} --user ${MEDIATOMB_USER} \
+ --group ${MEDIATOMB_GROUP} --logfile ${MEDIATOMB_LOGFILE} \
+ --config ${MEDIATOMB_CONFIG} --port ${MEDIATOMB_PORT} \
+ ${MEDIATOMB_OPTIONS}
+ eend $?
+}
+
+stop () {
+ ebegin "Stopping MediaTomb"
+ start-stop-daemon --stop --retry 10 --quiet --pidfile ${MEDIATOMB_PIDFILE}
+ eend $?
+}
diff --git a/net-misc/gerbera/gerbera-1.0.0.ebuild b/net-misc/gerbera/gerbera-1.0.0.ebuild
new file mode 100644
index 0000000000000..aff60159844b3
--- /dev/null
+++ b/net-misc/gerbera/gerbera-1.0.0.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils eutils linux-info systemd user
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="https://github.com/v00d00/${PN}.git"
+ KEYWORDS=""
+ SRC_URI=""
+ inherit git-r3
+else
+ SRC_URI="https://github.com/v00d00/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+ S="${WORKDIR}/${P}"
+fi
+
+DESCRIPTION="UPnP Media Server (Based on MediaTomb)"
+HOMEPAGE="https://github.com/v00d00/gerbera"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="curl debug +exif +ffmpeg +javascript lastfm libav +magic mysql +taglib"
+
+DEPEND="
+ !!net-misc/mediatomb
+ net-libs/libupnp:1.8[reuseaddr]
+ >=dev-db/sqlite-3
+ dev-libs/expat
+ mysql? ( virtual/mysql )
+ javascript? ( dev-lang/duktape )
+ taglib? ( >=media-libs/taglib-1.11 )
+ lastfm? ( >=media-libs/lastfmlib-0.4 )
+ exif? ( media-libs/libexif )
+ ffmpeg? (
+ libav? ( >=media-video/libav-10:0= )
+ !libav? ( >=media-video/ffmpeg-2.2:0= )
+ )
+ curl? ( net-misc/curl net-misc/youtube-dl )
+ magic? ( sys-apps/file )
+ sys-apps/util-linux
+ sys-libs/zlib
+ virtual/libiconv
+"
+RDEPEND="${DEPEND}"
+
+CONFIG_CHECK="~INOTIFY_USER"
+
+pkg_setup() {
+ linux-info_pkg_setup
+
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 /dev/null ${PN}
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DWITH_CURL="$(usex curl)" \
+ -DWITH_LOGGING=1 \
+ -DWITH_DEBUG_LOGGING="$(usex debug)" \
+ -DWITH_EXIF="$(usex exif)" \
+ -DWITH_AVCODEC="$(usex ffmpeg)" \
+ -DWITH_JS="$(usex javascript)" \
+ -DWITH_LASTFM="$(usex lastfm)" \
+ -DWITH_MAGIC="$(usex magic)" \
+ -DWITH_MYSQL="$(usex mysql)"
+ )
+
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ systemd_dounit "${S}/scripts/systemd/${PN}.service"
+ use mysql && systemd_dounit "${S}/scripts/systemd/${PN}-mysql.service"
+
+ newinitd "${FILESDIR}/${PN}-1.0.0.initd" "${PN}"
+ use mysql || sed -i -e "/use mysql/d" "${ED}/etc/init.d/${PN}"
+ newconfd "${FILESDIR}/${PN}-1.0.0.confd" "${PN}"
+
+ insinto /etc/${PN}
+ newins "${FILESDIR}/${PN}-1.0.0.config" config.xml
+ fperms 0600 /etc/${PN}/config.xml
+ fowners gerbera:gerbera /etc/${PN}/config.xml
+
+ keepdir /var/lib/${PN}
+ fowners ${PN}:${PN} /var/lib/${PN}
+}
+
+pkg_postinst() {
+ if use mysql ; then
+ elog "Gerbera has been built with MySQL support and needs"
+ elog "to be configured before being started. By default"
+ elog "SQLite will be used."
+ fi
+}
diff --git a/net-misc/gerbera/gerbera-9999.ebuild b/net-misc/gerbera/gerbera-9999.ebuild
new file mode 100644
index 0000000000000..aff60159844b3
--- /dev/null
+++ b/net-misc/gerbera/gerbera-9999.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils eutils linux-info systemd user
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="https://github.com/v00d00/${PN}.git"
+ KEYWORDS=""
+ SRC_URI=""
+ inherit git-r3
+else
+ SRC_URI="https://github.com/v00d00/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+ S="${WORKDIR}/${P}"
+fi
+
+DESCRIPTION="UPnP Media Server (Based on MediaTomb)"
+HOMEPAGE="https://github.com/v00d00/gerbera"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="curl debug +exif +ffmpeg +javascript lastfm libav +magic mysql +taglib"
+
+DEPEND="
+ !!net-misc/mediatomb
+ net-libs/libupnp:1.8[reuseaddr]
+ >=dev-db/sqlite-3
+ dev-libs/expat
+ mysql? ( virtual/mysql )
+ javascript? ( dev-lang/duktape )
+ taglib? ( >=media-libs/taglib-1.11 )
+ lastfm? ( >=media-libs/lastfmlib-0.4 )
+ exif? ( media-libs/libexif )
+ ffmpeg? (
+ libav? ( >=media-video/libav-10:0= )
+ !libav? ( >=media-video/ffmpeg-2.2:0= )
+ )
+ curl? ( net-misc/curl net-misc/youtube-dl )
+ magic? ( sys-apps/file )
+ sys-apps/util-linux
+ sys-libs/zlib
+ virtual/libiconv
+"
+RDEPEND="${DEPEND}"
+
+CONFIG_CHECK="~INOTIFY_USER"
+
+pkg_setup() {
+ linux-info_pkg_setup
+
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 /dev/null ${PN}
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DWITH_CURL="$(usex curl)" \
+ -DWITH_LOGGING=1 \
+ -DWITH_DEBUG_LOGGING="$(usex debug)" \
+ -DWITH_EXIF="$(usex exif)" \
+ -DWITH_AVCODEC="$(usex ffmpeg)" \
+ -DWITH_JS="$(usex javascript)" \
+ -DWITH_LASTFM="$(usex lastfm)" \
+ -DWITH_MAGIC="$(usex magic)" \
+ -DWITH_MYSQL="$(usex mysql)"
+ )
+
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ systemd_dounit "${S}/scripts/systemd/${PN}.service"
+ use mysql && systemd_dounit "${S}/scripts/systemd/${PN}-mysql.service"
+
+ newinitd "${FILESDIR}/${PN}-1.0.0.initd" "${PN}"
+ use mysql || sed -i -e "/use mysql/d" "${ED}/etc/init.d/${PN}"
+ newconfd "${FILESDIR}/${PN}-1.0.0.confd" "${PN}"
+
+ insinto /etc/${PN}
+ newins "${FILESDIR}/${PN}-1.0.0.config" config.xml
+ fperms 0600 /etc/${PN}/config.xml
+ fowners gerbera:gerbera /etc/${PN}/config.xml
+
+ keepdir /var/lib/${PN}
+ fowners ${PN}:${PN} /var/lib/${PN}
+}
+
+pkg_postinst() {
+ if use mysql ; then
+ elog "Gerbera has been built with MySQL support and needs"
+ elog "to be configured before being started. By default"
+ elog "SQLite will be used."
+ fi
+}
diff --git a/net-misc/gerbera/metadata.xml b/net-misc/gerbera/metadata.xml
new file mode 100644
index 0000000000000..e244367f765e3
--- /dev/null
+++ b/net-misc/gerbera/metadata.xml
@@ -0,0 +1,19 @@
+
+
+
+
+ thev00d00@gentoo.org
+ Ian Whyman
+
+ Gerbera is a UPnP media server which allows you to stream your digital media through your home network and consume it on a variety of UPnP compatible devices.
+
+
+ v00d00/gerbera
+
+