[78445] trunk/dports/sysutils
ryandesign at macports.org
ryandesign at macports.org
Sat May 7 21:37:51 PDT 2011
Revision: 78445
http://trac.macports.org/changeset/78445
Author: ryandesign at macports.org
Date: 2011-05-07 21:37:49 -0700 (Sat, 07 May 2011)
Log Message:
-----------
PsyncX: new port, version 2.2.2
Added Paths:
-----------
trunk/dports/sysutils/PsyncX/
trunk/dports/sysutils/PsyncX/Portfile
trunk/dports/sysutils/PsyncX/files/
trunk/dports/sysutils/PsyncX/files/patch-AuthorizedTasks.m.diff
trunk/dports/sysutils/PsyncX/files/patch-CronController.m.diff
trunk/dports/sysutils/PsyncX/files/patch-CronJob.m.diff
trunk/dports/sysutils/PsyncX/files/patch-psyncapplescript.diff
trunk/dports/sysutils/PsyncX/files/patch-psyncwriter.diff
trunk/dports/sysutils/PsyncX/files/patch-runpsync.diff
trunk/dports/sysutils/PsyncX/files/psyncwriter
trunk/dports/sysutils/PsyncX/files/runpsync
Added: trunk/dports/sysutils/PsyncX/Portfile
===================================================================
--- trunk/dports/sysutils/PsyncX/Portfile (rev 0)
+++ trunk/dports/sysutils/PsyncX/Portfile 2011-05-08 04:37:49 UTC (rev 78445)
@@ -0,0 +1,56 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem 1.0
+PortGroup xcode 1.0
+
+name PsyncX
+version 2.2.2
+categories sysutils
+maintainers ryandesign
+homepage http://psyncx.sourceforge.net/
+
+description Mac OS X wrapper around psync and crontab
+
+long_description ${name} is a ${description}. That means that PsyncX \
+ uses an existing free Unix application, psync, and the \
+ ability to schedule jobs (known as cron in Unix) to \
+ allow you to schedule backups whenever you want.
+
+fetch.type svn
+svn.url http://psyncx.svn.sourceforge.net/svnroot/psyncx/trunk
+svn.revision 29
+worksrcdir trunk
+
+depends_lib port:p5-macosx-file
+
+# I don't know why these files aren't in the psyncx subversion repository.
+# I copied them from the installer package on the psyncx 2.2.2 disk image.
+post-extract {
+ xinstall -W ${filespath} psyncwriter runpsync ${worksrcpath}
+}
+
+patchfiles patch-AuthorizedTasks.m.diff \
+ patch-CronController.m.diff \
+ patch-CronJob.m.diff \
+ patch-psyncapplescript.diff \
+ patch-psyncwriter.diff \
+ patch-runpsync.diff
+
+post-patch {
+ reinplace "s|@PREFIX@|${prefix}|g" \
+ ${worksrcpath}/AuthorizedTasks.m \
+ ${worksrcpath}/CronController.m \
+ ${worksrcpath}/CronJob.m \
+ ${worksrcpath}/psyncapplescript \
+ ${worksrcpath}/psyncwriter \
+ ${worksrcpath}/runpsync
+}
+
+post-destroot {
+ xinstall -W ${worksrcpath} psyncwriter runpsync ${destroot}${prefix}/bin
+}
+
+livecheck.type regex
+livecheck.url http://sourceforge.net/projects/psyncx/files/PsyncX/
+livecheck.regex {/PsyncX ([0-9.]+)"}
Added: trunk/dports/sysutils/PsyncX/files/patch-AuthorizedTasks.m.diff
===================================================================
--- trunk/dports/sysutils/PsyncX/files/patch-AuthorizedTasks.m.diff (rev 0)
+++ trunk/dports/sysutils/PsyncX/files/patch-AuthorizedTasks.m.diff 2011-05-08 04:37:49 UTC (rev 78445)
@@ -0,0 +1,34 @@
+--- AuthorizedTasks.m.orig 2006-07-06 17:18:37.000000000 -0500
++++ AuthorizedTasks.m 2011-05-07 23:11:49.000000000 -0500
+@@ -35,7 +35,7 @@
+ AuthorizationRights *authorizedRights;
+ AuthorizationFlags flags;
+ AuthorizationItem items[2];
+- char *crontabWriterPath = "/usr/local/bin/psyncwriter";
++ char *crontabWriterPath = "@PREFIX@/bin/psyncwriter";
+ char *rmPath = "/bin/rm";
+ OSStatus err = 0;
+ BOOL authorized = NO;
+@@ -126,7 +126,7 @@
+ AuthorizationRights *authorizedRights;
+ AuthorizationFlags flags;
+ AuthorizationItem items[2];
+- char *crontabWriterPath = "/usr/local/bin/psyncwriter";
++ char *crontabWriterPath = "@PREFIX@/bin/psyncwriter";
+ char *rmPath = "/bin/rm";
+ OSStatus err = 0;
+ BOOL authorized = NO;
+@@ -192,11 +192,11 @@
+ //a NULL terminated array of C string pointers.
+ args[0] = NULL;
+
+- err = AuthorizationExecuteWithPrivileges(authorizationRef,"/usr/local/bin/psyncwriter", 0, args, NULL);
++ err = AuthorizationExecuteWithPrivileges(authorizationRef,"@PREFIX@/bin/psyncwriter", 0, args, NULL);
+ if(err!=0)
+ {
+ NSBeep();
+- NSLog(@"Couldn't find the psyncwriter helper tool in /usr/local/bin/",err);
++ NSLog(@"Couldn't find the psyncwriter helper tool in @PREFIX@/bin/",err);
+ return FALSE;
+ }
+ return TRUE;
Added: trunk/dports/sysutils/PsyncX/files/patch-CronController.m.diff
===================================================================
--- trunk/dports/sysutils/PsyncX/files/patch-CronController.m.diff (rev 0)
+++ trunk/dports/sysutils/PsyncX/files/patch-CronController.m.diff 2011-05-08 04:37:49 UTC (rev 78445)
@@ -0,0 +1,20 @@
+--- CronController.m.orig 2006-07-16 15:29:29.000000000 -0500
++++ CronController.m 2011-05-07 23:14:44.000000000 -0500
+@@ -84,7 +84,7 @@
+
+ // See Strings in Cocoa: Part I (Page 3) on Mac Dev Center for how this works
+ NSString *temp=[NSString stringWithString:[crontest objectAtIndex:i]];
+- NSRange range = [temp rangeOfString:@"/usr/local/bin/runpsync"];
++ NSRange range = [temp rangeOfString:@"@PREFIX@/bin/runpsync"];
+ int length = range.length;
+ // If our length is greater than zero, then we have a line with our text in it
+ if(length>0) {
+@@ -188,7 +188,7 @@
+ for(i=0;i<[crontest count];i++) {
+ // Check each item to see if it contains runpsync
+ NSString *temp=[NSString stringWithString:[crontest objectAtIndex:i]];
+- NSRange range = [temp rangeOfString:@"/usr/local/bin/runpsync"];
++ NSRange range = [temp rangeOfString:@"@PREFIX@/bin/runpsync"];
+
+ int length = range.length;
+
Added: trunk/dports/sysutils/PsyncX/files/patch-CronJob.m.diff
===================================================================
--- trunk/dports/sysutils/PsyncX/files/patch-CronJob.m.diff (rev 0)
+++ trunk/dports/sysutils/PsyncX/files/patch-CronJob.m.diff 2011-05-08 04:37:49 UTC (rev 78445)
@@ -0,0 +1,20 @@
+--- CronJob.m.orig 2006-07-16 15:24:03.000000000 -0500
++++ CronJob.m 2011-05-07 23:14:39.000000000 -0500
+@@ -15,7 +15,7 @@
+ {
+ if(self = [super init]) {
+ [self setEnabledDisabledString:@"#"];
+- [self setCommand:@"/usr/local/bin/runpsync"];
++ [self setCommand:@"@PREFIX@/bin/runpsync"];
+ /* [self setFFlag:@""];
+ [self setDFlag:@""];
+ [self setRFlag:@""];*/
+@@ -344,7 +344,7 @@
+ return;
+ }
+ NSMutableString *temp2=[NSMutableString stringWithString:cmd];
+- [temp2 replaceOccurrencesOfString:@"/usr/bin/runpsync" withString:@"/usr/local/bin/runpsync" options:NSLiteralSearch range:NSMakeRange(0, [temp2 length])];
++ [temp2 replaceOccurrencesOfString:@"/usr/bin/runpsync" withString:@"@PREFIX@/bin/runpsync" options:NSLiteralSearch range:NSMakeRange(0, [temp2 length])];
+ [command release];
+ command = [[NSString stringWithString:temp2] retain];
+ [self setNeedToSave:TRUE];
Added: trunk/dports/sysutils/PsyncX/files/patch-psyncapplescript.diff
===================================================================
--- trunk/dports/sysutils/PsyncX/files/patch-psyncapplescript.diff (rev 0)
+++ trunk/dports/sysutils/PsyncX/files/patch-psyncapplescript.diff 2011-05-08 04:37:49 UTC (rev 78445)
@@ -0,0 +1,17 @@
+--- psyncapplescript.orig 2006-07-05 10:43:13.000000000 -0500
++++ psyncapplescript 2011-05-07 23:29:02.000000000 -0500
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl
++#!@PREFIX@/bin/perl
+
+ #print "In order to the run your backup now, type in your Admin password\n\n";
+
+@@ -7,7 +7,7 @@
+ tell application "Terminal"
+ activate
+ do script with command "$ARGV[0]"
+- display dialog "In order to the run your backup now, type in your Admin password" buttons {"OK"} default button 1 with icon 1
++ display dialog "In order to run your backup now, type in your Admin password" buttons {"OK"} default button 1 with icon 1
+ end tell
+ THEEND
+
Added: trunk/dports/sysutils/PsyncX/files/patch-psyncwriter.diff
===================================================================
--- trunk/dports/sysutils/PsyncX/files/patch-psyncwriter.diff (rev 0)
+++ trunk/dports/sysutils/PsyncX/files/patch-psyncwriter.diff 2011-05-08 04:37:49 UTC (rev 78445)
@@ -0,0 +1,8 @@
+--- psyncwriter.orig 2003-05-21 12:25:30.000000000 -0500
++++ psyncwriter 2011-05-07 23:23:58.000000000 -0500
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl
++#!@PREFIX@/bin/perl
+
+ ##### Copyright 2003 AcornSoft ####
+
Added: trunk/dports/sysutils/PsyncX/files/patch-runpsync.diff
===================================================================
--- trunk/dports/sysutils/PsyncX/files/patch-runpsync.diff (rev 0)
+++ trunk/dports/sysutils/PsyncX/files/patch-runpsync.diff 2011-05-08 04:37:49 UTC (rev 78445)
@@ -0,0 +1,32 @@
+--- runpsync.orig 2006-07-17 00:42:35.000000000 -0500
++++ runpsync 2011-05-07 23:24:24.000000000 -0500
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl
++#!@PREFIX@/bin/perl
+
+ ### Copyright 2003 AcornSoft ###
+
+@@ -43,11 +43,11 @@
+
+ if(-d $mainHD && -d $secondHD) {
+
+-print `touch /var/log/psync.log`;
+-open(STDOUT, "| tee /var/log/psync.log");
++print `touch @PREFIX@/var/log/psync.log`;
++open(STDOUT, "| tee @PREFIX@/var/log/psync.log");
+ $now=localtime();
+ print "Backup begun $now\n";
+-open(INPUT, "/usr/local/bin/psync $d $f $r '$mainHD' '$secondHD'|");
++open(INPUT, "@PREFIX@/bin/psync $d $f $r '$mainHD' '$secondHD'|");
+
+ while(<INPUT>) {
+ print $_;
+@@ -58,7 +58,7 @@
+ close STDOUT;
+ } # end if
+ else {
+-open(FILE, ">/var/log/psync.log");
++open(FILE, ">@PREFIX@/var/log/psync.log");
+ $now=localtime;
+ print FILE "$now\n";
+ print "$now\n";
Added: trunk/dports/sysutils/PsyncX/files/psyncwriter
===================================================================
--- trunk/dports/sysutils/PsyncX/files/psyncwriter (rev 0)
+++ trunk/dports/sysutils/PsyncX/files/psyncwriter 2011-05-08 04:37:49 UTC (rev 78445)
@@ -0,0 +1,13 @@
+#!/usr/bin/perl
+
+##### Copyright 2003 AcornSoft ####
+
+open(FILE, "/tmp/crontab.txt");
+open(CRONFILE, "> /etc/crontab") or die "Couldn't open the file to write to";
+while(<FILE>) {
+print CRONFILE $_;
+}
+close CRONFILE;
+close FILE;
+
+unlink('/tmp/crontab.txt') or die "Can't delete the file";
Property changes on: trunk/dports/sysutils/PsyncX/files/psyncwriter
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/dports/sysutils/PsyncX/files/runpsync
===================================================================
--- trunk/dports/sysutils/PsyncX/files/runpsync (rev 0)
+++ trunk/dports/sysutils/PsyncX/files/runpsync 2011-05-08 04:37:49 UTC (rev 78445)
@@ -0,0 +1,68 @@
+#!/usr/bin/perl
+
+### Copyright 2003 AcornSoft ###
+
+# Turn off buffering
+$|=1;
+
+$d = ''; # option variable with default value (false)
+$r = ''; # option variable with default value (false)
+$f = ''; # option variable with default value (false)
+
+$ARGV_length=scalar @ARGV;
+if(@ARGV) {
+$f=$ARGV[0];
+$d=$ARGV[1];
+$r=$ARGV[2];
+$mainHD=$ARGV[3];
+$secondHD=$ARGV[4];
+}
+
+if($d) {
+$d="$d";
+}
+else {
+$d="";
+}
+if($f) {
+$f="$f";
+}
+else {
+$f="";
+}
+if($r) {
+$r="$r";
+}
+else {
+$r="";
+}
+
+if((substr($mainHD,0,1)) eq " ") {
+$mainHD=~s/ //;
+}
+
+if(-d $mainHD && -d $secondHD) {
+
+print `touch /var/log/psync.log`;
+open(STDOUT, "| tee /var/log/psync.log");
+$now=localtime();
+print "Backup begun $now\n";
+open(INPUT, "/usr/local/bin/psync $d $f $r '$mainHD' '$secondHD'|");
+
+while(<INPUT>) {
+print $_;
+}
+$now=localtime();
+print "Backup completed: $now";
+close INPUT;
+close STDOUT;
+} # end if
+else {
+open(FILE, ">/var/log/psync.log");
+$now=localtime;
+print FILE "$now\n";
+print "$now\n";
+print FILE "Backup drive wasn't connected\n\n";
+print "One of the folders specified wasn't there (was your backup drive connected?)\n";
+close FILE;
+}
Property changes on: trunk/dports/sysutils/PsyncX/files/runpsync
___________________________________________________________________
Added: svn:executable
+ *
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110507/36ebd757/attachment-0001.html>
More information about the macports-changes
mailing list