Advertisement
Guest User

universalmediaserver ebuild

a guest
Oct 15th, 2016
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.62 KB | None | 0 0
  1. # Copyright 2016 Ivan The Viking, 1996-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # $Id$
  4.  
  5. EAPI="5"
  6.  
  7. inherit eutils
  8.  
  9. DESCRIPTION="Universal Media Server is a DLNA-compliant UPnP Media Server."
  10. HOMEPAGE="http://www.universalmediaserver.com/"
  11. SRC_URI="mirror://sourceforge/project/unimediaserver/Official%20Releases/Linux/UMS-${PV}-Java8.tgz"
  12.  
  13.  
  14. LICENSE="GPL-2"
  15. SLOT="0"
  16. KEYWORDS="~amd64 ~x86 ~arm64"
  17. IUSE="multiuser +transcode tsmuxer"
  18.  
  19. DEPEND="app-arch/unzip"
  20. RDEPEND=">=virtual/jre-1.8.0
  21.        media-libs/libmediainfo
  22.        media-libs/libzen
  23.        tsmuxer? ( media-video/tsmuxer )
  24.        transcode? ( media-video/mplayer[encode] )"
  25.  
  26. S=${WORKDIR}/ums-${PV}
  27. UMS_HOME=/opt/${PN}
  28.  
  29. src_prepare() {
  30.         if use multiuser; then
  31.                 cat > ${PN} <<-EOF
  32.                 #!/bin/sh
  33.                 if [ ! -e ~/.${PN} ]; then
  34.                         echo "Copying ${UMS_HOME} to ~/.${PN}"
  35.                         cp -pPR "${UMS_HOME}" ~/.${PN}
  36.                 fi
  37.                 export UMS_HOME=\${HOME}/.${PN}
  38.                 exec "\${UMS_HOME}/UMS.sh" "\$@"
  39.                 EOF
  40.         else
  41.                 cat > ${PN} <<-EOF
  42.                 #!/bin/sh
  43.                 export UMS_HOME=${UMS_HOME}
  44.                 exec "\${UMS_HOME}/UMS.sh" "\$@"
  45.                 EOF
  46.         fi
  47.  
  48.         cat > ${PN}.desktop <<-EOF
  49.         [Desktop Entry]
  50.         Name=Universal Media Server
  51.         GenericName=Media Server
  52.         Exec=${PN}
  53.         Icon=${PN}
  54.         Type=Application
  55.         Categories=Network;
  56.         EOF
  57.  
  58.         unzip -j ums.jar resources/images/icon-{32,256}.png || die
  59. }
  60.  
  61. src_install() {
  62.         dobin ${PN}
  63.  
  64.         exeinto ${UMS_HOME}
  65.         doexe UMS.sh
  66.  
  67.         insinto ${UMS_HOME}
  68.         doins -r ums.jar *.conf documentation plugins renderers *.xml
  69.  
  70.         use tsmuxer && dosym /opt/tsmuxer/bin/tsMuxeR ${UMS_HOME}/linux/tsMuxeR
  71.         dodoc CHANGELOG.txt README.txt
  72.  
  73.         newicon -s 32 icon-32.png ${PN}.png
  74.         newicon -s 256 icon-256.png ${PN}.png
  75.  
  76.         domenu ${PN}.desktop
  77.  
  78.         newconfd "${FILESDIR}/${PN}.confd" ${PN}
  79.         newinitd "${FILESDIR}/${PN}.initd" ${PN}
  80. }
  81.  
  82. pkg_postinst() {
  83.         if [[ -z ${REPLACING_VERSIONS} ]]; then
  84.                 ewarn "Don't forget to disable transcoding engines for software"
  85.                 ewarn "that you don't have installed (such as having the VLC"
  86.                 ewarn "transcoding engine enabled when you only have mencoder)."
  87.         elif use multiuser; then
  88.                 ewarn "Remember to refresh the files in ~/.universalmediaserver/"
  89.         fi
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement