Commit 712bd1d4 authored by ben's avatar ben

Distribution changes for new exploded format


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@137 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 7994fceb
...@@ -4,9 +4,6 @@ import os, re, shutil, time ...@@ -4,9 +4,6 @@ import os, re, shutil, time
SourceDir = "src" SourceDir = "src"
DistDir = "dist" DistDir = "dist"
filelist = [SourceDir + "/rdiff-backup", "CHANGELOG",
"COPYING", "README", "FAQ.html"]
# Various details about the files must also be specified by the rpm # Various details about the files must also be specified by the rpm
# spec template. # spec template.
...@@ -20,22 +17,6 @@ def GetVersion(): ...@@ -20,22 +17,6 @@ def GetVersion():
fp.close() fp.close()
return match.group(1) return match.group(1)
def CopyModule():
"""Copy all the relevant module source files to rdiff_backup"""
moddir = DistDir+"/rdiff_backup"
os.system("rm -rf %s" % moddir)
os.mkdir(moddir)
for filename in ["cmodule.c", "connection.py", "destructive_stepping.py",
"FilenameMapping.py", "Globals.py", "Hardlink.py",
"highlevel.py", "increment.py", "__init__.py",
"iterfile.py", "lazy.py", "log.py", "Main.py",
"manage.py", "MiscStats.py", "Rdiff.py", "restore.py",
"rlist.py", "robust.py", "rorpiter.py", "rpath.py",
"seleciton.py", "SetConnections.py", "static.py",
"statistics.py", "Time.py"]:
assert not os.system("cp %s/%s %s" % (SourceDir, filename, moddir))
def CopyMan(destination, version): def CopyMan(destination, version):
"""Create updated man page at the specified location""" """Create updated man page at the specified location"""
fp = open(destination, "w") fp = open(destination, "w")
...@@ -93,7 +74,23 @@ def MakeTar(version): ...@@ -93,7 +74,23 @@ def MakeTar(version):
os.system("rm -rf " + tardir) os.system("rm -rf " + tardir)
except OSError: pass except OSError: pass
os.mkdir(tardir) os.mkdir(tardir)
for file in filelist: os.system("cp -a %s %s" % (file, tardir)) for filename in ["rdiff-backup", "CHANGELOG", "COPYING",
"README", "FAQ.html", SourceDir + "/cmodule.c",
DistDir + "/setup.py"]:
assert not os.system("cp %s %s" % (filename, tardir)), filename
os.mkdir(tardir+"/rdiff_backup")
for filename in ["connection.py", "destructive_stepping.py",
"FilenameMapping.py", "Globals.py", "Hardlink.py",
"highlevel.py", "increment.py", "__init__.py",
"iterfile.py", "lazy.py", "log.py", "Main.py",
"manage.py", "MiscStats.py", "Rdiff.py", "restore.py",
"rlist.py", "robust.py", "rorpiter.py", "rpath.py",
"selection.py", "SetConnections.py", "static.py",
"statistics.py", "Time.py"]:
assert not os.system("cp %s/%s %s/rdiff_backup" %
(SourceDir, filename, tardir)), filename
os.chmod(os.path.join(tardir, "setup.py"), 0755)
os.chmod(os.path.join(tardir, "rdiff-backup"), 0755) os.chmod(os.path.join(tardir, "rdiff-backup"), 0755)
CopyMan(os.path.join(tardir, "rdiff-backup.1"), version) CopyMan(os.path.join(tardir, "rdiff-backup.1"), version)
os.system("tar -cvzf %s %s" % (tarfile, tardir)) os.system("tar -cvzf %s %s" % (tarfile, tardir))
......
...@@ -6,7 +6,7 @@ SourceDir = "src" ...@@ -6,7 +6,7 @@ SourceDir = "src"
def GetVersion(): def GetVersion():
"""Return version string by reading in ./rdiff-backup""" """Return version string by reading in ./rdiff-backup"""
fp = open(SourceDir + "/rdiff-backup", "r") fp = open("rdiff-backup", "r")
match = re.search("Version (.*?) ", fp.read()) match = re.search("Version (.*?) ", fp.read())
fp.close() fp.close()
return match.group(1) return match.group(1)
...@@ -26,21 +26,14 @@ else: ...@@ -26,21 +26,14 @@ else:
base = ".".join(specfile.split(".")[:-1]) base = ".".join(specfile.split(".")[:-1])
srcrpm = base+".src.rpm" srcrpm = base+".src.rpm"
noarchrpm = base+".noarch.rpm" i386rpm = base+".i386.rpm"
source_rpm = base+".src.rpm"
tarfile = "-".join(base.split("-")[:-1]) + ".tar.gz" tarfile = "-".join(base.split("-")[:-1]) + ".tar.gz"
redhat_srcrpm = base+"rh7x.src.rpm" assert not os.system("install -o root -g root -m 644 %s "
redhat_noarchrpm = base+"rh7x.noarch.rpm" "/usr/src/redhat/SOURCES" % (tarfile,))
redhat_patch = "rdiff-backup-rh7x.patch" assert not os.system("rpm -ba --sign -vv --target i386 " + specfile)
redhat_specfile = "rdiff-backup-%s-1.rh7x.spec" % version assert not os.system("install -o ben -g ben -m 644 "
"/usr/src/redhat/RPMS/i386/%s ." % i386rpm)
#os.system("install -o root -g root -m 644 %s %s /usr/src/redhat/SOURCES" % assert not os.system("install -o ben -g ben -m 644 "
# (tarfile, redhat_patch)) "/usr/src/redhat/SRPMS/%s ." % source_rpm)
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("rpm -ba --sign -vv --target noarch.rh7x " + redhat
#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)
...@@ -6,7 +6,8 @@ Source: %{name}-%{version}.tar.gz ...@@ -6,7 +6,8 @@ Source: %{name}-%{version}.tar.gz
Copyright: GPL Copyright: GPL
Group: Applications/Archiving Group: Applications/Archiving
BuildRoot: %{_tmppath}/%{name}-root BuildRoot: %{_tmppath}/%{name}-root
requires: librsync, python >= 2.2 requires: librsync, python2 >= 2.2
BuildPrereq: python2-devel >= 2.2
%description %description
rdiff-backup is a script, written in Python, that backs up one rdiff-backup is a script, written in Python, that backs up one
...@@ -24,22 +25,20 @@ differences from the previous backup will be transmitted. ...@@ -24,22 +25,20 @@ differences from the previous backup will be transmitted.
%setup %setup
%build %build
./setup.py build
%install %install
rm -rf $RPM_BUILD_ROOT ./setup.py install --prefix=$RPM_BUILD_ROOT/usr
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 %clean
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%doc CHANGELOG COPYING README FAQ.html
/usr/lib/python2.2/site-packages/rdiff_backup
/usr/bin/rdiff-backup /usr/bin/rdiff-backup
/usr/share/man/man1/rdiff-backup.1.gz /usr/share/man/man1/rdiff-backup.1.gz
%doc CHANGELOG COPYING README FAQ.html
%changelog %changelog
* Sun Nov 4 2001 Ben Escoto <bescoto@stanford.edu> * Sun Nov 4 2001 Ben Escoto <bescoto@stanford.edu>
......
#!/usr/bin/env python #!/usr/bin/env python
import sys import sys, os, getopt
from distutils.core import setup, Extension from distutils.core import setup, Extension
version_string = "0.9.0"
if sys.version_info[:2] < (2,2): if sys.version_info[:2] < (2,2):
print "Sorry, rdiff-backup requires version 2.2 or later of python" print "Sorry, rdiff-backup requires version 2.2 or later of python"
sys.exit(1) sys.exit(1)
setup(name="rdiff-backup", setup(name="rdiff-backup",
version="0.9.0", version=version_string,
description="Local/remote mirroring+incremental backup", description="Local/remote mirroring+incremental backup",
author="Ben Escoto", author="Ben Escoto",
author_email="bescoto@stanford.edu", author_email="bescoto@stanford.edu",
...@@ -16,3 +19,24 @@ setup(name="rdiff-backup", ...@@ -16,3 +19,24 @@ setup(name="rdiff-backup",
packages = ['rdiff_backup'], packages = ['rdiff_backup'],
ext_modules=[Extension("rdiff_backup.C", ["cmodule.c"])]) ext_modules=[Extension("rdiff_backup.C", ["cmodule.c"])])
install = 0
prefix = "/usr"
for arg in sys.argv[1:]: # check for "install" and --prefix arg
if arg == "install": install = 1
elif arg.startswith("--prefix="):
prefix = arg[len("--prefix="):]
if install:
print "Copying rdiff-backup to %s/bin" % prefix
assert not os.system("install -D -m0755 rdiff-backup "
"%s/bin/rdiff-backup" % prefix)
print "Copying rdiff-backup.1 to %s/share/man/man1" % prefix
assert not os.system("install -D -m0644 rdiff-backup.1 "
"%s/share/man/man1/rdiff-backup" % prefix)
print ("Copying CHANGELOG, COPYING, README, and FAQ.html to "
"%s/share/doc/rdiff-backup-%s" % (prefix, version_string))
assert not os.system("install -d %s/share/doc/rdiff-backup-%s" %
(prefix, version_string))
assert not os.system("install -m0644 CHANGELOG COPYING README FAQ.html "
"%s/share/doc/rdiff-backup-%s" %
(prefix, version_string))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment