fortune-mod stable port information

Package: fortune-mod
Version: 1.99.1
Revision: 2
Epoch: 1
Description: Fortune cookies on demand
DescDetail: <<
The fortune package displays epigrams selected randomly from a
selection of fortune files. This is an enhanced version of the BSD
program. The data files (which can be shared) are contained in the
'fortunes-min', 'fortunes', and 'fortunes-off' packages.

These are the machine-dependent parts of the fortune package,
i.e. the fortune program and the programs used for generating the
data files.
<<
DescUsage: <<
To see a new fortune every time a Terminal window is opened, add the
following line to ~/.login or ~/.bashrc:

/sw/bin/fortune
<<
HomePage: http://www.redellipse.net/code/fortune
License: BSD
BuildDepends: recode, recode-dev, recode-shlibs, fink (>= 0.24.12)
Depends: recode-shlibs
Recommends: fortunes-min, fortunes
Suggests: fortune-cookie-db
#Replaces: %n (<= 9708-3)
Source: mirror:debian:pool/main/f/%n/%n_%v.orig.tar.gz
Source-MD5: f208805b3b712e32997d7667e0ec52d8
SourceDirectory: %n-%v
# The -1 is Debian's revision, not Fink's
Source2: mirror:debian:pool/main/f/%n/%n_%v-1.diff.gz
Source2-MD5: ad25586fe7a7d48e83d53ae752474096
PatchFile: %n.patch
PatchFile-MD5: db28d5d423e4019ad049e1e808983c3f
PatchScript: <<
gunzip ../%n_%v-1.diff.gz; sed 's|@PREFIX@|%p|g' <%{PatchFile} | patch -p1; patch -p1 < ../%n_%v-1.diff
sed -i.bak -e 's|cp -d|/bin/cp|' datfiles/Makefile datfiles/off/Makefile
<<
CompileScript: <<
make FORTDIR=%p/bin COOKIEDIR=%p/share/fortunes LOCALDIR=%p/share/fortunes BINDIR=%p/bin LDFLAGS='-s -L%p/lib' REGEXDEFS='-DHAVE_REGEX_H -DPOSIX_REGEX' all fortune/fortune.man
<<
InstallScript: <<
make FORTDIR=%i/bin COOKIEDIR=%i/share/fortunes LOCALDIR=%p/share/fortunes BINDIR=%i/bin BINMANDIR=%i/share/man/man1 FORTMANDIR=%i/share/man/man6 install
cd %i/share/man/man1; gzip -6 strfile.1
<<
Maintainer: None
DescPort: <<
* ld: Undefined symbols: _program_name: added program_name
http://www.delorie.com/gnu/docs/recode/recode_17.html
* implicit declaration of function `exit': added #include
* Force build of fortune/fortune.man during CompileScript for correct
Fink path insertion into man file.
* gzip strfile.1 during packaging for the unstr man file symlink.
* Splitoff as Debian does, to allow for future localized fortune
packages or simply other fortune packages in Fink.
* Depends: fortunes-min | fortunes | fortune-cookie-db to ensure the
default choice is not the offensive set, does not work if
fortunes-de is selected during building, because Fink incorrrectly
sees it as a circular dependency, when really fortune-mod only
depends on fortune-cookie-db [virtual] RUNTIME, while the building
of any fortune-cookie-db DOES require fortune-mod as a
BuildDepends (to parse the datafiles during their creation).
* Also, Fink currently does NOT handle virtual package selection,
such as: 'fink install fortune-cookie-db' (does not work) so the
PostInstScript here should be updated whenever a new localized
fortunes package is added in the future.
* ld: warning prebinding disabled because dependent library:
/sw/lib/librecode.0.dylib is not prebound
<<
PostInstScript: <<
echo
echo " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
echo "NOTE:"
echo
echo "At least one of the following additional packages MUST be"
echo "installed before fortune-mod can provide fortune cookies:"
echo
echo " fortunes-min"
echo " fortunes"
echo " fortunes-de"
echo " fortunes-off"
echo
echo " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
<<
DocFiles: <<
ChangeLog cookie-files debian/copyright INDEX Notes Offensive README
debian/README.Debian debian/README.Debian.offensive TODO
<<
Splitoff: <<
Package: fortunes-off
Description: Data files containing offensive fortune cookies
DescDetail: <<
This package contains 'fortune cookies' which some may consider to
be offensive. Please do not install this package if you or your
users are easily offended. You'll need the fortune-mod package to
display the cookies.
<<
Provides: fortune-cookie-db
Recommends: %N
Files: share/fortunes/off
DocFiles: <<
ChangeLog cookie-files debian/copyright INDEX Notes Offensive README
debian/README.Debian debian/README.Debian.offensive TODO
<<
<<
Splitoff2: <<
Package: fortunes-min
Description: Data files containing a basic fortune cookie set
DescDetail: <<
This package contains a small number of 'fortune cookies' for the
bandwidth conscious. There are over 15000 different 'fortune cookies'
in the fortunes package. You'll need the fortune-mod package to display
the cookies.
<<
Provides: fortune-cookie-db
Recommends: %N
Files: <<
share/fortunes/fortunes
share/fortunes/fortunes.dat
share/fortunes/fortunes.u8
share/fortunes/literature
share/fortunes/literature.dat
share/fortunes/literature.u8
share/fortunes/riddles
share/fortunes/riddles.dat
share/fortunes/riddles.u8
<<
DocFiles: <<
ChangeLog cookie-files debian/copyright INDEX Notes Offensive README
debian/README.Debian debian/README.Debian.offensive TODO
<<
<<
Splitoff3: <<
Package: fortunes
Description: Data files containing fortune cookies
DescDetail: <<
There are by far over 15000 different 'fortune cookies' in this
package. You'll need the fortune-mod package to display the cookies.
<<
Provides: fortune-cookie-db
Recommends: %N
Files: share/fortunes
DocFiles: <<
ChangeLog cookie-files debian/copyright INDEX Notes Offensive README
debian/README.Debian debian/README.Debian.offensive TODO
<<
<<
DescPackaging: <<
Original maintainer: Carsten Klapp
<<

fortune-mod stable port .patch

--- ../../fortune-mod_1.99.1-1.diff Sat Aug 7 04:45:08 2004
+++ ../../fortune-mod_1.99.1-1.diff-patched Fri Dec 10 15:50:52 2004
@@ -1153,5 +1153,5 @@
+
+Should fortunes be found in the main fortunes database which fail the
-+criteria found in the document /usr/share/doc/fortunes/Offensive, I will gladly
++criteria found in the document @PREFIX@/share/doc/fortune-mod/Offensive, I will gladly
+move them into the fortunes-off package given the following:
+
diff -ru2N --exclude=.DS_Store fortune-mod-1.99.1/Notes fortune-mod-1.99.1-patched/Notes
--- fortune-mod-1.99.1/Notes Fri Mar 5 08:29:56 2004
+++ fortune-mod-1.99.1-patched/Notes Fri Dec 10 18:32:28 2004
@@ -17,7 +17,7 @@
==> GENERAL INFORMATION
By default, fortune retrieves its fortune files from the directory
-/usr/local/share/games/fortune. A fortune file has two parts: the source file
+@PREFIX@/share/fortunes. A fortune file has two parts: the source file
(which contains the fortunes themselves) and the data file which describes
-the fortunes. The data fil always has the same name as the fortune file
+the fortunes. The data file always has the same name as the fortune file
with the string ".dat" concatenated, e.g. if "fort" is a standard fortune
database, then "fort.dat" is the data file which describes it. See
@@ -26,5 +26,5 @@
offensive parts. The offensive version of a file has the same name as the
non-offensive version but exists in the offensive fortunes directory
-(/usr/local/share/games/fortune/off by default). The fortune program
+(@PREFIX@/share/fortunes/off by default). The fortune program
automatically assumes that any file in the offensive fortune directory
is potentially offensive, and should therefore only be displayed if
diff -ru2N --exclude=.DS_Store fortune-mod-1.99.1/README fortune-mod-1.99.1-patched/README
--- fortune-mod-1.99.1/README Fri Mar 5 08:29:56 2004
+++ fortune-mod-1.99.1-patched/README Fri Dec 10 19:20:26 2004
@@ -6,5 +6,5 @@
a look at the changes that have come in, and the new features.

-Fortune-mod now leaves at http://www.redellipse.net/code/fortune. You
+Fortune-mod now lives at http://www.redellipse.net/code/fortune. You
can find the CVS repository at
http://cvs.alioth.debian.org/cgi-bin/cvsweb.cgi/fortune/?cvsroot=fortune
diff -ru2N --exclude=.DS_Store fortune-mod-1.99.1/datfiles/Makefile fortune-mod-1.99.1-patched/datfiles/Makefile
--- fortune-mod-1.99.1/datfiles/Makefile Fri Mar 5 08:29:56 2004
+++ fortune-mod-1.99.1-patched/datfiles/Makefile Sat Dec 11 23:20:46 2004
@@ -59,5 +59,5 @@
for i in $(COOKIES) ; do \
install -m 0644 $$i $$i.dat $(COOKIEDIR) || exit $? ; \
- cp -d $$i.u8 $(COOKIEDIR) ; \
+ cp -R $$i.u8 $(COOKIEDIR) ; \
done

diff -ru2N --exclude=.DS_Store fortune-mod-1.99.1/datfiles/off/Makefile fortune-mod-1.99.1-patched/datfiles/off/Makefile
--- fortune-mod-1.99.1/datfiles/off/Makefile Fri Mar 5 08:29:56 2004
+++ fortune-mod-1.99.1-patched/datfiles/off/Makefile Sat Dec 11 23:20:59 2004
@@ -39,5 +39,5 @@
for i in $(OCOOKIES) ; \
do install -m 0644 $$i $$i.dat $(OCOOKIEDIR) || exit $$? ; \
- cp -d $$i.u8 $(OCOOKIEDIR) ; \
+ cp -R $$i.u8 $(OCOOKIEDIR) ; \
done

diff -ru2N --exclude=.DS_Store fortune-mod-1.99.1/fortune/fortune.c fortune-mod-1.99.1-patched/fortune/fortune.c
--- fortune-mod-1.99.1/fortune/fortune.c Fri Mar 5 08:29:56 2004
+++ fortune-mod-1.99.1-patched/fortune/fortune.c Fri Dec 10 16:22:22 2004
@@ -98,5 +98,5 @@

#define PROGRAM_NAME "fortune-mod"
-#define PROGRAM_VERSION "9708"
+#define PROGRAM_VERSION "1.99.1"

#ifdef HAVE_STDBOOL_H
@@ -258,4 +258,5 @@
int add_dir(register FILEDESC *);

+const char *program_name;
char *program_version(void)
{
@@ -1676,4 +1677,5 @@
char *ctype, *crequest;
getargs(ac, av);
+ program_name = (char *const) av[0];

outer = recode_new_outer(true);
@@ -1682,6 +1682,9 @@
setlocale(LC_ALL,"");
ctype = nl_langinfo(CODESET);
- if(strcmp(ctype,"ANSI_X3.4-1968") == 0)
- ctype="ISO-8859-1";
+ if (!ctype || !*ctype)
+ ctype="C"; /* revert to C if no valid envvars! */
+ else
+ if(strcmp(ctype,"ANSI_X3.4-1968") == 0)
+ ctype="ISO-8859-1";

crequest = malloc(strlen(ctype) + 7 + 1);
diff -ru2N --exclude=.DS_Store fortune-mod-1.99.1/util/rot.c fortune-mod-1.99.1-patched/util/rot.c
--- fortune-mod-1.99.1/util/rot.c Fri Mar 5 08:29:57 2004
+++ fortune-mod-1.99.1-patched/util/rot.c Fri Dec 10 13:29:00 2004
@@ -6,4 +6,5 @@
#include
#include
+#include

int main(void)
diff -ru2N --exclude=.DS_Store fortune-mod-1.99.1/util/unstr.c fortune-mod-1.99.1-patched/util/unstr.c
--- fortune-mod-1.99.1/util/unstr.c Fri Mar 5 08:29:57 2004
+++ fortune-mod-1.99.1-patched/util/unstr.c Fri Dec 10 13:28:45 2004
@@ -97,4 +97,5 @@
#include
#include
+#include

#ifndef MAXPATHLEN

fortune-mod _unstable_ port .patch