[Users] Better defaults for clawsker

H.Merijn Brand h.m.brand at xs4all.nl
Mon Dec 31 14:21:50 CET 2018


On Sun, 23 Dec 2018 11:38:45 +0100, Ricardo Mones <ricardo at mones.org>
wrote:

> On Fri, 21 Dec 2018 21:51:09 +0100
> "H.Merijn Brand" <h.m.brand at xs4all.nl> wrote:
> 
> > Now simpler and without syntax error  
> 
> Added to master, thanks! :-)

👍

A few more remarks

• hashbang

  clawsker starts with "#!/usr/bin/perl -w", which will horribly fail
  on all systems where "perl"'s $PATH is not /usr/bin, as it it is
  likely not the perl where the required modules are installed.

  Many other parts of clawsker are more or less dynamic and changed by
  the make process (e.g. @PREFIX@)

  $ perl -V:startperl
  startperl='#!/pro/bin/perl';

  might be a start to create a clawsker that runs correct in the users
  environment

  I would suggest changing the Makefile:

	sed -e "s, at PREFIX@,${PREFIX},;s, at LIBDIR@,${LIBDIR},;s, at VERSION@,${VERSION},;s, at DATADIR@,${DATADIR}," < ${NAME} > build/${NAME}

  →

	perl -MConfig -p -e'1..1 and s/.*/$$Config{startperl}/;' \
		-e's,\@PREFIX\@,${PREFIX},;' \
		-e's,\@LIBDIR\@,${LIBDIR},;' \
		-e's,\@VERSION\@,${VERSION},;' \
		-e's,\@DATADIR\@,${DATADIR},' ${NAME} > build/${NAME}.2

  and add "use warnings;" below "use strict;" in clawsker itself to
  compensate for the old-fashioned -w

• PREFIX

  Again, I don't think /usr/local is a good default. The script itself
  uses the File::Which module to find out, so why not use the same for
  the transistion?

  PREFIX ?= /usr/local

  →

  PREFIX ?= $(shell perl -MFile::Which -E'say which ("claws-mail") =~ s{/[^/]+\z}{}r')

  or

  PREFIX ?= $(shell which claws-mail | perl -pe's{/[^/]+\z}{}')

-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.29   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/        http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.claws-mail.org/pipermail/users/attachments/20181231/2083d245/attachment.sig>


More information about the Users mailing list