From 6663c855d61a9820c6bb97632bee3c52775692b5 Mon Sep 17 00:00:00 2001 From: moonman Date: Wed, 14 Aug 2013 03:12:34 -0600 Subject: [PATCH 1/3] add aur/plexmediaserver (for armv5 only) --- aur/plexmediaserver/PKGBUILD | 48 +++++++++++++ aur/plexmediaserver/plexmediaserver.conf.d | 19 ++++++ aur/plexmediaserver/plexmediaserver.install | 75 +++++++++++++++++++++ aur/plexmediaserver/plexmediaserver.service | 12 ++++ aur/plexmediaserver/start_pms | 52 ++++++++++++++ 5 files changed, 206 insertions(+) create mode 100644 aur/plexmediaserver/PKGBUILD create mode 100644 aur/plexmediaserver/plexmediaserver.conf.d create mode 100644 aur/plexmediaserver/plexmediaserver.install create mode 100644 aur/plexmediaserver/plexmediaserver.service create mode 100755 aur/plexmediaserver/start_pms diff --git a/aur/plexmediaserver/PKGBUILD b/aur/plexmediaserver/PKGBUILD new file mode 100644 index 000000000..b3d5b051c --- /dev/null +++ b/aur/plexmediaserver/PKGBUILD @@ -0,0 +1,48 @@ +# Contributor: Praekon +# Contributor: Arthur +# Contributor: Jon Wiersma +# Contributor: monty +# Maintainer: Tom Moore + +#ALARM: moonman +# - Using Synology arm package as the base +# - changed start_pms contents for arm + +buildarch=2 + +pkgname=plexmediaserver +pkgver=0.9.8.4.125 +pkgrel=1 +_subver=ffe2a5d +pkgdesc="Plex Media Server for Linux" +url='http://www.plexapp.com' +arch=('arm') +license=('closed') +depends=('rsync' 'avahi') +backup=('etc/conf.d/plexmediaserver') +install='plexmediaserver.install' + +source=("http://plex.r.worldssl.net/plex-media-server/${pkgver}-${_subver}/PlexMediaServer-${pkgver}-${_subver}-arm.spk" + "${pkgname}.conf.d" + "${pkgname}.service" + "start_pms") + +md5sums=('3e8d842969db8bec8157b7d5312de829' + '32cdd9f9de446f6646616a0077151726' + 'b69f7188025ff62187724041c959adef' + 'da94a77cffc92c8e3af608d52963a238') +build() { + mkdir ${srcdir}/plex + cd ${srcdir}/plex + tar xzf ../package.tgz +} + +package() { + mkdir -p "${pkgdir}"/opt/plexmediaserver + mkdir -p "${pkgdir}"/usr/lib/systemd/system + cp -r ${srcdir}/plex/* "${pkgdir}"/opt/plexmediaserver/ + + install -Dm755 ../start_pms "${pkgdir}"/opt/plexmediaserver/ + install -Dm644 ../plexmediaserver.conf.d "${pkgdir}"/etc/conf.d/plexmediaserver + install -Dm644 ../plexmediaserver.service "${pkgdir}"/usr/lib/systemd/system/plexmediaserver.service +} diff --git a/aur/plexmediaserver/plexmediaserver.conf.d b/aur/plexmediaserver/plexmediaserver.conf.d new file mode 100644 index 000000000..b8d9649cb --- /dev/null +++ b/aur/plexmediaserver/plexmediaserver.conf.d @@ -0,0 +1,19 @@ +PLEX_MEDIA_SERVER_USER=plex + +PLEX_MEDIA_SERVER_HOME=/opt/plexmediaserver + +# the number of plugins that can run at the same time +PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6 + +# ulimit -s $PLEX_MEDIA_SERVER_MAX_STACK_SIZE +PLEX_MEDIA_SERVER_MAX_STACK_SIZE=3000 + +# where the mediaserver should store the transcodes +PLEX_MEDIA_SERVER_TMPDIR=/var/tmp + +# Change this to be what you like +PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="${PLEX_MEDIA_SERVER_HOME}/Library/Application Support" + +# Logs live in /opt/plexmediaserver/Library/Application Support/Plex Media Server/Logs +# Uncomment this to send to syslog-ng +#PLEX_MEDIA_SERVER_USE_SYSLOG=true diff --git a/aur/plexmediaserver/plexmediaserver.install b/aur/plexmediaserver/plexmediaserver.install new file mode 100644 index 000000000..a91e749bf --- /dev/null +++ b/aur/plexmediaserver/plexmediaserver.install @@ -0,0 +1,75 @@ +post_install() { + if [ ! `getent passwd plex` ]; then + useradd -m -r -s /bin/bash -d /opt/plexmediaserver plex + if [ ! $? -eq 0 ] + then + echo "WARNING COULDN'T CREATE PLEX USERID, MAKE SURE I HAVE PERMISSON TO DO THAT!" + exit 1 + fi + fi; + +# Now to fix broken items from plexapp.com + rm -f /opt/plexmediaserver/start.sh + . /etc/conf.d/plexmediaserver + + if [ ! -d "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR" ]; + then + mkdir -p "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR" + if [ ! $? -eq 0 ] + then + echo "WARNING COULDN'T CREATE $PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR, MAKE SURE I HAVE PERMISSON TO DO THAT!" + exit 1 + fi + chown -R ${PLEX_MEDIA_SERVER_USER} "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR" + fi + + if [ ! -d ${PLEX_MEDIA_SERVER_HOME}/Library/Application\ Support/Plex\ Media\ Server/Plug-ins ]; then + mkdir -p ${PLEX_MEDIA_SERVER_HOME}/Library/Application\ Support/Plex\ Media\ Server/Plug-ins + if [ ! $? -eq 0 ] + then + echo "WARNING COULDN'T CREATE $PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR, MAKE SURE I HAVE PERMISSON TO DO THAT!" + exit 1 + fi + cp -r ${PLEX_MEDIA_SERVER_HOME}/Resources/Plug-ins/{System.bundle,Framework.bundle} ${PLEX_MEDIA_SERVER_HOME}/Library/Application\ Support/Plex\ Media\ Server/Plug-ins/ + chown -R ${PLEX_MEDIA_SERVER_USER} ${PLEX_MEDIA_SERVER_HOME} & + fi + + systemctl --system daemon-reload + cat << "EOM" + #### + # Installation done + # - change default configurations in: + # /etc/conf.d/plexmediaserver + # - Launch the server with: + # systemctl start plexmediaserver + # + # This is an UNOFFICIAL package. Please don't go to plex forums + # asking for help as they don't support it on ArchLinux ARM. + # + # Redistributed with permission from Plex team. + #### +EOM + +} + +pre_install() { + if [ -f /usr/lib/systemd/system/plexmediaserver.service ]; then + echo "Stopping Plexmediaserver before starting..." + systemctl stop plexmediaserver + fi; +} + +pre_upgrade() { + pre_install; +} + +pre_remove() { + pre_install; +} + +post_upgrade() { + systemctl --system daemon-reload + . /etc/conf.d/plexmediaserver + rm -f ${PLEX_MEDIA_SERVER_HOME}/start.sh + chown -R ${PLEX_MEDIA_SERVER_USER} ${PLEX_MEDIA_SERVER_HOME} & +} diff --git a/aur/plexmediaserver/plexmediaserver.service b/aur/plexmediaserver/plexmediaserver.service new file mode 100644 index 000000000..922f00593 --- /dev/null +++ b/aur/plexmediaserver/plexmediaserver.service @@ -0,0 +1,12 @@ +[Unit] +Description=Plex Media Server for Linux +After=network.target + +[Service] +EnvironmentFile=-/etc/conf.d/plexmediaserver +ExecStart=/opt/plexmediaserver/start_pms +KillMode=process +Type=forking + +[Install] +WantedBy=multi-user.target diff --git a/aur/plexmediaserver/start_pms b/aur/plexmediaserver/start_pms new file mode 100755 index 000000000..9850958af --- /dev/null +++ b/aur/plexmediaserver/start_pms @@ -0,0 +1,52 @@ +#!/bin/sh + +#defaults - change these parameters in /etc/conf.d/plexmediaserver +export PLEX_MEDIA_SERVER_USER=plex +export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6 +export PLEX_MEDIA_SERVER_HOME=/opt/plexmediaserver +export PLEX_MEDIA_SERVER_MAX_STACK_SIZE=3000 +export PLEX_MEDIA_SERVER_TMPDIR=/tmp +export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="${PLEX_MEDIA_SERVER_HOME}/Library/Application Support" + +test -f /etc/conf.d/plexmediaserver && . /etc/conf.d/plexmediaserver + +if [ ! -d "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR" ] +then + mkdir -p "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR" + chown -R ${PLEX_MEDIA_SERVER_USER} "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR" + if [ ! $? -eq 0 ] + then + echo "WARNING COULDN'T CREATE $PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR, MAKE SURE I HAVE PERMISSON TO DO THAT!" + exit 1 + fi +fi + +if [ ! -d "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Linux/arm/Frameworks/" ] +then + mkdir -p "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Linux/arm/Frameworks/" + chown -R ${PLEX_MEDIA_SERVER_USER} "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Linux/arm/Frameworks/" + if [ ! $? -eq 0 ] + then + echo "WARNING COULDN'T CREATE $PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Linux/arm/Frameworks, MAKE SURE I HAVE PERMISSON TO DO THAT!" + exit 1 + fi +fi + +if [ ! -d "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR/Plex Media Server/Logs" ] +then + mkdir -p "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR/Plex Media Server/Logs" + chown -R ${PLEX_MEDIA_SERVER_USER} "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR/Plex Media Server/Logs" + if [ ! $? -eq 0 ] + then + echo "WARNING COULDN'T CREATE $PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR/Plex Media Server/Logs, MAKE SURE I HAVE PERMISSON TO DO THAT!" + exit 1 + fi +fi + + +export LD_LIBRARY_PATH="${PLEX_MEDIA_SERVER_HOME}" +export TMPDIR="${PLEX_MEDIA_SERVER_TMPDIR}" + +ulimit -s $PLEX_MEDIA_SERVER_MAX_STACK_SIZE + +cd ${PLEX_MEDIA_SERVER_HOME}; su -c "${PLEX_MEDIA_SERVER_HOME}/Plex\ Media\ Server &" ${PLEX_MEDIA_SERVER_USER} From f2e2159ba9083c9fc023b2d870e86211c5ba933a Mon Sep 17 00:00:00 2001 From: moonman Date: Wed, 14 Aug 2013 03:29:28 -0600 Subject: [PATCH 2/3] core/linux-raspberrypi-latest to 3.10.6 --- core/linux-raspberrypi-latest/PKGBUILD | 6 +++--- core/linux-raspberrypi-latest/config | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/linux-raspberrypi-latest/PKGBUILD b/core/linux-raspberrypi-latest/PKGBUILD index bfc962505..f657f8f43 100644 --- a/core/linux-raspberrypi-latest/PKGBUILD +++ b/core/linux-raspberrypi-latest/PKGBUILD @@ -8,8 +8,8 @@ pkgname=('linux-raspberrypi-latest' 'linux-headers-raspberrypi-latest') # pkgname=linux-custom # Build kernel with a different name _kernelname=${pkgname#linux} _basekernel=3.10 -pkgver=${_basekernel}.4 -pkgrel=2 +pkgver=${_basekernel}.6 +pkgrel=1 bfqver=v6r2 arch=('arm armv6h') url="http://www.kernel.org/" @@ -26,7 +26,7 @@ source=('config' "http://algo.ing.unimo.it/people/paolo/disk_sched/patches/${_basekernel}.0-${bfqver}/0002-block-introduce-the-BFQ-${bfqver}-I-O-sched-for-${_basekernel}.patch" "http://algo.ing.unimo.it/people/paolo/disk_sched/patches/${_basekernel}.0-${bfqver}/0003-block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-${bfqver}-for-${_basekernel}.0.patch") -md5sums=('6991d2c0deaf797e738666c702c94048' +md5sums=('e457b67e0260b3e199d632138dd7aafd' '9d3c56a4b999c8bfbd4018089a62f662' 'd00814b57448895e65fbbc800e8a58ba' '9335d1263fd426215db69841a380ea26' diff --git a/core/linux-raspberrypi-latest/config b/core/linux-raspberrypi-latest/config index f7c585b82..3b34bbd9a 100644 --- a/core/linux-raspberrypi-latest/config +++ b/core/linux-raspberrypi-latest/config @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm 3.10.1-2 Kernel Configuration +# Linux/arm 3.10.6-1 Kernel Configuration # CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y @@ -343,6 +343,7 @@ CONFIG_ARM_THUMB=y # CONFIG_CPU_ICACHE_DISABLE is not set # CONFIG_CPU_DCACHE_DISABLE is not set # CONFIG_CPU_BPREDICT_DISABLE is not set +CONFIG_KUSER_HELPERS=y # CONFIG_CACHE_L2X0 is not set CONFIG_ARM_L1_CACHE_SHIFT=5 CONFIG_ARM_DMA_MEM_BUFFERABLE=y @@ -475,8 +476,7 @@ CONFIG_BINFMT_ELF=y CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y CONFIG_BINFMT_SCRIPT=y -CONFIG_HAVE_AOUT=y -CONFIG_BINFMT_AOUT=y +# CONFIG_HAVE_AOUT is not set CONFIG_BINFMT_MISC=m CONFIG_COREDUMP=y From 1bdcbf479bd6f6bbc004daad5ebfd81375073906 Mon Sep 17 00:00:00 2001 From: moonman Date: Wed, 14 Aug 2013 03:32:27 -0600 Subject: [PATCH 3/3] aur/plexmediaserver fix chroot build --- aur/plexmediaserver/PKGBUILD | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aur/plexmediaserver/PKGBUILD b/aur/plexmediaserver/PKGBUILD index b3d5b051c..ae94753b7 100644 --- a/aur/plexmediaserver/PKGBUILD +++ b/aur/plexmediaserver/PKGBUILD @@ -42,7 +42,7 @@ package() { mkdir -p "${pkgdir}"/usr/lib/systemd/system cp -r ${srcdir}/plex/* "${pkgdir}"/opt/plexmediaserver/ - install -Dm755 ../start_pms "${pkgdir}"/opt/plexmediaserver/ - install -Dm644 ../plexmediaserver.conf.d "${pkgdir}"/etc/conf.d/plexmediaserver - install -Dm644 ../plexmediaserver.service "${pkgdir}"/usr/lib/systemd/system/plexmediaserver.service + install -Dm755 ${srcdir}/start_pms "${pkgdir}"/opt/plexmediaserver/ + install -Dm644 ${srcdir}/plexmediaserver.conf.d "${pkgdir}"/etc/conf.d/plexmediaserver + install -Dm644 ${srcdir}/plexmediaserver.service "${pkgdir}"/usr/lib/systemd/system/plexmediaserver.service }