Andre Noll [Fri, 2 Feb 2024 10:10:21 +0000 (11:10 +0100)]
debian: Remove hard-coded dependency on liblopsub1.
The lopsub package was recently renamed to liblopsub1t64 to deal with
the upcoming 64-bit time_t transition in Debian. Drop the dependency
rather than renaming it, since this is what shlibs are for.
Helmut Grohne [Wed, 1 Mar 2023 16:03:24 +0000 (17:03 +0100)]
Fix cross build.
The cross build fails to find the lopsub library since it configures
for the build architecture. This happens as no --build nor --host is
passed which would have happened automatically if dh_auto_configure
could be used. Thus it'll have to be passed manually. Then configure
fails finding config.h.in, which for some reason is not created (nor
asked for) by the override_dh_autoreconf. And finally, the actual
Makefile does not pick up the compiler detected by configure and
rather uses plain cc, so we'll have to tell it as well.
Andre Noll [Thu, 5 Sep 2019 10:30:28 +0000 (12:30 +0200)]
tfortune-1.0.1.
We've had a couple of improvements and fixes since version 1.0.0,
so here is tfortune-1.0.1. A new version number is also needed for
the package to migrate to Debian testing because the system would
not accept a package with the same version number.
Andre Noll [Sun, 16 Jun 2019 11:06:44 +0000 (13:06 +0200)]
Add a few sample epigrams and the fortunes package.
This adds a single file containing ~200 tagged epigrams in English
language. The debian/control file is extended to provide the new
"tfortunes" package which ships this data file. The new package is
Recommended: by the tfortune package but tfortune works without it
if epigrams are provided locally.
The debian/copyright file also needs to be adjusted because the
epigrams are under the public domain while the source code remains
GPLv3.
The epigrams were created by running
tfortune -- print -atx pub
on the author's epigram database with "pub" being a tag expression
that filters out epigrams not suitable for public exposure.
Suggested-by: Adam Borowski <kilobyte@angband.pl>
v2 -> v3
~~~~~~~~
Apply fixes provided by Adam Borowski:
* Fix bogus date in debian/changelog (s/Mon/Tue)
* Make the data package Arch:all, since it is truly arch-independent
* Add Multi-Arch header to debian/control
v1 -> v2
~~~~~~~~
Incorporate feedback from Adam Borowski:
* Fix typo in description of the tfortunes package
* Update debian/changelog and increase debian version number
Andre Noll [Sun, 16 Jun 2019 11:46:45 +0000 (13:46 +0200)]
Fall back to system-wide epigram directory.
If the per-user directory can not be opened, we currently print an
error message and exit. As pointed out by Adam Borowski, this is not
especially user-friendly.
This commit teaches tfortune to look in a second, system-wide location
in this case. This location can be controlled with the --datadir
option of configure. The man page is updated accordingly.
Andre Noll [Sun, 16 Jun 2019 12:04:44 +0000 (14:04 +0200)]
Make errors from regfile_iter_new() non-fatal.
The callers of the regfile iter API already handle the case of no
epigrams or tag expressions just fine. In particular, the stats
command can still print meaningful output if the tag expression
directory does not exist, which is a perfectly valid setup.
This patch modifies regfile_iter_new() to no longer abort but merely
print a log message and return NULL if opendir() fails. The various
accessors of the regfile iter API have to be adjusted to deal with
NULL pointers but no changes to tfortune.c are required.
Andre Noll [Tue, 18 Jun 2019 17:07:24 +0000 (19:07 +0200)]
com_stats(): Work around bogus gcc warning.
For some versions of gcc (7.4.0, 8.3.0, and 8.3.0-7 as shipped with
Debian-11, but not gcc-7.4.0-1ubuntu1~18.04.1), the previous patch
introduced the following warning:
tfortune.c:912:3: warning: 'lh_stats' may be used uninitialized in this function [-Wmaybe-uninitialized]
free(lh_stats);
^~~~~~~~~~~~~~
We only assign to lh_stats when --verbose is given, and only free the
memory if --verbose is given. Apparently gcc has started to believe
that the value of the "verbose" boolean variable might change, which is
impossible. Therefore, the warning is believed to be a false positive.
However, gcc has a point: There is no need to check for --verbose
twice, as a single branch is sufficient. This not only gets rid of
the warning but also makes the boolean variable pointless and removes
more lines than it adds.
Andre Noll [Mon, 20 May 2019 14:58:20 +0000 (16:58 +0200)]
Add infrastructure to build debian packages.
This commit adds the usual files below debian/ so that debian source
and binary packages can be made with a command like
dpkg-buildpackage
The debian/rules file relies on dh but overrides the dh_auto_configure
and the dh_autoreconf targets. The default recipe for dh_auto_configure
results in warnings because tfortune's configure does not implement
some of the options which dh appends to the configure command. The
override for autoreconf is needed because the default recipe would
remove our configure wrapper and replace it with the generated script.
This has been tested on debian-9, debian-10 and debian-11. On all
systems, lintian(1) reports no warnings and no errors.
v3 -> v4
~~~~~~~~
* Fix Bug ID in debian/changelog (pointed out by Adam Borowski)
v2 -> v3
~~~~~~~~
* Switch to a simple debian/rules file as suggested by Alexis Murzeau
and Adam Borowski.
v1 -> v2
~~~~~~~~
Incorporate feedback from Adam Borowski:
* Use dh_installchangelogs instead of open-coding it
* Use gzip -n to avoid rendering the build non-reproducible
* Fix the installation path of debian/copyright by running dh_install,
* Create md5sums file
Andre Noll [Wed, 22 May 2019 13:56:31 +0000 (15:56 +0200)]
New make targets: exe, build-arch, man and build-indep.
It's good practice to provide separate make targets for generating
arch-dependent files (e.g., executables) and for arch-independent files
(e.g., manual pages). Currently there is only one file of either type
which gets installed by the make target, but this might change.
Andre Noll [Mon, 20 May 2019 17:09:30 +0000 (19:09 +0200)]
Install man page in section 6.
The manual page of the standard fortune program is part of section 6
(Games Manuals), so the tfortune man page should be installed there
as well rather than in section 1.
Andre Noll [Sun, 17 Feb 2019 11:39:40 +0000 (12:39 +0100)]
Avoid duplication in version, README, man page.
URLs and the email address are currently spread out over multiple
files. This commit cleans up the mess by defining everything in
Makefile and adjusting other places to use the information from there.
We use the opportunity to add a link to the author's home page.
version-gen.sh is made generic, i.e., it does not refer to tfortune
any more.
Andre Noll [Mon, 19 Mar 2018 17:37:28 +0000 (18:37 +0100)]
Initial commit.
Tfortune was maintained in a non-public git repository between 2016-04
and 2018-01. By then it was moved to a dedicated repository, rewritten
to support the tag expression grammar and made scalable by introducing
linear hashing. At the same time command line parsing was switched
to the lopsub library, the command line options were redesigned and
properly documented, and the nifty logo was added.
In 2018-03 tfortune reached version 1.0 and was finally made public. All
commits that led to version 1.0 have been discarded, so this repository
contains only the final result as a single commit.
Many thanks to Effie Symeonidi who gave valuable feedback regarding the
installation instructions.