Skip to content

Commit 774314a

Browse files
committed
Update configure script and headers to substitute the copyright year from one
place. Update the makesrcdist script to check whether all files have been updated prior to a release.
1 parent f19360c commit 774314a

File tree

11 files changed

+88
-15
lines changed

11 files changed

+88
-15
lines changed

config.h.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
*/
1010

1111
/*
12-
* What is the version number for this software?
12+
* What is the version number and year for this software?
1313
*/
1414

1515
#define SVERSION ""
16+
#define SYEAR ""
1617

1718

1819
/*

configure

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,7 @@ build_os
684684
build_vendor
685685
build_cpu
686686
build
687+
SYEAR
687688
SVERSION
688689
target_alias
689690
host_alias
@@ -2733,6 +2734,11 @@ SVERSION="1.9.21"
27332734
printf "%s\n" "#define SVERSION \"$SVERSION\"" >>confdefs.h
27342735

27352736

2737+
SYEAR="2025"
2738+
2739+
printf "%s\n" "#define SYEAR \"$SYEAR\"" >>confdefs.h
2740+
2741+
27362742

27372743
printf "%s\n" "#define HTMLDOC_DOES_NOT_USE_AUTOHEADER_OR_AUTOMAKE 1" >>confdefs.h
27382744

configure.ac

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,15 @@ AC_INIT([HTMLDOC], [1.9.21], [https://github.com/michaelrsweet/htmldoc/issues],
2525
AC_CONFIG_HEADERS([config.h])
2626

2727

28-
dnl De])ne the version number...
28+
dnl De])ne the version number and year...
2929
SVERSION="AC_PACKAGE_VERSION"
3030
AC_SUBST(SVERSION)
3131
AC_DEFINE_UNQUOTED(SVERSION, "$SVERSION")
3232

33+
SYEAR="2025"
34+
AC_SUBST(SYEAR)
35+
AC_DEFINE_UNQUOTED(SYEAR, "$SYEAR")
36+
3337

3438
dnl GNU autoheader, automake, etc. will break the build system, this macro
3539
dnl causes the autoheader utility to fail...

desktop/htmldoc.plist.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<string>English</string>
1818

1919
<key>NSHumanReadableCopyright</key>
20-
<string>Copyright 1997-2025 by Michael R Sweet</string>
20+
<string>Copyright 1997-@SYEAR@ by Michael R Sweet</string>
2121

2222
<key>CFAppleHelpAnchor</key>
2323
<string>help</string>
@@ -38,7 +38,7 @@
3838
<string>@SVERSION@</string>
3939

4040
<key>CFBundleGetInfoString</key>
41-
<string>@SVERSION@, Copyright Michael R Sweet 1997-2025</string>
41+
<string>@SVERSION@, Copyright Michael R Sweet 1997-@SYEAR@</string>
4242

4343
<key>CFBundleDocumentTypes</key>
4444
<array>

htmldoc/gui.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4285,7 +4285,7 @@ GUI::showAboutCB(void)
42854285
label->image(&logo);
42864286

42874287
label = new Fl_Box(60, 45, 530, 35,
4288-
"HTMLDOC " SVERSION "\nCopyright © 2011-2025 by Michael R Sweet."
4288+
"HTMLDOC " SVERSION "\nCopyright © 2011-" SYEAR " by Michael R Sweet."
42894289
);
42904290
label->align(FL_ALIGN_TOP_LEFT | FL_ALIGN_INSIDE | FL_ALIGN_WRAP);
42914291

htmldoc/htmldoc.cxx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2617,17 +2617,13 @@ usage(const char *arg) // I - Bad argument string
26172617
if (CGIMode)
26182618
puts("Content-Type: text/plain\r\n\r");
26192619

2620-
puts("HTMLDOC Version " SVERSION " Copyright 2011-2025 by Michael R Sweet.");
2620+
puts("HTMLDOC Version " SVERSION " Copyright 2011-" SYEAR " by Michael R Sweet.");
26212621
puts("HTMLDOC is provided under the terms of the GNU General Public License and");
26222622
puts("comes with absolutely no warranty. This software is based in part on the work");
26232623
puts("of the Independent JPEG Group.");
26242624
puts("");
26252625

2626-
#ifdef HAVE_SSL
26272626
puts("This copy of HTMLDOC has been built to support both http: and https: URLs.");
2628-
#else
2629-
puts("This copy of HTMLDOC has been built to support http: URLs only.");
2630-
#endif /* HAVE_SSL */
26312627
puts("");
26322628

26332629
if (CGIMode)

htmldoc/license.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ GUI::showLicenseCB(void)
5959
group->labelsize(18);
6060

