debianization and merge
authorHeiko Schlittermann (JUMPER) <hs@schlittermann.de>
Fri, 29 Apr 2011 16:26:48 +0200
changeset 70 391d82fcd42c
parent 69 b2b500fa75ba
child 71 69ec9e16616b
debianization and merge
bin/ftbackup
debian/changelog
debian/control
debian/rules
ftbackup.conf.example
--- a/bin/ftbackup	Fri Apr 29 13:00:10 2011 +0200
+++ b/bin/ftbackup	Fri Apr 29 16:26:48 2011 +0200
@@ -25,7 +25,7 @@
 my $HOSTNAME = hostname;
 my $NOW      = time();
 
-my $opt_level     = undef;
+my $opt_level     = 7;
 my $opt_today     = strftime("%F", localtime $NOW);
 my @opt_debug     = ();
 my $opt_verbose   = 0;
@@ -536,6 +536,7 @@
 sub calculate_level($@) {
     my ($cycle, @devs) = @_;
 
+
     foreach my $dev (@devs) {
         if (defined $opt_level) {
             $dev->{level} = $opt_level;
@@ -546,24 +547,18 @@
         {
             $dev->{level} = 0;
         }
-        else { $dev->{level} = 1 }
+        else { $dev->{level} = 0 }
 
         # now we'll see if the level really saves space compared
         # with the next lower level
         my @estimates;
-        while (my $l = $dev->{level} > 0) {
+        while ((my $l = $dev->{level}) > 0) {
             $estimates[$l]     //= get_estimate($dev, $l);
             $estimates[$l - 1] //= get_estimate($dev, $l - 1);
-
-            last
-              if my $savings =
-                  ($estimates[$l - 1] - $estimates[$l]) / $estimates[$l - 1] >=
-                  0.10;
-            warn
-"% savings for level $dev->{level} on $dev->{dev} are @{[int($savings * 100)]}%: ",
-              "will use level ", $dev->{level} - 1, "\n";
+	    last if ($estimates[$l - 1] - $estimates[$l]) / $estimates[$l - 1] >= 0.10;
             --$dev->{level};
         }
+	warn "% $dev->{dev} will use level $dev->{level}\n";
     }
 
     return @devs;
@@ -680,9 +675,9 @@
 
 =item B<-l>|B<--level> I<level>
 
-The backup level. Level other than "0" needs a previous
-level 0 (full) backup. If not specified, it is choosen automagically.
-(default: undef)
+The proposed backup level. If there are less then 10% savings compared
+with a lower level, or if no lower level exists, the level is incremented.
+(default: 7)
 
 =item B<-L>|B<--label> I<label>
 
--- a/debian/changelog	Fri Apr 29 13:00:10 2011 +0200
+++ b/debian/changelog	Fri Apr 29 16:26:48 2011 +0200
@@ -1,3 +1,9 @@
+ftbackup (0.9-1) stable; urgency=low
+
+  * current stable upstream 
+
+ -- Heiko Schlittermann <hs@schlittermann.de>  Fri, 29 Apr 2011 13:04:25 +0200
+
 ftbackup (0.7) stable; urgency=low
 
   * fixed typo in info header 
--- a/debian/control	Fri Apr 29 13:00:10 2011 +0200
+++ b/debian/control	Fri Apr 29 16:26:48 2011 +0200
@@ -4,13 +4,12 @@
 Maintainer: Heiko Schlittermann <hs@schlittermann.de>
 Build-Depends: debhelper (>= 7)
 Standards-Version: 3.7.3
-Homepage: https://keller.schlittermann.de/hg/incubator/ftbackup
+Homepage: https://keller.schlittermann.de/hg/ftbackup
 
 Package: ftbackup
 Architecture: all
 Depends: ${shlibs:Depends}, ${misc:Depends}, openssl, 
     perl-modules (>= 5.10.0-19lenny2), 
-    libperl6-slurp-perl, 
     dump
 Recommends: ftpipe
 Description: encrypted backup via ftp
--- a/debian/rules	Fri Apr 29 13:00:10 2011 +0200
+++ b/debian/rules	Fri Apr 29 16:26:48 2011 +0200
@@ -15,7 +15,7 @@
 configure-stamp:
 	dh_testdir
 	# Add here commands to configure the package.
-	./configure --prefix=/usr
+	perl Build.PL --install-base=/usr
 	touch $@
 
 
@@ -25,7 +25,7 @@
 	dh_testdir
 
 	# Add here commands to compile the package.
-	chmod +x ftbackup
+	./Build
 	#docbook-to-man debian/ftbackup.sgml > ftbackup.1
 
 	touch $@
@@ -36,7 +36,7 @@
 	rm -f build-stamp configure-stamp
 
 	# Add here commands to clean up after the build process.
-	-$(MAKE) distclean
+	-./Build distclean
 
 	dh_clean 
 
@@ -47,10 +47,10 @@
 	dh_installdirs
 
 	# Add here commands to install the package into debian/ftbackup.
-	$(MAKE) DESTDIR=$(CURDIR)/debian/ftbackup install
+	./Build --destdir=$(CURDIR)/debian/ftbackup install
 
-	install -d $(CURDIR)/debian/ftbackup/etc/ftbackup
-	install -m 0600 ftbackup.conf.example $(CURDIR)/debian/ftbackup/etc/ftbackup/default
+	install -d $(CURDIR)/debian/ftbackup/etc
+	install -m 0600 ftbackup.conf.example $(CURDIR)/debian/ftbackup/etc/ftbackup.conf
 
 # Build architecture-independent files here.
 binary-indep: build install
--- a/ftbackup.conf.example	Fri Apr 29 13:00:10 2011 +0200
+++ b/ftbackup.conf.example	Fri Apr 29 16:26:48 2011 +0200
@@ -2,10 +2,11 @@
 # the commented values are the built in defaults
 
 # The encryption key
-# KEY = 
+# KEY = <please provide a good key>
 
 # FTP-Server hostname
-# FTP_HOST = 
+# for login and password please use ~/.netrc
+# FTP_HOST = <fill in the ftp servers hostname here>
 
 # FTP-Server base directory
 # the following expansion work: