]> thyrsus.com Git - comparator.git/commitdiff
Improved packaging.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 29 Dec 2003 07:47:53 +0000 (07:47 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 29 Dec 2003 07:47:53 +0000 (07:47 +0000)
Makefile
comparator.py
comparator.spec

index f83fe8e708ea9132e34a87599dfaba5ec27d8953..ff72402ffbf6188c4c17b0760568a773d7e04387 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
 # By building with -DLARGEFILES you can go to all 32-byte offsets.
 # This increases working-set size by 20% but handles > 65336 lines per file.
 
-VERS=2.2
+VERS=$(shell sed <comparator.spec -n -e '/Version: \(.*\)/s//\1/p')
 
 CODE    = shredtree.c shred.h report.c hash.c linebyline.c main.c \
                hash.h hashtab.h normalizer.c \
index 805d26ce621ae38d4e0f2ed895716885833121f7..77f6b705ba0776e82b1d033273414ea9b2a9a7c9 100644 (file)
@@ -6,7 +6,7 @@ class ComparatorException(exceptions.Exception):
         self.retval = retval
 
 class CommonReport:
-    "Capture the state of common-segnent report."
+    "Capture the state of a common-segment report."
     # Template for parsing the output from comparator.
     shredline = re.compile("(.*):([0-9]+):([0-9]+):([0-9]+)")
 
@@ -103,7 +103,7 @@ class CommonReport:
                 rfp.close()
                 break
             except IOError:
-                pass
+                raise ComparatorException("no such file as %s" % file)
         if self.dir:
             os.chdir(olddir)
         return (file, start, end, text)
index 352d8d080862da849790c934f4de7c991b8a4029..dd83050dd85e8cc7e5578685fa49e57d899da64b 100644 (file)
@@ -1,13 +1,12 @@
-Summary: fast comparison of large source-code trees
 Name: comparator
-Version: %{myversion}
+Summary: fast comparison of large source-code trees
+Version: 2.3
 Release: 1
 License: GPL
 Group: Utilities
 URL: http://www.catb.org/~esr/comparator/
 Source0: %{name}-%{version}.tar.gz
-#BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
-%undefine __check_files
+BuildRoot: %{_tmppath}/%{name}-root
 
 %description
 comparator and filterator are a pair of tools for rapidly finding common
@@ -19,25 +18,36 @@ detecting copyright infringement.
 
 %build
 make
+make comparator.1
 
 %install
-rm -rf $RPM_BUILD_ROOT
-make install
+[ "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT"
+mkdir -p "$RPM_BUILD_ROOT"/usr/bin
+mkdir -p "$RPM_BUILD_ROOT"/usr/share/man/man1/
+pylib=`ls -d /usr/local/lib/python*/site-packages/`
+mkdir -p "$RPM_BUILD_ROOT"${pylib}
+cp comparator filterator "$RPM_BUILD_ROOT"/usr/bin
+cp comparator.1 "$RPM_BUILD_ROOT"/usr/share/man/man1/
+cp comparator.py "$RPM_BUILD_ROOT"${pylib}
 
 %clean
-rm -rf $RPM_BUILD_ROOT
-make uninstall
+[ "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT"
 
 %files
 %defattr(-,root,root,-)
-%doc README comparator.1
-/usr/bin/comparator
-/usr/bin/filterator
-/usr/share/man/man1/comparator.1*
+%doc README COPYING
+%{_bindir}/comparator
+%{_bindir}/filterator
+%{_mandir}/man1/comparator.1*
 /usr/local/lib/python*/site-packages/comparator.py
-/usr/local/lib/python*/site-packages/comparator.pyc
 
 %changelog
+* Mon Dec 29 2003 Eric S. Raymond <esr@snark.thyrsus.com> 2.3-1
+- Source RPMs no longer depend on myversion symbol.
+
+* Wed Dec 24 2003 Eric S. Raymond <esr@snark.thyrsus.com> 2.2-1
+- Better error reporting in comparator.py.
+
 * Sun Sep  7 2003 Eric S. Raymond <esr@snark.thyrsus.com> 
 - Initial build.