Ticket #2577: ushare.2.patch

File ushare.2.patch, 3.8 KB (added by xaviour, 10 years ago)

Now includes startup script for daemon

  • net/ushare/files/ushare.init

     
     1#!/bin/sh /etc/rc.common 
     2# Copyright (C) 2007 OpenWrt.org 
     3START=50 
     4 
     5BIN=/usr/sbin/ushare 
     6SSD=start-stop-daemon 
     7 
     8start() { 
     9        config_load ushare 
     10        config_foreach start_service ushare 
     11} 
     12 
     13start_service() { 
     14        local cfg="$1" 
     15        config_get username            "$cfg" username 
     16        config_get servername          "$cfg" servername 
     17        config_get interface           "$cfg" interface 
     18        config_get options             "$cfg" options 
     19        config_get content_directories "$cfg" content_directories 
     20 
     21        $SSD -x $BIN -c ${username:-nobody} -S -- -n ${servername:-OpenWrt} -i ${interface:-br-lan} -c ${content_directories:-/tmp} ${options} -D 
     22} 
     23 
     24stop() { 
     25        config_load ushare 
     26        config_foreach stop_service ushare 
     27} 
     28 
     29stop_service() { 
     30        local cfg="$1" 
     31        config_get username            "$cfg" username 
     32 
     33        $SSD -x $BIN -c ${username:-nobody} -K 
     34} 
  • net/ushare/files/ushare.config

     
     1config ushare 
     2        option username            'nobody' 
     3        option servername          'OpenWrt' 
     4        option interface           'br-lan' 
     5        option options             '' 
     6        option content_directories '/tmp' 
  • net/ushare/Makefile

     
     1# 
     2# Copyright (C) 2007 OpenWrt.org 
     3# 
     4# This is free software, licensed under the GNU General Public License v2. 
     5# See /LICENSE for more information. 
     6# 
     7# $Id: Makefile 9348 2007-10-18 18:37:22Z blogic $ 
     8 
     9include $(TOPDIR)/rules.mk 
     10 
     11PKG_NAME:=ushare 
     12PKG_VERSION:=1.0 
     13PKG_RELEASE:=1 
     14 
     15PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 
     16PKG_SOURCE_URL:=http://ushare.geexbox.org/releases/ 
     17PKG_MD5SUM:=a6dad95e61ded6f37fc158d9a81358dc 
     18 
     19include $(INCLUDE_DIR)/package.mk 
     20 
     21define Package/ushare 
     22  SECTION:=net 
     23  CATEGORY:=Network 
     24  DEPENDS:=+libiconv +libupnp +zlib +uclibcxx 
     25  TITLE:=A free UPnP A/V & DLNA Media Server for Linux 
     26  URL:=http://ushare.geexbox.org/ 
     27  SUBMENU:=multimedia 
     28endef 
     29 
     30define Package/ushare/description 
     31 uShare is a UPnP (TM) A/V & DLNA Media Server. It implements the server 
     32 component that provides UPnP media devices with information on available 
     33 multimedia files. uShare uses the built-in http server of libupnp to stream 
     34 the files to clients. 
     35 GeeXboX uShare is able to provide access to both images, videos, music or 
     36 playlists files (see below for a complete file format support list). It 
     37 does not act as an UPnP Media Adaptor and thus, can't transcode streams 
     38 to fit the client requirements. 
     39 uShare is written in C for the GeeXboX project. It is designed to provide 
     40 access to multimedia contents to GeeXboX but can of course be used by any 
     41 other UPnP client device. It should compile and run on any modern POSIX 
     42 compatible system such as Linux. 
     43endef 
     44 
     45 
     46CONFIGURE_ARGS += \ 
     47        --disable-rpath \ 
     48        --with-libiconv-prefix="$(STAGING_DIR)/usr/lib/libiconv" \ 
     49        --without-libintl-prefix \ 
     50        --with-libupnp="$(STAGING_DIR)/usr" \ 
     51        , \ 
     52        LIBS=" -liconv -luClibc++ -lz" \ 
     53 
     54MAKE_FLAGS += \ 
     55        AR="$(TARGET_CROSS)ar" \ 
     56        LTLIBICONV="" \ 
     57        DESTDIR="$(PKG_INSTALL_DIR)" \ 
     58        all install \ 
     59 
     60define Package/ushare/install 
     61        $(INSTALL_DIR) $(1)/usr/sbin 
     62        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/sbin/ 
     63        $(INSTALL_DIR) $(1)/etc/config 
     64        $(INSTALL_DATA) ./files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME) 
     65        $(INSTALL_DIR) $(1)/etc/init.d 
     66        $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME) 
     67endef 
     68 
     69$(eval $(call BuildPackage,ushare))