Commit f7a6f269 authored by ben's avatar ben

Thought about making separate redhat 7.x RPMs, now I don't think I'll bother


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@38 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 1383ebf1
...@@ -10,7 +10,7 @@ filelist = [SourceDir + "/rdiff-backup", "CHANGELOG", ...@@ -10,7 +10,7 @@ filelist = [SourceDir + "/rdiff-backup", "CHANGELOG",
# 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.
spec_template = "dist/rdiff-backup.spec" spec_template = "dist/rdiff-backup.spec"
redhat_spec_template = "dist/rdiff-backup.rh7x.spec"
def GetVersion(): def GetVersion():
"""Return version string by reading in ./rdiff-backup""" """Return version string by reading in ./rdiff-backup"""
...@@ -51,14 +51,20 @@ def MakeTar(version): ...@@ -51,14 +51,20 @@ def MakeTar(version):
def MakeSpecFile(version): def MakeSpecFile(version):
"""Create spec file using spec template""" """Create spec file using spec template"""
specfile = "rdiff-backup-%s-1.spec" % version def helper(spec_template, specfile):
"""Added now that there are special redhat rpms"""
outfp = open(specfile, "w") outfp = open(specfile, "w")
outfp.write("Version: %s\n" % version) outfp.write("Version: %s\n" % version)
infp = open(spec_template, "r") infp = open(spec_template, "r")
outfp.write(infp.read()) outfp.write(infp.read())
infp.close() infp.close()
outfp.close() outfp.close()
return specfile
specfile = "rdiff-backup-%s-1.spec" % version
redhat_specfile = "rdiff-backup-%s-1.rh7x.spec" % version
helper(spec_template, specfile)
helper(redhat_spec_template, redhat_specfile)
return (specfile, redhat_specfile)
def Main(): def Main():
cwd = os.getcwd() cwd = os.getcwd()
...@@ -69,8 +75,8 @@ def Main(): ...@@ -69,8 +75,8 @@ def Main():
print "Processing version " + version print "Processing version " + version
tarfile = MakeTar(version) tarfile = MakeTar(version)
print "Made tar file " + tarfile print "Made tar file " + tarfile
specfile = MakeSpecFile(version) specfiles = MakeSpecFile(version)
print "Made specfile " + specfile print "Made specfiles %s and %s" % specfiles
if __name__ == "__main__": Main() if __name__ == "__main__": Main()
...@@ -13,7 +13,8 @@ def GetVersion(): ...@@ -13,7 +13,8 @@ def GetVersion():
if len(sys.argv) == 1: if len(sys.argv) == 1:
specfile = "rdiff-backup-%s-1.spec" % GetVersion() version = GetVersion()
specfile = "rdiff-backup-%s-1.spec" % version
print "Using specfile %s" % specfile print "Using specfile %s" % specfile
elif len(sys.argv) == 2: elif len(sys.argv) == 2:
specfile = sys.argv[1] specfile = sys.argv[1]
...@@ -28,9 +29,16 @@ srcrpm = base+".src.rpm" ...@@ -28,9 +29,16 @@ srcrpm = base+".src.rpm"
noarchrpm = base+".noarch.rpm" noarchrpm = base+".noarch.rpm"
tarfile = "-".join(base.split("-")[:-1]) + ".tar.gz" tarfile = "-".join(base.split("-")[:-1]) + ".tar.gz"
os.system("install -o root -g root -m 644 %s /usr/src/redhat/SOURCES" % redhat_srcrpm = base+"rh7x.src.rpm"
tarfile) redhat_noarchrpm = base+"rh7x.noarch.rpm"
redhat_patch = "rdiff-backup-rh7x.patch"
redhat_specfile = "rdiff-backup-%s-1.rh7x.spec" % version
os.system("install -o root -g root -m 644 %s %s /usr/src/redhat/SOURCES" %
tarfile, redhat_patch)
os.system("rpm -ba --sign -vv --target noarch " + specfile) 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/SRPMS/%s ." % srcrpm)
os.system("install -o ben -g ben -m 644 /usr/src/redhat/RPMS/noarch/%s ." % os.system("install -o ben -g ben -m 644 /usr/src/redhat/RPMS/noarch/%s ." %
noarchrpm) noarchrpm)
...@@ -7,6 +7,7 @@ Copyright: GPL ...@@ -7,6 +7,7 @@ Copyright: GPL
Group: Applications/Archiving Group: Applications/Archiving
BuildRoot: %{_tmppath}/%{name}-root BuildRoot: %{_tmppath}/%{name}-root
requires: librsync, python2 >= 2.2 requires: librsync, python2 >= 2.2
Patch: rdiff-backup-rh7x.patch
%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
...@@ -22,7 +23,7 @@ differences from the previous backup will be transmitted. ...@@ -22,7 +23,7 @@ differences from the previous backup will be transmitted.
%prep %prep
%setup %setup
%patch
%build %build
%install %install
...@@ -42,6 +43,8 @@ install -m 644 rdiff-backup.1 $RPM_BUILD_ROOT/usr/share/man/man1/rdiff-backup.1 ...@@ -42,6 +43,8 @@ install -m 644 rdiff-backup.1 $RPM_BUILD_ROOT/usr/share/man/man1/rdiff-backup.1
%doc CHANGELOG COPYING README FAQ.html %doc CHANGELOG COPYING README FAQ.html
%changelog %changelog
* Sat Apr 6 2002 Ben Escoto <bescoto@stanford.edu>
- Made new version for Redhat 7.x series
* Sun Nov 4 2001 Ben Escoto <bescoto@stanford.edu> * Sun Nov 4 2001 Ben Escoto <bescoto@stanford.edu>
- Initial RPM - Initial RPM
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