diff --git a/README.md b/README.md index cba2952..8f852e5 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ # rcs +The Revision Control System (RCS) manages multiple revisions of files. +RCS automates the storing, retrieval, logging, identification, and merging of revisions. RCS is useful for text that is revised frequently, +including source code, programs, documentation, graphics, papers, and form letters. + diff --git a/rcs-5.7-DESTDIR.patch b/rcs-5.7-DESTDIR.patch new file mode 100644 index 0000000..b02c7ea --- /dev/null +++ b/rcs-5.7-DESTDIR.patch @@ -0,0 +1,44 @@ +diff -up rcs-5.7/man/Makefile.in~ rcs-5.7/man/Makefile.in +--- rcs-5.7/man/Makefile.in~ 2009-06-23 00:06:19.000000000 +0300 ++++ rcs-5.7/man/Makefile.in 2009-06-23 00:08:06.000000000 +0300 +@@ -49,17 +49,17 @@ rcsfile.5 : rcsfile.5in + check dvi info TAGS :: + + installdirs :: ../mkinstalldirs +- -$(srcdir)/../mkinstalldirs $(man1dir) $(man5dir) ++ -$(srcdir)/../mkinstalldirs $(DESTDIR)$(man1dir) $(DESTDIR)$(man5dir) + + man1pages = ci co ident merge rcs rcsclean rcsdiff rcsintro rcsmerge rlog \ + rcsfreeze + + install :: installdirs + -for m in $(man1pages); do \ +- $(INSTALL_DATA) $(srcdir)/$$m.1 $(man1dir)/$$m$(man1ext); \ ++ $(INSTALL_DATA) $(srcdir)/$$m.1 $(DESTDIR)$(man1dir)/$$m$(man1ext); \ + done + -{ test -f rcsfile.5 || cd $(srcdir); } && \ +- $(INSTALL_DATA) rcsfile.5 $(man5dir)/rcsfile$(man5ext) ++ $(INSTALL_DATA) rcsfile.5 $(DESTDIR)$(man5dir)/rcsfile$(man5ext) + + uninstall :: + for m in $(man1pages); do \ +diff -up rcs-5.7/src/Makefile.in~ rcs-5.7/src/Makefile.in +--- rcs-5.7/src/Makefile.in~ 2009-06-23 00:06:19.000000000 +0300 ++++ rcs-5.7/src/Makefile.in 2009-06-23 00:07:29.000000000 +0300 +@@ -110,13 +110,13 @@ all :: $(PROGRAMS) + $(CC) -c $(ALL_CFLAGS) $< + + installdirs :: ../mkinstalldirs +- $(srcdir)/../mkinstalldirs $(bindir) ++ $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir) + + install :: all installdirs + for p in $(PROGRAMS); do \ +- $(INSTALL_PROGRAM) $$p $(bindir)/$$p; \ ++ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \ + done +- $(INSTALL_PROGRAM) rcsfreeze.sh $(bindir)/rcsfreeze ++ $(INSTALL_PROGRAM) rcsfreeze.sh $(DESTDIR)$(bindir)/rcsfreeze + + uninstall :: + for p in $(PROGRAMS); do \ diff --git a/rcs-5.7-build-tweaks.patch b/rcs-5.7-build-tweaks.patch new file mode 100644 index 0000000..1e18996 --- /dev/null +++ b/rcs-5.7-build-tweaks.patch @@ -0,0 +1,114 @@ +From 2a814cf24019073a05f64c306a39b3202efe40ab Mon Sep 17 00:00:00 2001 +From: Romain Francoise +Date: Sun, 23 Mar 2008 00:57:09 +0100 +Subject: [PATCH] Various build tweaks + +Including: +- allow building as root +- install rcsfreeze and its man page +- pass CFLAGS properly +- install man pages in /usr/share/man +- tweak default PATH when looking for sendmail +--- + configure.in | 2 +- + man/Makefile.in | 7 ++++--- + src/Makefile.in | 6 ++++-- + src/conf.sh | 11 ----------- + 4 files changed, 9 insertions(+), 17 deletions(-) + +diff --git a/configure.in b/configure.in +index b6dd5d2..3c6aed3 100644 +--- a/configure.in ++++ b/configure.in +@@ -243,7 +243,7 @@ rm -f conftest* + AC_PATH_PROG(ED, ed, ed) + + ac_save_path=$PATH +-PATH=/usr/lib:/usr/bin:/bin:/usr/sbin:/sbin:$PATH ++PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/lib:$PATH + AC_PATH_PROGS(SENDMAIL, sendmail mail mailx) + PATH=$ac_save_path + case $SENDMAIL in +diff --git a/man/Makefile.in b/man/Makefile.in +index 8ff25df..ffc8c7c 100644 +--- a/man/Makefile.in ++++ b/man/Makefile.in +@@ -34,8 +34,8 @@ INSTALL_DATA = @INSTALL_DATA@ + PIC = @PIC@ + + prefix = @prefix@ +-man1dir = $(prefix)/man/man1 +-man5dir = $(prefix)/man/man5 ++man1dir = $(prefix)/share/man/man1 ++man5dir = $(prefix)/share/man/man5 + man1ext = .1 + man5ext = .5 + +@@ -51,7 +51,8 @@ check dvi info TAGS :: + installdirs :: ../mkinstalldirs + -$(srcdir)/../mkinstalldirs $(man1dir) $(man5dir) + +-man1pages = ci co ident merge rcs rcsclean rcsdiff rcsintro rcsmerge rlog ++man1pages = ci co ident merge rcs rcsclean rcsdiff rcsintro rcsmerge rlog \ ++ rcsfreeze + + install :: installdirs + -for m in $(man1pages); do \ +diff --git a/src/Makefile.in b/src/Makefile.in +index c27af21..5bc2147 100644 +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -116,16 +116,18 @@ install :: all installdirs + for p in $(PROGRAMS); do \ + $(INSTALL_PROGRAM) $$p $(bindir)/$$p; \ + done ++ $(INSTALL_PROGRAM) rcsfreeze.sh $(bindir)/rcsfreeze + + uninstall :: + for p in $(PROGRAMS); do \ + $(REMOVE) $(bindir)/$$p; \ + done ++ $(REMOVE) $(bindir)/rcsfreeze + + # Install RCS and (if applicable) GNU diff before running these tests. + # To test RCS before installing it, see the file INSTALL.RCS. + RCSTEST = \ +- ALL_CFLAGS='$(ALL_CFLAGS)' CC='$(CC)' DIFF='$(DIFF)' \ ++ ALL_CFLAGS="$(ALL_CFLAGS)" CC='$(CC)' DIFF='$(DIFF)' \ + LDFLAGS='$(LDFLAGS)' LIBS='$(LIBS)' \ + PATH=$(bindir):$$PATH \ + sh $(srcdir)/rcstest +@@ -153,7 +155,7 @@ maintainer-clean :: distclean + #(Unix + conf.h : conf.sh Makefile + $(REMOVE) a.* +- ALL_CFLAGS='$(ALL_CFLAGS)' \ ++ ALL_CFLAGS="$(ALL_CFLAGS)" \ + CC='$(CC)' \ + COMPAT2='$(COMPAT2)' \ + DIFF3='$(DIFF3)' DIFF3_BIN='$(DIFF3_BIN)' \ +diff --git a/src/conf.sh b/src/conf.sh +index c9bf0b3..b28a504 100644 +--- a/src/conf.sh ++++ b/src/conf.sh +@@ -73,17 +73,6 @@ case `echo -n` in + ech='echo -n' dots='... ' + esac + +-$ech >&3 "$0: testing permissions $dots" +-rm -f a.d && +-date >a.d && +-chmod 0 a.d && +-{ test -w a.d || cp /dev/null a.d 2>/dev/null; } && { +- echo >&3 "$n$0: This command should not be run with superuser permissions." +- exit 1 +-} +-echo >&3 OK +-rm -f a.d || exit +- + $ech >&3 "$0: testing compiler for plausibility $dots" + echo 'main() { return 0; }' >a.c + rm -f a.exe a.out || exit +-- +1.6.3.2.306.g4f4fa + diff --git a/rcs-5.7-newsvnsyntax.patch b/rcs-5.7-newsvnsyntax.patch new file mode 100644 index 0000000..71229bd --- /dev/null +++ b/rcs-5.7-newsvnsyntax.patch @@ -0,0 +1,37 @@ +diff -rup rcs-5.7/src/ident.c rcs-5.7mzk/src/ident.c +--- rcs-5.7/src/ident.c 1995-06-16 08:19:24.000000000 +0200 ++++ rcs-5.7mzk/src/ident.c 2007-07-17 15:23:15.000000000 +0200 +@@ -228,12 +228,18 @@ match(fp) /* group substring between t + char line[BUFSIZ]; + register int c; + register char * tp; ++ int COLON_C = 0; ++ int MAX_COLON = 1; + + tp = line; +- while ((c = getc(fp)) != VDELIM) { ++ while ((c = getc(fp)) && (COLON_C < MAX_COLON)) { + if (c == EOF && feof(fp) | ferror(fp)) + return c; + switch (ctab[c]) { ++ case COLON: ++ *tp++ = c; ++ COLON_C++; ++ break; + case LETTER: case Letter: + *tp++ = c; + if (tp < line+sizeof(line)-4) +@@ -245,7 +251,12 @@ match(fp) /* group substring between t + } + if (tp == line) + return c; +- *tp++ = c; ++ if(c == ' '){ ++ ungetc(c,fp); ++ } ++ else{ ++ *tp++ = c; ++ } + if ((c = getc(fp)) != ' ') + return c ? c : '\n'; + *tp++ = c; diff --git a/rcs-5.7-option.patch b/rcs-5.7-option.patch new file mode 100644 index 0000000..0804939 --- /dev/null +++ b/rcs-5.7-option.patch @@ -0,0 +1,11 @@ +--- rcs-5.7/src/rcsdiff.c.option 1995-06-16 08:19:24.000000000 +0200 ++++ rcs-5.7/src/rcsdiff.c 2005-10-10 15:10:49.000000000 +0200 +@@ -239,7 +239,7 @@ + case '5': case '6': case '7': case '8': case '9': + case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': + case 'h': case 'i': case 'n': case 'p': +- case 't': case 'u': case 'w': ++ case 't': case 'u': case 'U': case 'w': + *dcp++ = c; + break; + case 'q': diff --git a/rcs-5.7-sameuserlocks.patch b/rcs-5.7-sameuserlocks.patch new file mode 100644 index 0000000..cc6f96f --- /dev/null +++ b/rcs-5.7-sameuserlocks.patch @@ -0,0 +1,124 @@ +--- rcs-5.7/man/co.1.orig 2003-10-24 13:56:53.000000000 -0400 ++++ rcs-5.7/man/co.1 2003-10-24 13:59:22.000000000 -0400 +@@ -324,6 +324,10 @@ + retrieves the latest revision on the selected branch whose state is set to + .IR state . + .TP ++.BI \-S ++Turns on same user locks. When this is enabled the user cannot check out ++the same file twice. ++.TP + .B \-T + Preserve the modification time on the \*r file + even if the \*r file changes because a lock is added or removed. +--- rcs-5.7/src/rcsedit.c.orig 2003-10-24 12:34:57.000000000 -0400 ++++ rcs-5.7/src/rcsedit.c 2003-10-24 13:51:14.000000000 -0400 +@@ -1708,9 +1708,10 @@ + } + + int +-addlock(delta, verbose) ++addlock(delta, verbose, sameuserlocks) + struct hshentry * delta; + int verbose; ++ int sameuserlocks; + /* + * Add a lock held by caller to DELTA and yield 1 if successful. + * Print an error message if verbose and yield -1 if no lock is added because +@@ -1722,9 +1723,10 @@ + + for (next = Locks; next; next = next->nextlock) + if (cmpnum(delta->num, next->delta->num) == 0) +- if (strcmp(getcaller(), next->login) == 0) ++ if (strcmp(getcaller(), next->login) == 0 && !sameuserlocks) + return 0; +- else { ++ else { ++ + if (verbose) + rcserror("Revision %s is already locked by %s.", + delta->num, next->login +--- rcs-5.7/src/ci.c.orig 2003-10-24 12:53:05.000000000 -0400 ++++ rcs-5.7/src/ci.c 2003-10-24 13:50:36.000000000 -0400 +@@ -566,7 +566,7 @@ + } + + +- if (lockflag && addlock(&newdelta, true) < 0) continue; ++ if (lockflag && addlock(&newdelta, true, false) < 0) continue; + + if (keepflag && *prevname.string) + if (addsymbol(newdelta.num, prevname.string, false) < 0) +--- rcs-5.7/src/rcsbase.h.orig 2003-10-24 12:55:50.000000000 -0400 ++++ rcs-5.7/src/rcsbase.h 2003-10-24 12:56:06.000000000 -0400 +@@ -454,7 +454,7 @@ + RILE *rcswriteopen P((struct buf*,struct stat*,int)); + char const *makedirtemp P((int)); + char const *getcaller P((void)); +-int addlock P((struct hshentry*,int)); ++int addlock P((struct hshentry*,int,int)); + int addsymbol P((char const*,char const*,int)); + int checkaccesslist P((void)); + int chnamemod P((FILE**,char const*,char const*,int,mode_t,time_t)); +--- rcs-5.7/src/co.c.orig 2003-10-24 13:20:49.000000000 -0400 ++++ rcs-5.7/src/co.c 2003-10-24 13:49:20.000000000 -0400 +@@ -203,6 +203,7 @@ + int changelock; /* 1 if a lock has been changed, -1 if error */ + int expmode, r, tostdout, workstatstat; + int Ttimeflag; ++ int sameuserlocks; + struct buf numericrev; /* expanded revision number */ + char finaldate[datesize]; + # if OPEN_O_BINARY +@@ -217,6 +218,7 @@ + suffixes = X_DEFAULT; + tostdout = false; + Ttimeflag = false; ++ sameuserlocks = false; + + argc = getRCSINIT(argc, argv, &newargv); + argv = newargv; +@@ -286,12 +288,20 @@ + } + break; + ++ case 'S': ++ /* ++ * Enable strict locks (i.e. even the same user cannot ++ * re-check out a file with a lock that he owns. ++ */ ++ sameuserlocks = true; ++ break; ++ + case 'T': + if (*a) + goto unknown; + Ttimeflag = true; + break; +- ++ + case 'w': + if (author) redefined('w'); + if (*a) +@@ -417,7 +427,7 @@ + : lockflag == 0 ? + 0 + : +- addlock(targetdelta, true); ++ addlock(targetdelta, true, sameuserlocks); + + if ( + changelock < 0 +--- rcs-5.7/src/rcs.c.orig 2003-10-24 13:51:39.000000000 -0400 ++++ rcs-5.7/src/rcs.c 2003-10-24 13:53:39.000000000 -0400 +@@ -1437,8 +1437,8 @@ + numrev.string + ); + else { +- if ((r = addlock(target, false)) < 0 && breaklock(target)) +- r = addlock(target, true); ++ if ((r = addlock(target, false, false)) < 0 && breaklock(target)) ++ r = addlock(target, true, false); + if (0 <= r) { + if (r) + diagnose("%s locked\n", target->num); diff --git a/rcs-5.7-security.patch b/rcs-5.7-security.patch new file mode 100644 index 0000000..6091abe --- /dev/null +++ b/rcs-5.7-security.patch @@ -0,0 +1,64 @@ +--- rcs-5.7/src/rcsfnms.c.security Fri Jun 16 08:19:24 1995 ++++ rcs-5.7/src/rcsfnms.c Fri Jan 5 10:00:21 2001 +@@ -258,19 +258,57 @@ + }; + + #if has_mktemp ++static char tmppath[1024]; ++ ++ static void ++tmpcleanup() ++{ ++ /* For now, assume that all temp files get ++ * removed before we are invoked */ ++ rmdir(tmppath); ++} ++ + static char const *tmp P((void)); + static char const * + tmp() + /* Yield the name of the tmp directory. */ + { +- static char const *s; +- if (!s +- && !(s = cgetenv("TMPDIR")) /* Unix tradition */ ++ const char *s; ++ ++ if (tmppath[0]) ++ return tmppath; ++ ++ if (!(s = cgetenv("TMPDIR")) /* Unix tradition */ + && !(s = cgetenv("TMP")) /* DOS tradition */ + && !(s = cgetenv("TEMP")) /* another DOS tradition */ + ) + s = TMPDIR; +- return s; ++ ++ if (strlen(s) > sizeof(tmppath) - 11) ++ s = TMPDIR; ++ ++#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 2) ++ snprintf(tmppath, sizeof(tmppath), "%s/rcsXXXXXX", s); ++ if (!mkdtemp(tmppath) || !tmppath[0]) ++ goto failed; ++#else ++ while (1) { ++ snprintf(tmppath, sizeof(tmppath), "%s/rcsXXXXXX", s); ++ if (!mktemp(tmppath) || !tmppath[0]) ++ goto failed; ++ if (mkdir(tmppath, 0700) >= 0) ++ break; ++ if (errno != EEXIST) ++ goto failed; ++ } ++#endif ++ ++ atexit(tmpcleanup); ++ return tmppath; ++ ++failed: ++ perror("Unable to create temp directory"); ++ exit(123); + } + #endif + diff --git a/rcs.spec b/rcs.spec new file mode 100644 index 0000000..dc1e216 --- /dev/null +++ b/rcs.spec @@ -0,0 +1,118 @@ +Name: rcs +Version: 5.9.2 +Release: 1mamba +Summary: The GNU Revision Control System (RCS) file version management tools +Group: Development/Tools +Vendor: openmamba +Distribution: openmamba +Packager: Automatic Build System +URL: http://www.gnu.org/software/rcs/ +Source: ftp://ftp.gnu.org/gnu/rcs/rcs-%{version}.tar.xz +Patch0: rcs-5.7-build-tweaks.patch +Patch1: rcs-5.7-security.patch +Patch2: rcs-5.7-sameuserlocks.patch +Patch3: rcs-5.7-option.patch +Patch4: rcs-5.7-newsvnsyntax.patch +Patch5: rcs-5.7-DESTDIR.patch +License: GPL +BuildRequires: autoconf +BuildRequires: ed +BuildRequires: groff +BuildRequires: ghostscript +# TODO BuildRequires: sendmail +Requires: diffutils +Requires(post):%{__install_info} +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +The Revision Control System (RCS) manages multiple revisions of files. +RCS automates the storing, retrieval, logging, identification, and merging of revisions. RCS is useful for text that is revised frequently, +including source code, programs, documentation, graphics, papers, and form letters. + +%prep +%setup -q +#%patch0 -p1 +#%patch1 -p1 +#%patch2 -p1 +#%patch3 -p1 +#%patch4 -p1 +#%patch5 -p1 +#autoconf + +# https://lists.gnu.org/archive/html/grub-devel/2012-07/msg00051.html +sed -i -e '/gets is a security/d' lib/stdio.in.h + +%build +%configure \ + --with-diffutils +%make + +for f in rcs rcs_func ; do + groff -p -Tps -ms $f.ms | ps2pdf - $f.pdf +done + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%makeinstall + +#% check +##sed -i -e 's|"%{_bindir}/co"|"co"|' src/conf.h +#%make -C src +#PATH="`pwd`/src:${PATH}" make installdebug +##sed -i -e 's|"co"|"%{_bindir}/co"|' src/conf.h + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post +%install_info %{name} +exit 0 + +%preun +%uninstall_info %{name} +exit 0 + +%files +%defattr(-,root,root) +%{_bindir}/ci +%{_bindir}/co +%{_bindir}/ident +%{_bindir}/merge +%{_bindir}/rcs +%{_bindir}/rcsclean +%{_bindir}/rcsdiff +#%{_bindir}/rcsfreeze +%{_bindir}/rcsmerge +%{_bindir}/rlog +%{_infodir}/rcs.info* +%{_mandir}/man1/*.1.gz +%{_mandir}/man5/*.5.gz +%doc COPYING +# CREDITS +#%doc ChangeLog NEWS +#%doc README REFS rcs_func.pdf rcs.pdf + +%changelog +* Sat Nov 30 2013 Automatic Build System 5.9.2-1mamba +- automatic version update by autodist + +* Fri Oct 04 2013 Automatic Build System 5.9.1-1mamba +- automatic update by autodist + +* Mon Jun 10 2013 Automatic Build System 5.9.0-1mamba +- update to 5.9.0 + +* Fri Apr 05 2013 Automatic Build System 5.8.2-1mamba +- automatic version update by autodist + +* Sat Jan 26 2013 Automatic Build System 5.8.1-1mamba +- automatic version update by autodist + +* Mon Apr 23 2012 Automatic Build System 5.8-1mamba +- automatic version update by autodist + +* Thu Feb 24 2011 Silvan Calarco 5.7-2mamba +- rebuilt in devel + +* Tue Oct 05 2010 gil 5.7-1mamba +- package created by autospec