# [CFT] games/ofortune (or: what the hell?)



## fonz (Dec 5, 2013)

When I opened my inbox this morning I found a typical WTF thread: the (hardly) "offensive" fortune cookies have been kicked out of 10-BETA4. Since I (and many others) find this Just Plain Stupid (tm) I created a port to bring some sanity back into fortune(6). Anyone running FreeBSD 10-BETA4 feel free to test the port and comment on it before I file the PR asking for it to be committed.

A shar "patch" can be found here:  http://www.skysmurf.nl/comp/FreeBSD/files/ofortune.shar. Or alternatively, a tarball can be found in the same place: http://www.skysmurf.nl/comp/FreeBSD/fil ... une.tar.gz.

To extract the shar file:
`# cd /usr/ports/games`
`# sh /path/to/shar-file`

Or alternatively, to extract the tarball:
`# cd /usr/ports/games`
`# tar xzvf /path/to/tarball`

Install via your favourite method, e.g.
`# cd /usr/ports/games/ofortune`
`# make install`
or
`# portmaster games/ofortune`

Pending issues:


It's tentatively called ofortune. If you can think of a better name, then by all means shoot.
The accompanying webpage is crap. This is no priority 
 I have found the instructions for changing and/or adding to the fortune files but haven't tested them yet.
I wanted to mark the port as IGNORE for versions of FreeBSD prior to 10-BETA4. But this breaks stuff (see point 6) and I need to know exactly what the version number (OSVERSION) is for 10-BETA4.
Currently the port installs the "offensive" fortunes into /usr/local/share/ofortune, requiring every user to add that directory to their FORTUNE_PATH (hence the pkg-message). I tried adding an OPTION that would install it into the base /usr/share/games/fortune, but that again breaks stuff, see point 6.
It appears that for some reason conditionals don't work in the Makefile. For your reference, I have added the Makefile below, with the parts commented out that I think should work but don't. In both cases I get "Malformed conditional" errors. Any thoughts?


```
# $FreeBSD$

PORTNAME=       ofortune
PORTVERSION=    0.99.0
CATEGORIES=     games
MASTER_SITES=   http://www.skysmurf.nl/comp/FreeBSD/distfiles/

MAINTAINER=     freebsd@skysmurf.nl
COMMENT=        The offensive fortune cookies that used to be in base.

###
# This is supposed to work but doesn't.
###
#OPTIONS_DEFINE=        BASE
#OPTIONS_DEFAULT=
#BASE_DESC=     To install into the base system rather than /usr/local.
#
#.include <bsd.port.options.mk>
#
#.if ${PORT_OPTIONS:BASE}
#DATADIR=       /usr/share/games/fortune
#.else
PLIST_DIRS=     ${DATADIR}
#.endif

PLIST_FILES=    ${DATADIR}/fortunes-o \
                ${DATADIR}/fortunes-o.dat \
                ${DATADIR}/murphy-o \
                ${DATADIR}/murphy-o.dat

NO_BUILD=       yes
NO_INSTALL=     yes

###
# This is supposed to work but doesn't.
#
# 702106 has been copied from an example, I need the right number for 10-BETA4.
#
#.if ${OSVERSION} < 702106
#IGNORE=         For versions prior to 10-BETA4 this is still in base.
#.endif
###

post-install:
        ${MKDIR} ${STAGEDIR}${DATADIR}
        ${INSTALL_DATA} ${WRKSRC}/* ${STAGEDIR}${DATADIR}

.include <bsd.port.mk>
```


----------



## Beastie (Dec 6, 2013)

Yep, there was a thread about it some time ago. Thanks for creating that new port; although I don't use Fortune, I still appreciate your initiative for the principle.



			
				fonz said:
			
		

> If you can think of a better name, then by all means shoot.


xxxfortune §e


----------



## fonz (Dec 6, 2013)

Beastie said:
			
		

> fonz said:
> 
> 
> 
> ...


Nice one  :h But it's probably going to be misc/fortune-mod-offensive. There are already a couple of fortune(6) ports so it's probably best to follow the pattern.


----------



## bkouhi (Dec 6, 2013)

Hi again,

In this part of Makefile:


```
.if ${PORT_OPTIONS:BASE}
DATADIR=       /usr/share/games/fortune
...
```

I think it should be:

```
.if ${PORT_OPTIONS:MBASE}
DATADIR=       /usr/share/games/fortune
```

:M is a modifier and it is described in the make(1) manual page.


----------



## fonz (Dec 8, 2013)

bkouhi said:
			
		

> :M is a modifier and it is described in the make(1) manual page.


You're quite right. I had been staring at that file so much I didn't see it anymore. Thanks!


----------

