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

View file

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

View file

@ -8,6 +8,7 @@ Terminal=false
Type=Application
Icon=printer
NotShowIn=
StartupNotify=false
X-Desktop-File-Install-Version=0.15
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
* Initial version.

2
debian/control vendored
View file

@ -7,7 +7,7 @@ Standards-Version: 3.7.2
Package: qasim
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.
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.

View file

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

View file

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