SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hey! It's working really nice! And is using the opening-books!
The only thing which doesn't works is learning, and it's not that important It won't learn that much anyway unless you're rated +2100.
To enable learning you'd have to add two writable files for everyone (or to a group, and add yourself to that group) at /usr/share/crafty/books/ called book.lrn and position.bin... but if you ask me, that would be a Bad Idea too (just as bad as my Bad Idea of having /usr/share/crafty world-writable ).
It could happen that crafty has some nasty security-error which could be triggered with a bad-formatted learning file... of course, the risk is minimized if Crafty isn't run as root, but if you really want learning you could just make a group or give world writting permissions to that file.
Other than that it's working just as it should! Thanks!
(Note, I didn't test the rc file thing, I also think that it's likely not going to work...)
Thank you for the suggestion, help and testing. One I noticed, when I had it installed with the .bin files in /usr/share/crafty (no books subdir) it generates the .lrn and position files there when you run it.
But with the .bin files in a books subdirectory it will generate learn and position files in both directories. Are these supposed to be global/common files?
The logfiles and all personal stuff *should* have gone in the users HOME directory, but the code doesn't seem to allow for this. I mean I don't think that ~/ will work. Can you look at the defines in chess.h (+- line 130) and see what you think? Seems to me the code would need getenv calls to use personal rc and gamelog files properly located in the users home directory. Lacking that, the only thing to do is lump all generated files in some sane place.
I'm gonna have another at LFSH over this one...
Nope, it will not work, since neither glibc nor the kernel expand "~" to $HOME, but...
I just checked the Crafty changelog (in main.c) and saw that it looks for enviroment variables called CRAFTY_TB_PATH, CRAFTY_BOOK_PATH, CRAFTY_LOG_PATH and CRAFTY_RC_PATH, since version 16.5.
so I made a sketch of how a crafty wrapper should look (I'm not running linux, so I can't totaly test it):
/usr/bin/crafty:
Code:
#!/bin/bash
# crafty - wrapper around Crafty.
if [ ! -e $HOME/.crafty ]; then
mkdir -p $HOME/.crafty/log
else
if [ -e $HOME/.crafty/books ]; then
export CRAFTY_BOOK_PATH=$HOME/.crafty/books
fi
if [ -e $HOME/.crafty/TB ]; then
export CRAFTY_TB_PATH=$HOME/.crafty/TB
fi
fi
export CRAFTY_LOG_PATH=$HOME/.crafty/log
export CRAFTY_RC_PATH=$HOME/.crafty
#Run the real crafty here
crafty-run
The real executable should, obviously, be installed as crafty-run (or something else, just change the script)
It should allow a user to have the log of its files under ~/.crafty/log, have a custom rc file under ~/.crafty and, if so he wants to, have a custom opening-book under ~/.crafty/books and install EGTBs for himself under ~/.crafty/TB
Thanks for that, I haven't had a chance to try it yet as I'm on another 'hot trail' the last few days -working on a GNOME-compat package group and PkgBuild itself. Funny, you mentioned slackomatic and I had an e-mail from the developer a few days ago.
Great news! That did the trick. Crafty now creates game files and logs in the user home directory.
I've updated the PkgBuild script and Binary package to include a wrapper for crafty which sets up the environment and suppressed completely the creation of any log directory under /var.
I know you said it doesn't really matter, but if you know of some config change which can be set in the .craftyrc and that you can tell whether it works or not, then try the settings to make sure the RC DIR is getting set correctly to ~/.crafty/.craftyrc
Nice little game! It even got me playing for a few minutes -that makes nearly 3 hours I've spent playing computer games since 1979...
Be sure and read the new README. I'd love to give you credit by name and include your e-mail address if you want.
Great news! That did the trick. Crafty now creates game files and logs in the user home directory.
I've updated the PkgBuild script and Binary package to include a wrapper for crafty which sets up the environment and suppressed completely the creation of any log directory under /var.
Sounds great! Glad you got it finally working.
But I can't seem to find the binary package anywhere under http://distro.ibiblio.org/pub/linux/...load/Packages/ (I did checked out the PkgBuild, though). Maybe you haven't uploaded it yet?
Quote:
I'd love to give you credit by name and include your e-mail address if you want.
Sure, no problem:
My real name's Ismael Cortés and my e-mail is the same that's shown under my public profile as MSN handle (I think it should be harder for spammers to find it there than if posted it here)
The .craftyrc seems to get detected without troubles. Just did a very quick test, though.
Hold on! I tested as root, that's why it worked but as a normal user it won't work.
It looks like the $HOME variable is being expanded at package-time instead of run-time. You'll need to escape the "$" in the build script (or have the script in separate file and just copy it inside the package), otherwize when playing as a user it will try to use/create /root/.crafty/log where an user obviously have no permissions.
Sorry this package had to be such a pain in the ass to make.
Finally got back to this, and as far as I can see everything is finally working.
The stable package is crafty-20.1afx-i486-5.tgz and the source directory has been updated with the new build script.
You didn't say if you had tried building this with PkgBuild. I've released a new version, but older scripts are still compatible.
I've left the xboard-crafty wrapper apart in the Resources directory, but the wrapper for crafty itself should be part of the script since it is essential for it to work correctly.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.