This commit is contained in:
Glenn Y. Rolland 2011-09-04 04:51:47 +02:00
commit d3d12be208
7 changed files with 60 additions and 35 deletions

View file

@ -3,8 +3,8 @@ NAME=qasim
CONFDIR=$(DESTDIR)/etc CONFDIR=$(DESTDIR)/etc
BINDIR=$(DESTDIR)/usr/bin BINDIR=$(DESTDIR)/usr/bin
MANDIR=$(DESTDIR)/usr/share/man MANDIR=$(DESTDIR)/usr/share/man
DOCDIR=$(DESTDIR)/usr/share/doc/$(NAME) DOCDIR=$(DESTDIR)/usr/share/doc
SHAREDIR=$(DESTDIR)/usr/share/$(NAME) SHAREDIR=$(DESTDIR)/usr/share
RUBYVERSION=1.8 RUBYVERSION=1.8
RDOC=rdoc$(RUBYVERSION) RDOC=rdoc$(RUBYVERSION)
@ -32,9 +32,9 @@ build-doc:
install-doc: install-doc:
# # install documentation # # install documentation
rm -fr $(DOCDIR) rm -fr $(DOCDIR)/$(NAME)
mkdir -p $(DOCDIR) mkdir -p $(DOCDIR)/$(NAME)
cp -a doc $(DOCDIR) cp -a doc $(DOCDIR)/$(NAME)
install: install-bin install-lib install-data install: install-bin install-lib install-data
@ -50,7 +50,7 @@ install-bin:
install-lib: install-lib:
for libfile in $(NAME)/*.rb ; do \ for libfile in $(NAME)/*.rb ; do \
install -D -o root -g root -m 644 $$libfile $(SHAREDIR)/$$libfile; \ install -D -o root -g root -m 644 $$libfile $(SHAREDIR)/$(NAME)/$$libfile; \
done done
install-data: install-data:
@ -59,17 +59,19 @@ install-data:
# cat $(NAME).1 | gzip > $(MANDIR)/man1/$(NAME).1.gz # cat $(NAME).1 | gzip > $(MANDIR)/man1/$(NAME).1.gz
# #
## Install icons ## Install icons
mkdir -p $(SHAREDIR)/icons mkdir -p $(SHAREDIR)/$(NAME)/icons
install -D -o root -g root -m 644 $(CURDIR)/icons/$(NAME).svg \ install -D -o root -g root -m 644 $(CURDIR)/icons/$(NAME).svg \
$(SHAREDIR)/icons/$(NAME).svg $(SHAREDIR)/$(NAME)/icons/$(NAME).svg
# #
## Install completion file ## Install completion file
# install -D -o root -g root -m 644 $(CURDIR)/$(NAME).completion $(DESTDIR)/etc/bash_completion.d/$(NAME) # install -D -o root -g root -m 644 $(CURDIR)/$(NAME).completion $(DESTDIR)/etc/bash_completion.d/$(NAME)
# #
## Install configuration files ## Install configuration files
mkdir -p $(CONFDIR)/xdg/autostart mkdir -p $(CONFDIR)/xdg/autostart
install -D -o root -g root -m 644 $(CURDIR)/conf/autostart/$(NAME).desktop \ install -D -o root -g root -m 644 $(CURDIR)/conf/$(NAME).desktop \
$(CONFDIR)/xdg/autostart/$(NAME).desktop $(CONFDIR)/xdg/autostart/$(NAME).desktop
install -D -o root -g root -m 644 $(CURDIR)/conf/$(NAME).desktop \
$(SHAREDIR)/applications/$(NAME).desktop
mkdir -p $(CONFDIR)/$(NAME) mkdir -p $(CONFDIR)/$(NAME)
install -D -o root -g root -m 644 $(CURDIR)/conf/config \ install -D -o root -g root -m 644 $(CURDIR)/conf/config \
$(CONFDIR)/$(NAME)/config $(CONFDIR)/$(NAME)/config
@ -77,9 +79,9 @@ install-data:
$(CONFDIR)/$(NAME)/default.map $(CONFDIR)/$(NAME)/default.map
# #
# Install examples # Install examples
mkdir -p $(DOCDIR)/examples mkdir -p $(DOCDIR)/$(NAME)/examples
for f in `ls examples`; do \ for f in `ls examples`; do \
cat examples/$$f | gzip -f9 > $(DOCDIR)/examples/$$f.gz ; \ cat examples/$$f | gzip -f9 > $(DOCDIR)/$(NAME)/examples/$$f.gz ; \
done done
.PHONY: destdir .PHONY: destdir

View file

@ -8,6 +8,7 @@ Terminal=false
Type=Application Type=Application
Icon=printer Icon=printer
NotShowIn= NotShowIn=
StartupNotify=false
X-Desktop-File-Install-Version=0.15 X-Desktop-File-Install-Version=0.15
Categories=KDE;GTK;Monitor;System; Categories=KDE;GTK;Monitor;System;
StartupNotify=true
Categories=KDE;Qt;Network;System;Utility;

30
debian/changelog vendored
View file

@ -1,3 +1,33 @@
qasim (0.1.5) unstable; urgency=low
* map: Added missing require for fileutils.
-- Glenn ROLLAND <glenux@fr.st> Tue, 09 Aug 2011 22:46:33 +0200
qasim (0.1.4) unstable; urgency=low
* Fixed localpath bug.
-- Glenn ROLLAND <glenux@fr.st> Tue, 09 Aug 2011 22:35:10 +0200
qasim (0.1.3) unstable; urgency=low
* Create mountpoint if non-existant.
-- Glenn Y. Rolland <glenux@glenux.net> Sun, 07 Aug 2011 17:43:56 +0200
qasim (0.1.2) unstable; urgency=low
* Disabled rdebug & added another missing dependency.
-- Glenn Y. Rolland <glenux@glenux.net> Sun, 07 Aug 2011 17:06:15 +0200
qasim (0.1.1) unstable; urgency=low
* Added missing dependencies (libqt4-ruby & ruby)
-- Glenn Y. Rolland <glenux@glenux.net> Sun, 07 Aug 2011 16:53:20 +0200
qasim (0.1) unstable; urgency=low qasim (0.1) unstable; urgency=low
* Initial version. * Initial version.

2
debian/control vendored
View file

@ -7,7 +7,7 @@ Standards-Version: 3.7.2
Package: qasim Package: qasim
Architecture: all Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, sshfs (>= 1.7) Depends: ${shlibs:Depends}, ${misc:Depends}, sshfs (>= 1.7), ruby, libqt4-ruby, rubygems
Description: Easy mount solution for SSH filesystems. Description: Easy mount solution for SSH filesystems.
Qasim is a front-end for sshfs, the filesystem client based on fuse Qasim is a front-end for sshfs, the filesystem client based on fuse
and ssh. It provides automating and global settings control for sshfs mounts. and ssh. It provides automating and global settings control for sshfs mounts.

View file

@ -7,7 +7,7 @@ require 'pp'
require 'find' require 'find'
require 'rubygems' require 'rubygems'
require 'rdebug/base' #require 'rdebug/base'
require 'qasim/constants' require 'qasim/constants'
require 'qasim/map' require 'qasim/map'
@ -34,7 +34,7 @@ module Qasim
end end
def parse_maps &blk def parse_maps &blk
rdebug "Config: #{@config_dir}/config" #rdebug "Config: #{@config_dir}/config"
@maps = [] @maps = []
Find.find( @config_dir, APP_SYSCONFIG_DIR ) do |path| Find.find( @config_dir, APP_SYSCONFIG_DIR ) do |path|

View file

@ -1,6 +1,7 @@
require 'fileutils'
require 'rubygems' require 'rubygems'
require 'rdebug/base' #require 'rdebug/base'
require 'qasim/config' require 'qasim/config'
module Qasim module Qasim
@ -38,7 +39,7 @@ module Qasim
def load path=nil def load path=nil
@path=path unless path.nil? @path=path unless path.nil?
rdebug "Parsing map #{@path}" #rdebug "Parsing map #{@path}"
f = File.open @path f = File.open @path
linect = 0 linect = 0
local_env = ENV.clone local_env = ENV.clone
@ -64,22 +65,22 @@ module Qasim
case line case line
when /^\s*REMOTE_USER\s*=\s*(.*)\s*$/ then when /^\s*REMOTE_USER\s*=\s*(.*)\s*$/ then
@user = $1 @user = $1
rdebug "d: remote_user => #{$1}" #rdebug "d: remote_user => #{$1}"
when /^\s*REMOTE_PORT\s*=\s*(.*)\s*$/ then when /^\s*REMOTE_PORT\s*=\s*(.*)\s*$/ then
@port = $1.to_i @port = $1.to_i
rdebug "d: remote_port => #{$1}" #rdebug "d: remote_port => #{$1}"
when /^\s*REMOTE_HOST\s*=\s*(.*)\s*$/ then when /^\s*REMOTE_HOST\s*=\s*(.*)\s*$/ then
@host = $1 @host = $1
rdebug "d: remote_host => #{$1}" #rdebug "d: remote_host => #{$1}"
when /^\s*REMOTE_CYPHER\s*=\s*(.*)\s*$/ then when /^\s*REMOTE_CYPHER\s*=\s*(.*)\s*$/ then
if CYPHERS.map{|x| x.to_s}.include? $1 then if CYPHERS.map{|x| x.to_s}.include? $1 then
@host = $1.to_sym @host = $1.to_sym
end end
when /^\s*MAP\s*=\s*(.*)\s+(.*)\s*$/ then when /^\s*MAP\s*=\s*(.*)\s+(.*)\s*$/ then
@links[$1] = $2 @links[$1] = $2
rdebug "d: link #{$1} => #{$2}" #rdebug "d: link #{$1} => #{$2}"
when /^\s*$/,/^\s*#/ then when /^\s*$/,/^\s*#/ then
rdebug "d: dropping empty line" #rdebug "d: dropping empty line"
else else
raise MapParseError, "parse error at #{@path}:#{linect}" raise MapParseError, "parse error at #{@path}:#{linect}"
end end
@ -99,7 +100,7 @@ module Qasim
end end
def online? def online?
rdebug "testing online? %s " % self.inspect #rdebug "testing online? %s " % self.inspect
#FIXME: test liveness #FIXME: test liveness
end end
@ -144,6 +145,7 @@ module Qasim
# FIXME: test connexion with Net::SSH + timeout or ask password # FIXME: test connexion with Net::SSH + timeout or ask password
@links.each do |name, remotepath| @links.each do |name, remotepath|
localpath = File.join ENV['HOME'], "mnt", name localpath = File.join ENV['HOME'], "mnt", name
FileUtils.mkdir_p localpath
cmd = "sshfs" cmd = "sshfs"
cmd_args = [ cmd_args = [
"-o","allow_root" , "-o","allow_root" ,
@ -159,7 +161,7 @@ module Qasim
"-o","Port=%s" % @port, "-o","Port=%s" % @port,
"%s@%s:%s" % [@user,@host,remotepath], "%s@%s:%s" % [@user,@host,remotepath],
localpath ] localpath ]
rdebug "command: %s" % [ cmd, cmd_args ].flatten.join(' ') #rdebug "command: %s" % [ cmd, cmd_args ].flatten.join(' ')
if block_given? then if block_given? then
yield name, cmd, cmd_args yield name, cmd, cmd_args
else else
@ -180,7 +182,7 @@ module Qasim
"-u", #umount "-u", #umount
"-z" ,#lazy "-z" ,#lazy
localpath ] localpath ]
rdebug "command: %s" % [ cmd, cmd_args ].flatten.join(' ') #rdebug "command: %s" % [ cmd, cmd_args ].flatten.join(' ')
if block_given? then if block_given? then
yield name, cmd, cmd_args yield name, cmd, cmd_args
else else

View file

@ -1,10 +0,0 @@
[Desktop Entry]
Type=Application
Encoding=UTF-8
Version=1.0
Name=SSHFS Mapper
Name[fr_FR@euro]=SSHFS Mapper
Comment=Access to remote SSH shares
Comment[fr_FR@euro]=Accès aux partages SSH distants
Exec=sshfs-mapper
X-GNOME-Autostart-enabled=true