From eae3ff2d59d8a68ba09213dcb33fcee8444b11a7 Mon Sep 17 00:00:00 2001 From: jasper Date: Mon, 14 Apr 2008 13:39:51 +0000 Subject: [PATCH] import flyback 0.4.0 Apple's Time Machine is a great feature in their OS, and UNIX has almost all of the required technology already built in to recreate it. This is a simple GUI to make it easy to use. help and ok ajacoutot@ --- sysutils/flyback/Makefile | 50 +++++++++++++++++++ sysutils/flyback/distinfo | 5 ++ sysutils/flyback/files/flyback.sh | 8 +++ .../flyback/patches/patch-backup_backend_py | 12 +++++ sysutils/flyback/patches/patch-flyback_py | 46 +++++++++++++++++ sysutils/flyback/pkg/DESCR | 3 ++ sysutils/flyback/pkg/PLIST | 12 +++++ 7 files changed, 136 insertions(+) create mode 100644 sysutils/flyback/Makefile create mode 100644 sysutils/flyback/distinfo create mode 100644 sysutils/flyback/files/flyback.sh create mode 100644 sysutils/flyback/patches/patch-backup_backend_py create mode 100644 sysutils/flyback/patches/patch-flyback_py create mode 100644 sysutils/flyback/pkg/DESCR create mode 100644 sysutils/flyback/pkg/PLIST diff --git a/sysutils/flyback/Makefile b/sysutils/flyback/Makefile new file mode 100644 index 00000000000..8f93c1ccee5 --- /dev/null +++ b/sysutils/flyback/Makefile @@ -0,0 +1,50 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2008/04/14 13:39:51 jasper Exp $ + +COMMENT= Time Machine-like backup tool + +DISTNAME= flyback_0.4.0 +PKGNAME= ${DISTNAME:S/_/-/} +CATEGORIES= sysutils x11 + +HOMEPAGE= http://flyback-project.org/ + +# GPLv2 +PERMIT_PACKAGE_CDROM= Yes +PERMIT_PACKAGE_FTP= Yes +PERMIT_DISTFILES_CDROM= Yes +PERMIT_DISTFILES_FTP= Yes + +MASTER_SITES= http://flyback.googlecode.com/files/ + +USE_X11= Yes + +MODULES= lang/python + +RUN_DEPENDS= ::databases/py-sqlite \ + ::net/rsync \ + ::x11/gnome/py-gnome + +NO_REGRESS= Yes +NO_BUILD= Yes + +WRKDIST= ${WRKDIR}/flyback + +pre-configure: + @sed -e 's,!!MODPY_SITEPKG!!,${MODPY_SITEPKG},g' \ + -e 's,!!MODPY_BIN!!,${MODPY_BIN},g' \ + < ${FILESDIR}/flyback.sh > \ + ${WRKSRC}/flyback + @perl -pi -e 's,/usr/bin/env python,${MODPY_BIN},g;' \ + -e 's,!!PREFIX!!,${PREFIX},g;' \ + -e 's,!!MODPY_BIN!!,${MODPY_BIN},g' ${WRKSRC}/*.py + +do-install: + ${INSTALL_DATA_DIR} ${PREFIX}/share/flyback + ${INSTALL_DATA_DIR} ${WRKINST}/${MODPY_SITEPKG}/flyback + ${INSTALL_SCRIPT} ${WRKSRC}/flyback ${PREFIX}/bin/flyback + ${INSTALL_DATA} ${WRKSRC}/GPL.txt ${WRKSRC}/viewer.glade \ + ${PREFIX}/share/flyback + find ${WRKSRC} -name \*.py -exec \ + ${INSTALL_DATA} {} ${WRKINST}/${MODPY_SITEPKG}/flyback \; + +.include diff --git a/sysutils/flyback/distinfo b/sysutils/flyback/distinfo new file mode 100644 index 00000000000..0e9a5ac02fc --- /dev/null +++ b/sysutils/flyback/distinfo @@ -0,0 +1,5 @@ +MD5 (flyback_0.4.0.tar.gz) = bJJNnd1UY7rPiUZ3aMUafw== +RMD160 (flyback_0.4.0.tar.gz) = aeXCf+aKl91tQJjXsndaZdIiZ60= +SHA1 (flyback_0.4.0.tar.gz) = 9zRqlR+nHk3s512qe/yTfIE+Cbs= +SHA256 (flyback_0.4.0.tar.gz) = hG0j1uKg94QK/bb8KE0M36N+RjwBsZSs8HCacGyR2wQ= +SIZE (flyback_0.4.0.tar.gz) = 25616 diff --git a/sysutils/flyback/files/flyback.sh b/sysutils/flyback/files/flyback.sh new file mode 100644 index 00000000000..552be477912 --- /dev/null +++ b/sysutils/flyback/files/flyback.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# +# $OpenBSD: flyback.sh,v 1.1.1.1 2008/04/14 13:39:51 jasper Exp $ +# + +cd !!MODPY_SITEPKG!!/flyback +exec !!MODPY_BIN!! \ + !!MODPY_SITEPKG!!/flyback/flyback.py "$@" diff --git a/sysutils/flyback/patches/patch-backup_backend_py b/sysutils/flyback/patches/patch-backup_backend_py new file mode 100644 index 00000000000..51c9720dd09 --- /dev/null +++ b/sysutils/flyback/patches/patch-backup_backend_py @@ -0,0 +1,12 @@ +$OpenBSD: patch-backup_backend_py,v 1.1.1.1 2008/04/14 13:39:51 jasper Exp $ +--- backup_backend.py.orig Thu Nov 15 07:22:16 2007 ++++ backup_backend.py Mon Apr 14 13:08:35 2008 +@@ -229,7 +229,7 @@ class backup: + + if latest_backup_dir: + last_backup = self.parent_backup_dir +'/'+ latest_backup_dir.strftime(BACKUP_DIR_DATE_FORMAT) +- self.run_cmd_output_gui("cp -al '%s' '%s'" % (last_backup, new_backup)) ++ self.run_cmd_output_gui("cp -RPp '%s' '%s'" % (last_backup, new_backup)) + self.run_cmd_output_gui("chmod u+w '%s'" % new_backup) + + for dir in self.included_dirs: diff --git a/sysutils/flyback/patches/patch-flyback_py b/sysutils/flyback/patches/patch-flyback_py new file mode 100644 index 00000000000..d94b8112928 --- /dev/null +++ b/sysutils/flyback/patches/patch-flyback_py @@ -0,0 +1,46 @@ +$OpenBSD: patch-flyback_py,v 1.1.1.1 2008/04/14 13:39:51 jasper Exp $ +--- flyback.py.orig Thu Nov 15 07:22:16 2007 ++++ flyback.py Mon Apr 14 14:09:38 2008 +@@ -21,7 +21,7 @@ import os, sys, traceback, math + + RUN_FROM_DIR = os.path.abspath(os.path.dirname(sys.argv[0])) + '/' + VERSION = 'v0.4.0' +-GPL = open( RUN_FROM_DIR + 'GPL.txt', 'r' ).read() ++GPL = open( '!!PREFIX!!/share/flyback/' + 'GPL.txt', 'r' ).read() + + DEFAULT_EXCLUDES = [ + '/**/.thumbnails/', +@@ -327,7 +327,7 @@ class main_gui: + def __init__(self): + + gnome.init("programname", "version") +- self.xml = gtk.glade.XML(RUN_FROM_DIR + 'viewer.glade') ++ self.xml = gtk.glade.XML('!!PREFIX!!' + '/share/flyback/' + 'viewer.glade') + o = self + self.backup = backup(o) + +@@ -589,13 +589,13 @@ class prefs_gui: + def install_crontab(self, c): + existing_crons = [] + +- stdin, stdout = os.popen4('crontab -l') ++ stdin, stdout = os.popen4('crontab -l | grep -v "DO NOT EDIT THIS FILE" | grep -v "/tmp/.* installed on" | grep -v "Cron version .* crontab.c"') + for line in stdout: + if line.startswith('no crontab for'): continue + if line.endswith('#flyback\n'): continue + existing_crons.append(line) + if c: +- existing_crons.append(c + ' python '+ os.getcwd() +'/flyback.py --backup #flyback\n') ++ existing_crons.append(c + ' !!MODPY_BIN!! '+ os.getcwd() +'/flyback.py --backup #flyback\n') + stdin.close() + stdout.close() + +@@ -631,7 +631,7 @@ class prefs_gui: + # init external_storage_location + external_storage_location = client.get_string("/apps/flyback/external_storage_location") + if not external_storage_location: +- external_storage_location = '/external_storage_location' ++ external_storage_location = '/var/tmp' + self.xml.get_widget('external_storage_location').set_current_folder( external_storage_location ) + + self.xml.get_widget('prefs_dialog').show() diff --git a/sysutils/flyback/pkg/DESCR b/sysutils/flyback/pkg/DESCR new file mode 100644 index 00000000000..5b872759cf6 --- /dev/null +++ b/sysutils/flyback/pkg/DESCR @@ -0,0 +1,3 @@ +Apple's Time Machine is a great feature in their OS, and UNIX has +almost all of the required technology already built in to recreate it. +This is a simple GUI to make it easy to use. diff --git a/sysutils/flyback/pkg/PLIST b/sysutils/flyback/pkg/PLIST new file mode 100644 index 00000000000..e45f062a299 --- /dev/null +++ b/sysutils/flyback/pkg/PLIST @@ -0,0 +1,12 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2008/04/14 13:39:51 jasper Exp $ +bin/flyback +lib/python${MODPY_VERSION}/site-packages/flyback/ +lib/python${MODPY_VERSION}/site-packages/flyback/backup_backend.py +lib/python${MODPY_VERSION}/site-packages/flyback/config_backend.py +lib/python${MODPY_VERSION}/site-packages/flyback/desktop.py +lib/python${MODPY_VERSION}/site-packages/flyback/flyback.py +lib/python${MODPY_VERSION}/site-packages/flyback/help_data.py +lib/python${MODPY_VERSION}/site-packages/flyback/opengl_viewer.py +share/flyback/ +share/flyback/GPL.txt +share/flyback/viewer.glade