6161
box = new Fl_Box(20, 45, 600, 110,
62-
"Copyright © 2011-2025 by Michael R Sweet.\n\n"
62+
"Copyright © 2011-" SYEAR " by Michael R Sweet.\n\n"
6363
"HTMLDOC is provided under the terms of the GNU General Public License and "
6464
"comes with absolutely no warranty. Please report problems on the Github "
6565
"issues page at:\n\n"

htmldoc/ps-pdf.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ extern "C" { /* Workaround for JPEG header problems... */
6464

6565
#define HTMLDOC_ASCII85
6666
//#define HTMLDOC_INTERPOLATION
67-
#define HTMLDOC_PRODUCER "htmldoc " SVERSION " Copyright 2011-2025 by Michael R Sweet"
67+
#define HTMLDOC_PRODUCER "htmldoc " SVERSION " Copyright 2011-" SYEAR " by Michael R Sweet"
6868

6969

7070
/*

tools/makesrcdist

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,75 @@ if test $# != 1; then
99
fi
1010

1111
version=$1
12+
year=$(date +%Y)
1213

14+
# Validate that all version numbers and copyrights have been updated...
15+
status=0
16+
17+
if grep -q v$version CHANGES.md; then
18+
if test "x$(grep v$version CHANGES.md | awk '{print $2}')" = "x(YYYY-MM-DD)"; then
19+
echo "Need to update release date in 'CHANGES.md'."
20+
status=1
21+
fi
22+
else
23+
echo "Need to add v$version to 'CHANGES.md'."
24+
status=1
25+
fi
26+
27+
temp="$(grep AC_INIT configure.ac | awk '{print $2}' | sed -e '1,$s/^\[//' -e '1,$s/\],$//')"
28+
if test "$temp" != $version; then
29+
echo "Still need to update version to $version in configure.ac (saw $temp)"
30+
exit 1
31+
fi
32+
33+
temp="$(grep SYEAR= configure.ac | awk -F \" '{print $2}')"
34+
if test "$temp" != $year; then
35+
echo "Still need to update SYEAR to $year in configure.ac (saw $temp)"
36+
exit 1
37+
fi
38+
39+
if test "$(grep SVERSION= configure | awk -F \" '{print $2}')" != "$version"; then
40+
echo "Still need to run 'autoconf -f'."
41+
exit 1
42+
elif test "$(grep SYEAR= configure | awk -F \" '{print $2}')" != "$year"; then
43+
echo "Still need to run 'autoconf -f'."
44+
exit 1
45+
fi
46+
47+
temp="$(grep '^version:' snap/snapcraft.yaml | awk -F\" '{print $2}')"
48+
if test "$temp" != "$version"; then
49+
echo "Still need to update version to $version in snap/snapcraft.yaml (saw $temp)"
50+
exit 1
51+
fi
52+
53+
temp="$(grep SVERSION vcnet/config.h | awk -F \" '{print $2}')"
54+
if test "$temp" != "$version"; then
55+
echo "Still need to update SVERSION in 'vcnet/config.h' (saw $temp)."
56+
exit 1
57+
fi
58+
59+
temp="$(grep ProductVersion vcnet/htmldoc-installer.aip | head -1 | awk -F \" '{print $4}')"
60+
if test "x$temp" != "x$version.0"; then
61+
echo "Still need to update ProductVersion to $version.0 in 'vcnet/htmldoc-installer.aip' (saw $temp)."
62+
exit 1
63+
fi
64+
65+
temp="$(grep SVERSION xcode/config.h | awk -F \" '{print $2}')"
66+
if test "$temp" != "$version"; then
67+
echo "Still need to update SVERSION in 'xcode/config.h' (saw $temp)."
68+
exit 1
69+
fi
70+
71+
if test $status = 1; then
72+
exit 1
73+
fi
74+
75+
# Create the tag and push it...
1376
echo Creating tag for release...
1477
git tag -s -m "Tag $version" v$version
1578
git push origin v$version
1679

80+
# Create the tarballs and sign them...
1781
echo Creating htmldoc-$version-source.tar.gz...
1882
git archive --format tar --prefix=htmldoc-$version/ HEAD | gzip -v9 >~/Desktop/htmldoc-$version-source.tar.gz
1983
gpg --detach-sign ~/Desktop/htmldoc-$version-source.tar.gz

vcnet/config.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,11 @@ typedef __int64 ssize_t;
8686

8787

8888
/*
89-
* What is the version number for this software?
89+
* What is the version number and year for this software?
9090
*/
9191

92-
#define SVERSION "1.9.21"
92+
#define SVERSION "1.9.21"
93+
#define SYEAR "2025"
9394

9495

9596
/*

0 commit comments

Comments
 (0)