OSDN Git Service

Update master distribution build rules to match gui-dev branch.
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Fri, 11 Jan 2013 16:03:16 +0000 (16:03 +0000)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Fri, 11 Jan 2013 16:03:16 +0000 (16:03 +0000)
--HG--
rename : version.c.in => src/version.c.in

ChangeLog
Makefile.in
configure.ac
src/version.c.in [moved from version.c.in with 62% similarity]

index 6b63b0e..7cf7a51 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2013-01-11  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
+       Update master distribution build rules to match gui-dev branch.
+
+       * configure.ac (AC_INIT): Remove build classification suffix from
+       package version field; leave it to be deduced, at make time, from...
+       (CLI_RELEASE_CLASS): ...this new AC_SUBST variable; assign as "beta".
+       (SNAPSHOT_CLASS): Accept as environent override for CLI_RELEASE_CLASS.
+       (GUI_RELEASE_CLASS): New AC_SUBST variable; defined to pre-empt future
+       GUI implementation, with possibly different classification to CLI. Set
+       default to "alpha", supporting override by SNAPSHOT_CLASS.
+       (AC_CONFIG_FILES): Remove version.c
+
+       * version.c.in: Original file removed; relocated to...
+       * src/version.c.in: ...here; update descriptive comments accordingly.
+       (COPYRIGHT_HOLDER, YEARS_OF_ISSUE): Change substitution field markers
+       from "@" to "%", to avoid confusion in makefile references.
+
+       * Makefile.in (CLI_RELEASE_CLASS): Use it, in conjunction with...
+       (BLDTAG, SCMTAG): New macros; use them to classify tarball names.
+       (time-stamp, %.tag, %.tagged.time, %.time): New goals; required by...
+       (BUILD_TAG, TAG_SCRIPT, VERSION_SCRIPT): New macros; copy them from
+       gui-dev branch; use to generate version.c from src/version.c.in
+       (SRCDIST_FILES): Remove version.c.in; it is now captured within...
+       (SRCDIST_SUBDIRS): ...this; remove build-aux and build-aux/m4; we want
+       only selected files from these, as filtered by specification in...
+       (BUILD_AUX_DIRS, BUILD_AUX_FILES): ...these new macros; copy them from
+       gui-dev branch; use them to include selected source files within...
+       (srcdist): ...this distribution target.
+
 2013-01-10  Keith Marshall  <keithmarshall@users.sourceforge.net>
 
        Add configure time check for Lua API availability.
index b660144..bb4a38f 100644 (file)
@@ -6,7 +6,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 
 # Written by Keith Marshall <keithmarshall@users.sourceforge.net>
-# Copyright (C) 2009, 2010, 2011, 2012, MinGW Project
+# Copyright (C) 2009-2013, MinGW.org Project
 #
 #
 # Makefile template for mingw-get
@@ -22,16 +22,19 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 # hope that it may prove useful, but WITHOUT WARRANTY OF ANY KIND; not
 # even an implied WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR ANY
 # PARTICULAR PURPOSE.  Under no circumstances will the author, or the
-# MinGW Project, accept liability for any damages, however caused,
+# MinGW.org Project, accept liability for any damages, however caused,
 # arising from the use of this software.
 #
 PACKAGE_SUBSYSTEM = @host_os@
 
-srcdir = @srcdir@
-abs_top_srcdir = @abs_top_srcdir@
+CLI_RELEASE_CLASS = @CLI_RELEASE_CLASS@
 
+BUILD_TAG = `>> build.tag; cat build.tag`
 DEBUGLEVEL = @DEBUGLEVEL@
 
+srcdir = @srcdir@
+abs_top_srcdir = @abs_top_srcdir@
+
 vpath %.ico @srcdir@/icons
 VPATH = @top_srcdir@/src:@top_srcdir@/src/pkginfo:@top_srcdir@/tinyxml
 
@@ -50,6 +53,16 @@ AR = @AR@
 ARFLAGS = @ARFLAGS@
 
 WINDRES = @WINDRES@
+VERSION_SCRIPT = tag=$(BUILD_TAG); \
+  test "x$$tag" != x && tag="-$(CLI_RELEASE_CLASS)-$$tag"; \
+    $(TAG_SCRIPT)
+
+TAG_SCRIPT = sed \
+  -e "s!%PACKAGE_NAME%!$(PACKAGE_TARNAME)!g" \
+  -e "s!%PACKAGE_VERSION%!$(PACKAGE_VERSION)$$tag!g" \
+  -e "s!%COPYRIGHT_HOLDER%!@COPYRIGHT_HOLDER@!g" \
+  -e "s!%YEARS_OF_ISSUE%!@YEARS_OF_ISSUE@!g"
+
 
 OBJEXT = @OBJEXT@
 EXEEXT = @EXEEXT@
