summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-09-12 02:47:38 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-09-12 02:47:38 +0000
commit8195a11884a64a4959724142bf6e45fa64ff634c (patch)
treea75ac7d8cd581cf526bb97ced426af66159530ff
parent153d8271ec3c3b9d7b5aacb6f01edff9e10ca13e (diff)
downloadrdiff-backup-8195a11884a64a4959724142bf6e45fa64ff634c.tar.gz
Now build both Fedora and ordinary rpms
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@427 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rwxr-xr-xrdiff-backup/dist/makedist11
-rwxr-xr-xrdiff-backup/dist/makerpm16
-rw-r--r--rdiff-backup/dist/rdiff-backup.spec.template23
3 files changed, 34 insertions, 16 deletions
diff --git a/rdiff-backup/dist/makedist b/rdiff-backup/dist/makedist
index 9f41a90..93375ab 100755
--- a/rdiff-backup/dist/makedist
+++ b/rdiff-backup/dist/makedist
@@ -8,6 +8,8 @@ DistDir = "dist"
# Various details about the files must also be specified by the rpm
# spec template.
spec_template = "dist/rdiff-backup.spec.template"
+# The Fedora distribution has its own spec template
+fedora_spec_template = "dist/rdiff-backup.spec.template-fedora"
def CopyMan(destination, version):
"""Create updated man page at the specified location"""
@@ -132,9 +134,10 @@ def MakeTar():
def MakeSpecFile():
"""Create spec file using spec template"""
- specfile = "rdiff-backup.spec"
+ specfile, fedora_specfile= "rdiff-backup.spec", "rdiff-backup.spec-fedora"
VersionedCopy(spec_template, specfile)
- return specfile
+ VersionedCopy(fedora_spec_template, fedora_specfile)
+ return specfile, fedora_specfile
def parse_cmdline(arglist):
"""Returns action"""
@@ -163,8 +166,8 @@ def Main():
print "Processing version " + Version
tarfile = MakeTar()
print "Made tar file " + tarfile
- specfile = MakeSpecFile()
- print "Made specfile ", specfile
+ specfiles = MakeSpecFile()
+ print "Made specfiles ", specfiles
if __name__ == "__main__" and not globals().has_key('__no_execute__'):
diff --git a/rdiff-backup/dist/makerpm b/rdiff-backup/dist/makerpm
index bf5fbee..f67a490 100755
--- a/rdiff-backup/dist/makerpm
+++ b/rdiff-backup/dist/makerpm
@@ -1,4 +1,7 @@
#!/usr/bin/env python
+#
+# Builds two rpms, one for generic release, and the other for the
+# Fedora project.
import os, sys
@@ -7,22 +10,29 @@ rpmroot = os.path.join(os.environ['HOME'], 'rpm')
if len(sys.argv) == 2:
Version = sys.argv[1]
specfile = "rdiff-backup.spec"
- print "Using specfile %s" % specfile
+ fedora_specfile = "rdiff-backup.spec-fedora"
+ print "Using specfiles %s, %s" % (specfile, fedora_specfile)
else:
print "Syntax: %s version_number" % sys.argv[0]
sys.exit(1)
base = "rdiff-backup-%s" % (Version,)
tarfile = base + ".tar.gz"
-rpmbase = base + "-0.fdr.4" # Fedora suffix, with release number 4
+rpmbase = base + "-1"
i386_rpm = rpmbase + ".i386.rpm"
source_rpm = rpmbase + ".src.rpm"
+fedora_rpmbase = base + "-0.fdr.1"
+fedora_i386_rpm = fedora_rpmbase + ".i386.rpm"
+fedora_source_rpm = fedora_rpmbase + ".src.rpm"
+
# These assume the rpm root directory $HOME/rpm. The
# nonstandard location allows for building by non-root user.
assert not os.system("cp %s %s/SOURCES" % (tarfile, rpmroot))
-#assert not os.system("rpm -ba --sign -vv --target i386 " + specfile)
assert not os.system("rpmbuild -ba -v --sign " + specfile)
assert not os.system("mv %s/RPMS/i386/%s ." % (rpmroot, i386_rpm))
assert not os.system("mv %s/SRPMS/%s ." % (rpmroot, source_rpm))
+assert not os.system("rpmbuild -ba -v --sign " + fedora_specfile)
+assert not os.system("mv %s/RPMS/i386/%s ." % (rpmroot, fedora_i386_rpm))
+assert not os.system("mv %s/SRPMS/%s ." % (rpmroot, fedora_source_rpm))
diff --git a/rdiff-backup/dist/rdiff-backup.spec.template b/rdiff-backup/dist/rdiff-backup.spec.template
index 28cbf51..c0c2d96 100644
--- a/rdiff-backup/dist/rdiff-backup.spec.template
+++ b/rdiff-backup/dist/rdiff-backup.spec.template
@@ -1,17 +1,18 @@
-%define PYTHON_NAME %((rpm -q --quiet python2 && echo python2) || echo python)
+%define PYTHON_VERSION %(python -c 'import sys; sys.stdout.write(".".join(map(str,sys.version_info[:2])))')
+%define NEXT_PYTHON_VERSION %(python -c 'import sys; sys.stdout.write(str(sys.version_info[0])); sys.stdout.write("."); sys.stdout.write(str(sys.version_info[1]+1))')
Version: $version
Summary: Convenient and transparent local/remote incremental mirror/backup
Name: rdiff-backup
-Release: 0.fdr.3
+Release: 1
Epoch: 0
URL: http://rdiff-backup.stanford.edu/
Source: http://rdiff-backup.stanford.edu/OLD/%{version}/%{name}-%{version}.tar.gz
License: GPL
Group: Applications/Archiving
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Requires: librsync >= 0.9.6, %{PYTHON_NAME} >= 2.2
-BuildPrereq: %{PYTHON_NAME}-devel >= 2.2, librsync-devel >= 0.9.6
+Requires: python >= %{PYTHON_VERSION}, python < %{NEXT_PYTHON_VERSION}
+BuildPrereq: python-devel >= 2.2, librsync-devel >= 0.9.6
%description
rdiff-backup is a script, written in Python, that backs up one
@@ -29,22 +30,26 @@ differences from the previous backup will be transmitted.
%setup -q
%build
-%{PYTHON_NAME} setup.py build
+python setup.py build
%install
-%{PYTHON_NAME} setup.py install --prefix=$RPM_BUILD_ROOT/usr
+python setup.py install --root $RPM_BUILD_ROOT
%clean
-[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%{_bindir}/rdiff-backup
%{_mandir}/man1/rdiff-backup*
-%{_libdir}/
-%doc CHANGELOG COPYING FAQ.html README
+%{_libdir}/python%{PYTHON_VERSION}/site-packages/rdiff_backup
+%doc CHANGELOG COPYING FAQ.html examples.html README
%changelog
+* Thu Sep 11 2003 Ben Escoto <bescoto@stanford.edu> - 0.12.4-1
+- Removed code that selected between python2 and python; I think
+ everyone calls it python now.
+
* Thu Aug 8 2003 Ben Escoto <bescoto@stanford.edu>
- Set librsync >= 0.9.6, because rsync.h renamed to librsync.h