* Use arc4random(), since tfconfig can't deal with linker warnings.

* Unobfuscate the symlink list.
* Drop groff dependency.
* Regen PLIST.

ok stsp@, sthen@
This commit is contained in:
naddy 2013-08-15 14:54:07 +00:00
parent e30a0b812d
commit 7e0417db37
4 changed files with 66 additions and 18 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.26 2013/03/11 11:35:57 espie Exp $
# $OpenBSD: Makefile,v 1.27 2013/08/15 14:54:07 naddy Exp $
COMMENT= programmable MUD client, with macro support and more
PKGNAME= tinyfugue-4.0s1
REVISION= 3
REVISION= 4
DISTNAME= tf-40s1
CATEGORIES= net games
@ -27,23 +27,27 @@ MAKE_ENV= TFVER="${DISTNAME:S/^tf-//}" \
MAKE_FILE= ${WRKSRC}/unix/Makefile
USE_GROFF = Yes
NO_TEST= Yes
SYMLINKS= kb-bash.tf,bind-bash.tf kb-emacs.tf,bind-emacs.tf \
complete.tf,completion.tf factoral.tf,factorial.tf \
filexfer.tf,file-xfer.tf local-eg.tf,local.tf.sample \
psh.tf,pref-shell.tf spc-page.tf,space_page.tf \
spedwalk.tf,speedwalk.tf stack-q.tf,stack_queue.tf \
world-q.tf,worldqueue.tf
SYMLINKS= kb-bash.tf bind-bash.tf \
kb-emacs.tf bind-emacs.tf \
complete.tf completion.tf \
factoral.tf factorial.tf \
filexfer.tf file-xfer.tf \
local-eg.tf local.tf.sample \
psh.tf pref-shell.tf \
spc-page.tf space_page.tf \
spedwalk.tf speedwalk.tf \
stack-q.tf stack_queue.tf \
world-q.tf worldqueue.tf
do-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/tinyfugue
${INSTALL_PROGRAM} ${WRKBUILD}/src/tf ${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/src/tf.1.nroffman ${PREFIX}/man/man1/tf.1
${INSTALL_DATA} ${WRKSRC}/tf-lib/* ${PREFIX}/share/tinyfugue
.for i in ${SYMLINKS}
ln -s ${i:C/,.*//} ${PREFIX}/share/tinyfugue/${i:C/.*,//}
.for source target in ${SYMLINKS}
ln -s ${source} ${PREFIX}/share/tinyfugue/${target}
.endfor
.include <bsd.port.mk>

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-src_port_h,v 1.1 2013/08/15 14:54:07 naddy Exp $
--- src/port.h.orig Sun Aug 11 22:56:24 2013
+++ src/port.h Sun Aug 11 23:00:53 2013
@@ -246,7 +246,11 @@ extern char *sys_errlist[];
* not agree with RAND_MAX. We must not link with -lucb.
*/
-#ifdef HAVE_srandom
+#if defined(HAVE_arc4random) && defined(HAVE_arc4random_uniform)
+# define RAND() arc4random()
+# define SRAND(seed) /* empty */
+# define RRAND(lo,hi) (arc4random_uniform((hi)-(lo)) + (lo))
+#elif defined(HAVE_srandom)
# include <math.h>
# define RAND() (int)random()
# define SRAND(seed) srandom(seed)
@@ -262,7 +266,7 @@ extern char *sys_errlist[];
# define RRAND(lo,hi) (RAND() % ((hi)-(lo)+1) + (lo))
# endif
# else
- error "Don't have srand() or srandom()."
+# error "Don't have srand() or srandom()."
# endif
#endif

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-unix_tfconfig,v 1.1 2000/09/20 22:42:12 avsm Exp $
--- unix/tfconfig.orig Fri Apr 4 11:51:58 1997
+++ unix/tfconfig Mon Jun 16 18:00:45 1997
@@ -211,17 +211,17 @@
$OpenBSD: patch-unix_tfconfig,v 1.2 2013/08/15 14:54:07 naddy Exp $
--- unix/tfconfig.orig Sun Aug 11 22:53:07 2013
+++ unix/tfconfig Sun Aug 11 22:55:49 2013
@@ -223,17 +223,17 @@ fi
echo
echo 'To change these locations type "n" now and edit the unix/Config file.'
@ -29,4 +29,23 @@ $OpenBSD: patch-unix_tfconfig,v 1.1 2000/09/20 22:42:12 avsm Exp $
+# done
echo; echo
echo "#define LIBDIR \"${LIBDIR}\"" >&4
rm -f ../src/Makefile ${AOUT}
@@ -561,6 +561,8 @@ int main() {
raise(0);
setlocale(0, "C");
sigaction(0, NULL, NULL);
+ arc4random();
+ arc4random_uniform(0);
srand(0);
srandom(0);
strcasecmp(NULL, NULL);
@@ -613,7 +615,8 @@ fi
for sym in \
bcopy bsearch bzero connect fileno getcwd gethostbyname getpwnam \
gettimeofday getwd h_errno hstrerror index kill memcpy memset raise \
- setlocale sigaction srand srandom strcasecmp strchr strcmpi strcspn \
+ setlocale sigaction arc4random arc4random_uniform srand srandom \
+ strcasecmp strchr strcmpi strcspn \
strerror strftime stricmp strstr strtod strtol tzset waitpid
do
if egrep "(^|[^a-z_])_?_?${sym}([^a-z]|\$)" symtest.out >/dev/null; then

View File

@ -1,5 +1,5 @@
@comment $OpenBSD: PLIST,v 1.8 2004/09/15 18:17:46 espie Exp $
bin/tf
@comment $OpenBSD: PLIST,v 1.9 2013/08/15 14:54:07 naddy Exp $
@bin bin/tf
@man man/man1/tf.1
share/tinyfugue/
share/tinyfugue/README