@@ -77,6 +90,8 @@ LIBEXEC_SCRIPTS = ${script_srcdir}/setup.lua ${script_srcdir}/wsh.lua \
    ${script_srcdir}/shlink.js ${script_srcdir}/unlink.js
 LIBEXEC_DATA = mingw-get-0.dll
 
+# Primary build goals...
+#
 all: $(BIN_PROGRAMS) $(LIBEXEC_PROGRAMS) $(LIBEXEC_DATA)
 
 pkginfo$(EXEEXT):  driver.$(OBJEXT) pkginfo.$(OBJEXT)
@@ -119,6 +134,27 @@ sinclude *.d
        $(CXX) $(DEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $<
        $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
 
+# Release tagging...
+#
+time-stamp:
+%.tagged.time: time-stamp
+       > $*.time
+
+%.time:
+       > $*.time
+
+%.tag: %.tagged.time
+       >> $@; tag=`date +%Y%m%d`; \
+         tag=`awk -F- -v today=$$tag ' \
+           BEGIN { tag = 1 } $$1 == today { tag += $$2 } \
+           END { print today "-" tag }' $@`; \
+         echo $$tag > $@
+
+%.c: %.c.in
+       $(VERSION_SCRIPT) $< > $@
+
+version.c: Makefile build.time
+
 # Installation tools and directory paths...
 #
 mkinstalldirs = @MKDIR_P@
@@ -170,15 +206,25 @@ install-strip: install
          done
 
 # Packaging and distribution...
+# "Native" source files, (i.e. those specific to mingw-get), are...
 #
 LICENCE_FILES = README COPYING
 SRCDIST_FILES = $(LICENCE_FILES) ChangeLog NEWS INSTALL \
-  aclocal.m4 configure.ac configure Makefile.in version.c.in
+  aclocal.m4 configure.ac configure Makefile.in
+
+# ...plus the entire content of the sub-directories...
+#
+SRCDIST_SUBDIRS = src src/pkginfo srcdist-doc icons \
+  scripts/libexec tinyxml xml
 
-SRCDIST_SUBDIRS = build-aux build-aux/m4 icons src src/pkginfo \
-  srcdist-doc scripts/libexec tinyxml xml
+# In addition to the native sources for mingw-get, our source distribution
+# must include a filtered subset of those additional files which we import
+# from the project's global build-aux repository...
+#
+BUILD_AUX_DIRS = build-aux build-aux/m4
+BUILD_AUX_FILES = config.guess config.sub install-sh missing.m4
 
-# The names of distributed pacakge archive files incorporate version
+# The names of distributed package archive files incorporate version
 # information, derived from PACKAGE_VERSION; this is decomposed, so that
 # the PACKAGE_SUBSYSTEM may be interposed between the principal version
 # number and any qualifying suffix, which specifies development status.
@@ -203,15 +249,21 @@ dist: srcdist bindist readme.txt
 TARZIP = xz
 TAREXT = tar.$(TARZIP)
 
+# The following macros facilitate the inclusion of SCM build tags within
+# the generated names for the release tarballs.
+#
+BLDTAG =  @abs_top_builddir@/build.tag
+SCMTAG = `>> $(BLDTAG); cat $(BLDTAG) | sed 's,.,-$(CLI_RELEASE_CLASS)-&,'`
+
 bindist: all licdist
        rm -rf staged
        $(MAKE) --no-print-directory prefix=`pwd`/staged install-strip
        cd staged; tar chf - bin/pkginfo$(EXEEXT) | $(TARZIP) -c > \
-         ../pkginfo-$(PACKAGE_DISTVERSION)-bin.$(TAREXT)
+         ../pkginfo-$(PACKAGE_DISTVERSION)$(SCMTAG)-bin.$(TAREXT)
        rm staged/bin/pkginfo$(EXEEXT)
        cd staged; tar chf - * | $(TARZIP) -c > \
-         ../$(PACKAGE_DISTNAME)-bin.$(TAREXT)
-       cd staged; zip -r ../$(PACKAGE_DISTNAME)-bin.zip *
+         ../$(PACKAGE_DISTNAME)$(SCMTAG)-bin.$(TAREXT)
+       cd staged; zip -r ../$(PACKAGE_DISTNAME)$(SCMTAG)-bin.zip *
        rm -rf staged
 
 licdist:
@@ -222,7 +274,8 @@ licdist:
            && $(LN_S) ${abs_top_srcdir}/$$file . \
            || $(LN_S) ${CURDIR}/$$file .; \
          done
-       tar chf - share | $(TARZIP) -c > $(PACKAGE_DISTNAME)-lic.$(TAREXT)
+       tar chf - share | $(TARZIP) -c > \
+         $(PACKAGE_DISTNAME)$(SCMTAG)-lic.$(TAREXT)
        rm -rf share
 
 srcdist: srcdist-doc
@@ -241,9 +294,18 @@ srcdist: srcdist-doc
            fi; \
          done; \
        cd ${CURDIR}; done
+       for dir in $(BUILD_AUX_DIRS); do \
+         $(mkinstalldirs) ${PACKAGE_DISTROOT}/$$dir \
+         && cd ${PACKAGE_DISTROOT}/$$dir; \
+         for file in $(BUILD_AUX_FILES); do \
+           if test -f ${abs_top_srcdir}/$$dir/$$file; then \
+             $(LN_S) ${abs_top_srcdir}/$$dir/$$file .; \
+           fi; \
+         done; \
+       cd ${CURDIR}; done
        cd ${PACKAGE_DISTROOT}/src/pkginfo; $(LN_S) ${CURDIR}/pkginfo.c .
        tar chf - ${PACKAGE_DISTROOT} | $(TARZIP) -c > \
-         ${PACKAGE_DISTNAME}-src.$(TAREXT)
+         $(PACKAGE_DISTNAME)$(SCMTAG)-src.$(TAREXT)
        rm -rf ${PACKAGE_DISTROOT}
 
 # README, INSTALL and NEWS files to be included in the source distribution
index 117fcda..f5a443c 100644 (file)
 # MinGW.org Project, accept liability for any damages, however caused,
 # arising from the use of this software.
 #
-  AC_INIT([mingw-get],[0.5-beta-20120426-1],[http://mingw.org/Reporting_Bugs])
+  AC_INIT([mingw-get],[0.5],[http://mingw.org/Reporting_Bugs])
 
   AC_SUBST([COPYRIGHT_HOLDER],["MinGW.org Project"])
   AC_SUBST([YEARS_OF_ISSUE],["2009-2013"])
 
+# Identify the formal release classes for each of the CLI and the GUI
+# application sub-packages; these may be overriden at configure time,
+# by specifying a common SNAPSHOT_CLASS definition, (e.g. by running
+#
+#   SNAPSHOT_CLASS=pre ./config.status --recheck && ./config.status
+#
+# to update the configuration for the "preview" class), when we wish
+# to build snapshots for distribution between formal releases.
+#
+  AC_SUBST([CLI_RELEASE_CLASS],[${SNAPSHOT_CLASS-"beta"}])
+  AC_SUBST([GUI_RELEASE_CLASS],[${SNAPSHOT_CLASS-"alpha"}])
+
 # Override the normal UNIX-centric autoconf default prefix;
 # substitute the MinGW standard in its place.
 #
 
 # Establish the product version banner, and create a makefile
 #
-  AC_CONFIG_FILES([version.c Makefile])
+  AC_CONFIG_FILES([Makefile])
   MINGW_AC_OUTPUT
 #
 # $RCSfile$: end of file
similarity index 62%
rename from version.c.in
rename to src/version.c.in
index b70c820..7cf172c 100644 (file)
@@ -1,12 +1,15 @@
 /*
- * @configure_input@
+ * version.c
  *
+ * File automatically generated -- do not edit in place!!!
+ *
+ * Generated from template:
  * $Id$
  *
  */
 const char *version_identification =
-"@PACKAGE_NAME@ version @PACKAGE_VERSION@\n"
-"Copyright (C) @YEARS_OF_ISSUE@, @COPYRIGHT_HOLDER@\n"
+"%PACKAGE_NAME% version %PACKAGE_VERSION%\n"
+"Copyright (C) %YEARS_OF_ISSUE%, %COPYRIGHT_HOLDER%\n"
 "\n"
 "This is free software; see the product documentation, or source code,\n"
 "for copying and redistribution conditions.  There is NO WARRANTY; not\n"