summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-09-12 02:52:21 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-09-12 02:52:21 +0000
commit363e3b267f7bc8d63c50ea7c76560ee3ff5d6960 (patch)
tree402155cc4d3fe2dfbef7e33a1b38c287e0122e98
parent8111704fa1329566b31561a06e0c49d8bfd8e715 (diff)
downloadrdiff-backup-363e3b267f7bc8d63c50ea7c76560ee3ff5d6960.tar.gz
Now build both regular and Fedora rpms
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/branches/r0-12@430 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rwxr-xr-xrdiff-backup/dist/makedist13
-rwxr-xr-xrdiff-backup/dist/makerpm15
-rw-r--r--rdiff-backup/dist/rdiff-backup.spec.template23
3 files changed, 33 insertions, 18 deletions
diff --git a/rdiff-backup/dist/makedist b/rdiff-backup/dist/makedist
index 3016abf..0ac5d80 100755
--- a/rdiff-backup/dist/makedist
+++ b/rdiff-backup/dist/makedist
@@ -8,7 +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"
-#redhat_spec_template = "dist/rdiff-backup.rh7x.spec"
+# 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"""
@@ -121,10 +122,10 @@ def MakeTar():
def MakeSpecFile():
"""Create spec file using spec template"""
- #specfile = "rdiff-backup-%s-2.spec" % Version
- specfile = "rdiff-backup.spec" # Fedora standard name
+ 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"""
@@ -153,8 +154,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 29fd415..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,23 +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.3" # Fedora suffix, with release number 1
+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