-# Makefile for rsync. This is processed by configure to produce the final
-# Makefile
+# The input file that configure uses to create the Makefile for rsync.
prefix=@prefix@
datarootdir=@datarootdir@
VPATH=$(srcdir)
SHELL=/bin/sh
-VERSION=@RSYNC_VERSION@
-
.SUFFIXES:
.SUFFIXES: .c .o
GENFILES=configure.sh aclocal.m4 config.h.in proto.h proto.h-tstamp rsync.1 rsync.1.html \
rsync-ssl.1 rsync-ssl.1.html rsyncd.conf.5 rsyncd.conf.5.html
HEADERS=byteorder.h config.h errcode.h proto.h rsync.h ifuncs.h itypes.h inums.h \
- lib/pool_alloc.h lib/mdigest.h lib/md-defines.h
+ lib/pool_alloc.h lib/mdigest.h lib/md-defines.h version.h
LIBOBJ=lib/wildmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o lib/md5.o \
lib/permstring.o lib/pool_alloc.o lib/sysacls.o lib/sysxattrs.o @LIBOBJS@
zlib_OBJS=zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o \
.PHONY: man
man: rsync.1 rsync-ssl.1 rsyncd.conf.5
-rsync.1: rsync.1.md md2man NEWS.md Makefile
+rsync.1: rsync.1.md md2man version.h Makefile
@$(srcdir)/maybe-make-man $(srcdir) rsync.1.md
-rsync-ssl.1: rsync-ssl.1.md md2man NEWS.md Makefile
+rsync-ssl.1: rsync-ssl.1.md md2man version.h Makefile
@$(srcdir)/maybe-make-man $(srcdir) rsync-ssl.1.md
-rsyncd.conf.5: rsyncd.conf.5.md md2man NEWS.md Makefile
+rsyncd.conf.5: rsyncd.conf.5.md md2man version.h Makefile
@$(srcdir)/maybe-make-man $(srcdir) rsyncd.conf.5.md
.PHONY: clean
dnl Process this file with autoconf to produce a configure script.
-AC_INIT([rsync],[3.2.2pre1],[https://rsync.samba.org/bugtracking.html])
+AC_INIT([rsync],[],[https://rsync.samba.org/bugtracking.html])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([byteorder.h])
AC_CONFIG_HEADER(config.h)
AC_PREREQ([2.69])
-AC_SUBST(RSYNC_VERSION, $PACKAGE_VERSION)
-AC_MSG_NOTICE([Configuring rsync $PACKAGE_VERSION])
+PACKAGE_VERSION=`sed 's/.*"\(.*\)".*/\1/' <$srcdir/version.h`
-AC_DEFINE_UNQUOTED(RSYNC_VERSION, ["$PACKAGE_VERSION"], [rsync release version])
+AC_MSG_NOTICE([Configuring rsync $PACKAGE_VERSION])
LDFLAGS=${LDFLAGS-""}
AC_OUTPUT
AC_MSG_RESULT()
-AC_MSG_RESULT([ rsync ${RSYNC_VERSION} configuration successful])
+AC_MSG_RESULT([ rsync $PACKAGE_VERSION configuration successful])
AC_MSG_RESULT()
env_subs['VERSION'] = '1.0.0'
env_subs['libdir'] = '/usr'
else:
- for fn in (fi.srcdir + 'NEWS.md', 'Makefile'):
+ for fn in (fi.srcdir + 'version.h', 'Makefile'):
try:
st = os.lstat(fn)
except:
if not fi.mtime:
fi.mtime = st.st_mtime
+ with open(fi.srcdir + 'version.h', 'r', encoding='utf-8') as fh:
+ txt = fh.read()
+ m = re.search(r'"(.+?)"', txt)
+ env_subs['VERSION'] = m.group(1)
+
with open('Makefile', 'r', encoding='utf-8') as fh:
for line in fh:
m = re.match(r'^(\w+)=(.+)', line)
while re.search(r'\$\{', val):
val = re.sub(r'\$\{(\w+)\}', lambda m: env_subs[m.group(1)], val)
env_subs[var] = val
- if var == 'VERSION':
+ if var == 'srcdir':
break
with open(fi.fn, 'r', encoding='utf-8') as fh:
About to:
- tweak SUBPROTOCOL_VERSION in rsync.h, if needed
- - tweak the version in configure.ac and the spec files
+ - tweak the version in version.h and the spec files
- tweak NEWS.md to ensure header values are correct
- generate configure.sh, config.h.in, and proto.h
- page through the differences
'%define srcdir': srcdir,
}
- tweak_files = 'configure.ac rsync.h NEWS.md'.split()
+ tweak_files = 'version.h rsync.h NEWS.md'.split()
tweak_files += glob.glob('packaging/*.spec')
tweak_files += glob.glob('packaging/*/*.spec')
for fn in tweak_files:
with open(fn, 'r', encoding='utf-8') as fh:
old_txt = txt = fh.read()
- if 'configure' in fn:
- x_re = re.compile(r'^(AC_INIT\(\[rsync\],\s*\[)\d.+?(\])', re.M)
- txt = replace_or_die(x_re, r'\g<1>%s\2' % version, txt, f"Unable to update AC_INIT with version in {fn}")
+ if fn == 'version.h':
+ txt = f"#define RSYNC_VERSION {version}\n"
elif '.spec' in fn:
for var, val in specvars.items():
x_re = re.compile(r'^%s .*' % re.escape(var), re.M)
if s.returncode:
die('Aborting')
- cmd_chk('make reconfigure ; make gen')
+ cmd_chk('make gen')
cmd_chk(['rsync', '-a', *gen_files, 'SaVeDiR/'])
print(f'Creating any missing patch branches.')
#include "errcode.h"
#include "config.h"
+#include "version.h"
/* The default RSYNC_RSH is always set in config.h. */
--- /dev/null
+#define RSYNC_VERSION "3.2.2pre1"