LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-19-2006, 03:36 PM   #16
theoffset
Member
 
Registered: Aug 2005
Location: Guadalajara, Jal, Mexico
Distribution: Slackware Linux
Posts: 211

Rep: Reputation: 31

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...)

Last edited by theoffset; 05-19-2006 at 03:37 PM.
 
Old 05-20-2006, 02:09 AM   #17
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Original Poster
Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
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...
 
Old 05-20-2006, 01:05 PM   #18
theoffset
Member
 
Registered: Aug 2005
Location: Guadalajara, Jal, Mexico
Distribution: Slackware Linux
Posts: 211

Rep: Reputation: 31
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
 
Old 05-25-2006, 02:39 PM   #19
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Original Poster
Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
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.
 
Old 06-18-2006, 10:57 AM   #20
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Original Poster
Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
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.
 
Old 06-18-2006, 09:27 PM   #21
theoffset
Member
 
Registered: Aug 2005
Location: Guadalajara, Jal, Mexico
Distribution: Slackware Linux
Posts: 211

Rep: Reputation: 31
Quote:
Originally Posted by gnashley
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.

Last edited by theoffset; 06-18-2006 at 09:28 PM.
 
Old 06-19-2006, 01:07 AM   #22
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Original Poster
Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Sorry, been trying to get 3 weeks of work synced:

http://distro.ibiblio.org/pub/linux/...afx-i486-2.tgz

Thanks for all your help!
 
Old 06-19-2006, 12:14 PM   #23
theoffset
Member
 
Registered: Aug 2005
Location: Guadalajara, Jal, Mexico
Distribution: Slackware Linux
Posts: 211

Rep: Reputation: 31
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.

Last edited by theoffset; 06-19-2006 at 12:17 PM.
 
Old 06-19-2006, 03:24 PM   #24
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Original Poster
Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Thanks. I'll check on it tomorrow.
 
Old 06-28-2006, 06:46 AM   #25
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Original Poster
Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
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.
 
Old 06-29-2006, 07:46 PM   #26
theoffset
Member
 
Registered: Aug 2005
Location: Guadalajara, Jal, Mexico
Distribution: Slackware Linux
Posts: 211

Rep: Reputation: 31
Hey! It works!

Thank you for all the trouble .

I didn't expected it to be that hard to package.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot find 2.6.12-6 kernel packages aes canis Ubuntu 1 09-01-2005 12:14 AM
can't find packages! [IT04]Nemo Linux - Newbie 3 03-02-2005 03:29 PM
Cant find packages dangerousdave Linux - Newbie 3 02-14-2005 07:06 PM
Can't find install packages Linok Mandriva 5 08-01-2004 09:06 PM
urpmi can't find packages eahogue Linux - Software 3 10-16-2003 06:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration