[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[leafnode-list] Re: Meaning of --localstatedir when compiling leafnode?2?

On Thu-2009/04/02-21:48 Adam Funk wrote:

> I'm about to compile leafnode-2.0.0.alpha20090324a+luascript to
> replace the leafnode Ubuntu package (1.11.7) I'm currently running.

Please wait until the upcoming bugfix release comes out.
"alpha20090324a" contains at least two bugs that have been fixed in the
past few days.

> What does the configure option --localstatedir do, if I also use
> "--enable-spooldir=/var/spool/news"?  Anything?

Never noticed this option before, but a quick grep(1) of "./configure"
indicates the value of this option to be the directory beneath of which
"spool/leafnode" is created.  I always use "./configure --enable-lua
--enable-spooldir=/var/spool/news" to set this up the way I want.  The
default now is "/var/spool/leafnode".  "--localstatedir" sets the "/var"
part of this.

> (I'm planning to uninstall the Ubuntu package, compile with
> "--prefix=/usr/local --sysconfdir=/etc/news/leafnode2", and put the
> cron jobs and config files back in with appropriate modifications.
> I've seen the instructions to run "make update" to upgrade the spool.
> If any of that sounds wrong, I wouldn't mind a heads-up.)

>From what I can see in "update.sh" this should work, but I never tried

> Also, I've installed the lua5.1 package (v. 5.1.3-1) in the standard
> (aptitude) way, but I still get this message when I run ./configure
> with "--enable-lua":
> No package 'lua' found
> Consider adjusting the PKG_CONFIG_PATH environment variable if you
> installed software in a non-standard prefix.
> Alternatively, you may set the environment variables LUA_CFLAGS and
> LUA_LIBS to avoid the need to call pkg-config.  See the pkg-config man
> page for more details.
> Any idea what I'm doing wrong?

I had this on freebsd until Matthias fixed it in the autotools.
I needed "LUA_CFLAGS='-I/l/include/lua51' LUA_LIBS='-L/l/lib/lua51 -llua
-lm' CFLAGS='-O -I/l/include' LDFLAGS='-L/l/lib -lpcre' ./configure
--enable-lua --enable-spooldir=/var/spool/news" (all on one line).

Note for actually running the stock lua functions, you need to set the
path where fetchnews/leafnode+lua find "ln2_distmod.lua".  This is Lua
code making the raw Lua callouts within fetchnews/leafnode into
something usable for filtering and statistics.  It is a module
configured by "scripthooks.lua" and gets "required" from there.  Samples
of the Lua-code gets installed into the $sysconfdir, which defaults to

If you don't have any other Lua modules, you can write:  ``env
LUA_PATH="/etc/leafnode/?.lua;;" /l/sbin/fetchnews'' into your cronjob.

I'm afraid the Lua in these files has "grown" to be far from
aesthetically pleasing, it is way too chatty and does things propably
nobody needs, like eg. tallying upper- vs. lowercase characters (for
down scoring shouting) or counting the number of ">" characters in
body-lines (for down scoring articles containing one line of insult and
five screenfulls of useless citations).  All this can be switched off,
but it is still there.

Also, if you want to run bogofilter on incoming articles, you obviously
need bogofilter and a bayes database, preferably different from the one
used for emails.  For other spam filtering tools, the bayes hook
function might even need to be changed.  Currently, one configures the
filter-program with all the options needed and its output for ham and
spam as Lua regular expressions.

Feel free to ask, the Lua scripting is my baby.


leafnode-list mailing list