summaryrefslogtreecommitdiff
path: root/rdiff-backup/dist
diff options
context:
space:
mode:
authorben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-03-21 07:22:43 +0000
committerben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-03-21 07:22:43 +0000
commit8c37a5bdfdd46d5cfad6e9d67925ddef9ca382bf (patch)
tree8f19be83962ef31d8ad58429d575c6f17d89c0ea /rdiff-backup/dist
parent8259a0d8a9ad1396a93cd6320943dc33446ac6ed (diff)
downloadrdiff-backup-8c37a5bdfdd46d5cfad6e9d67925ddef9ca382bf.tar.gz
First checkin
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@2 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/dist')
-rwxr-xr-xrdiff-backup/dist/makedist66
-rwxr-xr-xrdiff-backup/dist/makerpm34
-rwxr-xr-xrdiff-backup/dist/makeweb27
-rw-r--r--rdiff-backup/dist/rdiff-backup.spec47
4 files changed, 174 insertions, 0 deletions
diff --git a/rdiff-backup/dist/makedist b/rdiff-backup/dist/makedist
new file mode 100755
index 0000000..20198f4
--- /dev/null
+++ b/rdiff-backup/dist/makedist
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+
+import os, re, shutil, time
+
+filelist = ["rdiff-backup", "CHANGELOG", "COPYING", "README", "FAQ.html"]
+
+# Various details about the files must also be specified by the rpm
+# spec template.
+spec_template = "rdiff-backup.spec"
+
+
+def GetVersion():
+ """Return version string by reading in ./rdiff-backup"""
+ fp = open("rdiff-backup", "r")
+ match = re.search("Version (.*?) ", fp.read())
+ fp.close()
+ return match.group(1)
+
+def CopyMan(destination, version):
+ """Create updated man page at the specified location"""
+ fp = open(destination, "w")
+ date = time.strftime("%B %Y", time.localtime(time.time()))
+ version = "Version "+version
+ firstline = ('.TH RDIFF-BACKUP 1 "%s" "%s" "User Manuals"\n' %
+ (date, version))
+ fp.write(firstline)
+ infp = open("rdiff-backup.1", "r")
+ infp.readline()
+ fp.write(infp.read())
+ fp.close()
+ infp.close()
+
+def MakeTar(version):
+ """Create rdiff-backup tar file"""
+ tardir = "rdiff-backup-%s" % version
+ tarfile = "rdiff-backup-%s.tar.gz" % version
+ os.mkdir(tardir)
+ for file in filelist: shutil.copyfile(file, os.path.join(tardir, file))
+ os.chmod(os.path.join(tardir, "rdiff-backup"), 0755)
+ CopyMan(os.path.join(tardir, "rdiff-backup.1"), version)
+ os.system("tar -cvzf %s %s" % (tarfile, tardir))
+ shutil.rmtree(tardir)
+ return tarfile
+
+def MakeSpecFile(version):
+ """Create spec file using spec template"""
+ specfile = "rdiff-backup-%s-1.spec" % version
+ outfp = open(specfile, "w")
+ outfp.write("Version: %s\n" % version)
+ infp = open(spec_template, "r")
+ outfp.write(infp.read())
+ infp.close()
+ outfp.close()
+ return specfile
+
+def Main():
+ assert not os.system("./Make")
+ version = GetVersion()
+ print "Processing version " + version
+ tarfile = MakeTar(version)
+ print "Made tar file " + tarfile
+ specfile = MakeSpecFile(version)
+ print "Made specfile " + specfile
+
+if __name__ == "__main__": Main()
+
diff --git a/rdiff-backup/dist/makerpm b/rdiff-backup/dist/makerpm
new file mode 100755
index 0000000..b3da88d
--- /dev/null
+++ b/rdiff-backup/dist/makerpm
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+
+import os, sys, re
+
+def GetVersion():
+ """Return version string by reading in ./rdiff-backup"""
+ fp = open("rdiff-backup", "r")
+ match = re.search("Version (.*?) ", fp.read())
+ fp.close()
+ return match.group(1)
+
+
+if len(sys.argv) == 1:
+ specfile = "rdiff-backup-%s-1.spec" % GetVersion()
+ print "Using specfile %s" % specfile
+elif len(sys.argv) == 2:
+ specfile = sys.argv[1]
+ print "Using specfile %s" % specfile
+else:
+ print ("%s takes zero or one argument, the name of the rpm spec "
+ "file" % sys.argv[0])
+ sys.exit(1)
+
+base = ".".join(specfile.split(".")[:-1])
+srcrpm = base+".src.rpm"
+noarchrpm = base+".noarch.rpm"
+tarfile = "-".join(base.split("-")[:-1]) + ".tar.gz"
+
+os.system("install -o root -g root -m 644 %s /usr/src/redhat/SOURCES" %
+ tarfile)
+os.system("rpm -ba --sign -vv --target noarch " + specfile)
+#os.system("install -o ben -g ben -m 644 /usr/src/redhat/SRPMS/%s ." % srcrpm)
+os.system("install -o ben -g ben -m 644 /usr/src/redhat/RPMS/noarch/%s ." %
+ noarchrpm)
diff --git a/rdiff-backup/dist/makeweb b/rdiff-backup/dist/makeweb
new file mode 100755
index 0000000..acbca1f
--- /dev/null
+++ b/rdiff-backup/dist/makeweb
@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+
+import sys, os
+
+def RunCommand(cmd):
+ print cmd
+ os.system(cmd)
+
+if not sys.argv[1:]:
+ print 'Call with version number, as in "./makeweb 0.3.1"'
+ sys.exit(1)
+
+version = sys.argv[1]
+webprefix = "/home/ben/misc/html/mirror/rdiff-backup/"
+
+
+RunCommand("cp *%s* %s" % (version, webprefix))
+RunCommand("rman -f html -r '' rdiff-backup.1 > %srdiff-backup.1.html"
+ % webprefix)
+RunCommand("cp FAQ.html CHANGELOG %s" % webprefix)
+
+
+os.chdir(webprefix)
+print "cd ", webprefix
+RunCommand("rm latest latest.rpm latest.tar.gz")
+RunCommand("ln -s *rpm latest.rpm")
+RunCommand("ln -s *tar.gz latest.tar.gz")
diff --git a/rdiff-backup/dist/rdiff-backup.spec b/rdiff-backup/dist/rdiff-backup.spec
new file mode 100644
index 0000000..40f1e27
--- /dev/null
+++ b/rdiff-backup/dist/rdiff-backup.spec
@@ -0,0 +1,47 @@
+Summary: A backup prog that combines mirroring with incremental backup
+Name: rdiff-backup
+Release: 1
+URL: http://www.stanford.edu/~bescoto/rdiff-backup/
+Source: %{name}-%{version}.tar.gz
+Copyright: GPL
+Group: Applications/Archiving
+BuildRoot: %{_tmppath}/%{name}-root
+requires: librsync, python >= 2.2
+
+%description
+rdiff-backup is a script, written in Python, that backs up one
+directory to another and is intended to be run periodically (nightly
+from cron for instance). The target directory ends up a copy of the
+source directory, but extra reverse diffs are stored in the target
+directory, so you can still recover files lost some time ago. The idea
+is to combine the best features of a mirror and an incremental
+backup. rdiff-backup can also operate in a bandwidth efficient manner
+over a pipe, like rsync. Thus you can use rdiff-backup and ssh to
+securely back a hard drive up to a remote location, and only the
+differences from the previous backup will be transmitted.
+
+%prep
+%setup
+
+%build
+
+%install
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT/usr/bin
+mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1
+
+install -m 755 rdiff-backup $RPM_BUILD_ROOT/usr/bin/rdiff-backup
+install -m 644 rdiff-backup.1 $RPM_BUILD_ROOT/usr/share/man/man1/rdiff-backup.1
+%clean
+
+%files
+%defattr(-,root,root)
+
+/usr/bin/rdiff-backup
+/usr/share/man/man1/rdiff-backup.1.gz
+%doc CHANGELOG COPYING README FAQ.html
+
+%changelog
+* Sun Nov 4 2001 Ben Escoto <bescoto@stanford.edu>
+- Initial RPM
+