From: Florian Fainelli Date: Mon, 6 Jul 2009 12:47:33 +0000 (+0000) Subject: [package] add remotefs (#5280) X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=806a26c85ce72ebccd9cc6d8042ffa220f41dc35;p=openwrt%2Fsvn-archive%2Farchive.git [package] add remotefs (#5280) SVN-Revision: 16714 --- diff --git a/net/remotefs/Makefile b/net/remotefs/Makefile new file mode 100644 index 0000000000..d52d6a284a --- /dev/null +++ b/net/remotefs/Makefile @@ -0,0 +1,74 @@ +# +# Copyright (C) 2006-2009 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. + +include $(TOPDIR)/rules.mk + +PKG_NAME:=remotefs +PKG_REV:=854 +PKG_VERSION:=$(PKG_REV) +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=svn +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_SUBDIR:=remotefs-$(PKG_VERSION) +PKG_SOURCE_URL:=http://remotefs.svn.sourceforge.net/svnroot/remotefs/trunk +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz +include $(INCLUDE_DIR)/package.mk + +define Package/remotefs + TITLE:=RemoteFS + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libfuse +libc +libgcc +libpthread + URL:=http://remotefs.sourceforge.net +endef + +define Package/remotefs/description + remotefs is a network file system designed for use with home NAS. + Simple to use, few dependencies, reasonable security, completely + in user space. Provided remotefs-server package contains server + components. +endef + +define Package/remotefs-server + $(call Package/remotefs) + TITLE:=RemoteFS server + DEPENDS:=+libc +libgcc +endef + +define Package/opkg/conffiles +/etc/rfs-exports +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + INSTALL_DIR="$(PKG_INSTALL_DIR)" \ + HOST_CPU="$(ARCH)" \ + CFLAGS_RELEASE="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \ + LDFLAGS_RELEASE="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib" \ + server client install_client install_server +endef + +define Package/remotefs/install + $(INSTALL_DIR) $(1)/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/rfs $(1)/bin/rfs + $(INSTALL_DIR) $(1)/lib + $(CP) $(PKG_INSTALL_DIR)/lib/librfs.so.* $(1)/lib +endef + +define Package/remotefs-server/install + $(INSTALL_DIR) $(1)/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/rfsd $(1)/bin/rfsd + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/rfspasswd $(1)/bin/rfspasswd + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/rfs-exports $(1)/etc/rfs-exports + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/rfsd $(1)/etc/init.d/rfsd +endef + +$(eval $(call BuildPackage,remotefs)) +$(eval $(call BuildPackage,remotefs-server)) diff --git a/net/remotefs/files/rfsd b/net/remotefs/files/rfsd new file mode 100755 index 0000000000..67ffef18dc --- /dev/null +++ b/net/remotefs/files/rfsd @@ -0,0 +1,25 @@ +#!/bin/sh /etc/rc.common + +START=50 + +LISTEN=$(ifconfig br-lan | sed -n 's/.*dr:\(.*\)Bc.*/\1/p') +PORT="5001" +RFSD_USER="root" +RFSD_GROUP="root" +PIDFILE="/var/run/rfsd.pid" + +start() +{ + rfsd -a ${LISTEN} -p ${PORT} -u ${RFSD_USER} -g ${RFSD_GROUP} -r ${PIDFILE} +} + +stop() +{ + killall rfsd +} + +reload() +{ + kill -s HUP `cat ${PIDFILE}` + start +}