rpm for newLISP 8.0

Started by nigelbrown, March 18, 2004, 03:28:14 PM

Previous topic - Next topic

Lutz

#15
Excellent, thankou very much



Lutz

nigelbrown

#16
Here is man page updated to express -e option and -p behaviour with lisp-files better (I hope). Note if copying from forum some leading spaces may be inserted (they were when I copied from KDE Konqueror to GVim) that need to be removed for man to interpret file properly.



.TH newlisp 1 "April 1, 2004" "version 8.0.0" "USER COMMANDS"

.SH NAME

newlisp - lisp dialect interpreter

.SH SYNOPSIS

.B newlisp

[-h] [-s stacksize] [-m max-mem-megabyte] [[-l | -L] [-p port-number | -d port-number]] [lisp-files ...] [-e programtext]

.SH DESCRIPTION

Invokes the newLisp lisp interpreter which first interprets init.lsp if present. If a port was specified the port is opened to accept connection and when a connection is first made any specified commandline lisp-files will be executed before accepting text from the port connection. If no port was specified then any lisp-files are immediately interpreted. If a -e switch is used the programtext is interpreted and then newlisp exits otherwise interpretation continues interactively.

.SH OPTIONS

.TP

-h

display a short help text

.TP

-s stacksize

stack size to use when starting newLISP. When no stack size is specified the stack defaults to 1024.

.TP

-m max-mem-megabyte

Limits memory to max-mem-megabyte megabytes for LISP cell memory.

.TP

-e programtext

programtext is an expression enclosed in quotation marks which is evaluated and the result printed to standard out device (STDOUT). In most UNIX system shells apostrophes can also be used to delimit the expression.

.TP

-l -L

Logs the port connection, use the -l or -L option together with the -p or -d option. This registers time and IP number of the connecting client in file newlisp-log.txt. When using -L all remote commands received are also logged. If the logfile newlisp-log.txt already exists, new content is appended; otherwise newlisp-log.txt is created.

.TP

-p port-number

Listen for commands on a TCP/IP socket connection. In this case standard I/O is redirected to the port specified in the -p option. Any specified lisp-files will be interpreted the first time a connection is made, that is, before text is accepted from the port connection.

 

.TP

-d port-number somefile.lsp

Run in demon mode. As for the -p option, but newLISP does not exit after a closed connection and stays in memory listening for a new connection.

.SH EXAMPLES

.TP

Start interactive session

.B newlisp

.PP

.TP

Add 3 and 4, 7 prints on standard output

.B newlisp

-e "(+ 3 4)"

.PP

.TP

newLISP is started as a server (the & indicates to LINUX to run the process in the background) and can be connected to with telnet by issuing telnet localhost 1234

.B newlisp

-p 1234 &

.PP

.SH EXIT STATUS

newlisp returns a zero exist status for normal exit unless exit command specifies a code to be returned. Non zero is returned in case of abnormal exit.

.SH AUTHOR

Lutz Mueller (contact (at) nuevatec.com)

.SH SEE ALSO

newlisp-tk(1)

Lutz

#17
Usage of some.lsp after the port options is possible but I wonder if it makes much sense and if it should be documented. This is what I do now in the manual:



>>>>

newlisp some.lsp -p 9090



The example shows how newLISP can listen for commands on a TCP/IP socket connection. In this case standard I/O is redirected to the port specified in the -p option. some.lsp is an optional file to be loaded during startup and before listening for a connection.

>>>>



Lutz

Lutz

#18
and this is what I have now at the beggining of the commandline/options chapter:



>>>

When starting newLISP from the command line, one or more options and one or more newLISP source files can be specified. The options and source files are executed in the sequence they appear. For some options is makes sense to have source files loaded first like for the -p and -d options. For other options like -s and -m it is logical to specify these before the source files to be loaded.

>>>



perhaps we can put something similar in the the man page?



Lutz

nigelbrown

#19
Done. Are the comments on exit codes correct? Is the e-mail address the one you want?

Man file:



.TH newlisp 1 "April 1, 2004" "version 8.0.0" "USER COMMANDS"

.SH NAME

newlisp - lisp dialect interpreter

.SH SYNOPSIS

.B newlisp

[-h] [-s stacksize] [-m max-mem-megabyte] [[-l | -L] [-p port-number | -d port-number]] [lisp-files ...] [-e programtext]

.SH DESCRIPTION

Invokes the newLisp lisp interpreter which first interprets init.lsp if present. Then one or more options and one or more newLISP source files can be specified. The options and source files are executed in the sequence they appear. For some options is makes sense to have source files loaded first like for the -p and -d options. For other options like -s and -m it is logical to specify these before the source files to be loaded. If a -e switch is used the programtext is interpreted and then newlisp exits otherwise interpretation continues interactively (unless an exit occurs during lisp-file interpretation).

.SH OPTIONS

.TP

-h

display a short help text

.TP

-s stacksize

stack size to use when starting newLISP. When no stack size is specified the stack defaults to 1024.

.TP

-m max-mem-megabyte

Limits memory to max-mem-megabyte megabytes for LISP cell memory.

.TP

-e programtext

programtext is an expression enclosed in quotation marks which is evaluated and the result printed to standard out device (STDOUT). In most UNIX system shells apostrophes can also be used to delimit the expression. Newlisp exits after interpretation of programtext is complete.

.TP

-l -L

Logs the port connection, use the -l or -L option together with the -p or -d option. This registers time and IP number of the connecting client in file newlisp-log.txt. When using -L all remote commands received are also logged. If the logfile newlisp-log.txt already exists, new content is appended; otherwise newlisp-log.txt is created.

.TP

-p port-number

Listen for commands on a TCP/IP socket connection. In this case standard I/O is redirected to the port specified in the -p option. Any specified lisp-files will be interpreted the first time a connection is made, that is, before text is accepted from the port connection.



.TP

-d port-number

Run in demon mode. As for the -p option, but newLISP does not exit after a closed connection and stays in memory listening for a new connection.

.SH EXAMPLES

.TP

Start interactive session

.B newlisp

.PP

.TP

Add 3 and 4, 7 prints on standard output

.B newlisp

-e "(+ 3 4)"

.PP

.TP

newLISP is started as a server (the & indicates to LINUX to run the process in the background) and can be connected to with telnet by issuing telnet localhost 1234

.B newlisp

-p 1234 &

.PP

.SH EXIT STATUS

newlisp returns a zero exist status for normal exit unless exit command specifies a code to be returned. Non zero is returned in case of abnormal exit.

.SH AUTHOR

Lutz Mueller (contact (at) nuevatec.com)

.SH SEE ALSO

newlisp-tk(1)

Lutz

#20
Thankyou very much Nigel, very clearly understandable, I will sync the manual description to this.



Lutz

nigelbrown

#21
A progress report on the rpm (I've learnt a lot!):

I've got the build from source going - I just have to get the install to directories part right.

Slight mods were:

1) To keep the rpm process close to the example I've re bziped the sources into newlisp-8.0.0-0.rc1.tar.bz2 that has newlisp-8.0.0 as the base directory.

2) altered the makefile file so the install destination directories are not hard coded but can be set from the commandline. This enables rpm to create a local install in a user subdirectory which is then used to create the .rpm.

The make install done by the rpm builder is:

+ make prefix=/home/nigel/rpm/tmp/newlisp-8.0.0-0.rc1-buildroot/usr exec_prefix=/home/nigel/rpm/tmp/newlisp-8.0.0-0.rc1-buildroot/usr bindir=/home/nigel/rpm/tmp/newlisp-8.0.0-0.rc1-buildroot/usr/bin sbindir=/home/nigel/rpm/tmp/newlisp-8.0.0-0.rc1-buildroot/usr/sbin sysconfdir=/home/nigel/rpm/tmp/newlisp-8.0.0-0.rc1-buildroot/etc datadir=/home/nigel/rpm/tmp/newlisp-8.0.0-0.rc1-buildroot/usr/share includedir=/home/nigel/rpm/tmp/newlisp-8.0.0-0.rc1-buildroot/usr/include libdir=/home/nigel/rpm/tmp/newlisp-8.0.0-0.rc1-buildroot/usr/lib libexecdir=/home/nigel/rpm/tmp/newlisp-8.0.0-0.rc1-buildroot/usr/lib localstatedir=/home/nigel/rpm/tmp/newlisp-8.0.0-0.rc1-buildroot/var/lib sharedstatedir=/home/nigel/rpm/tmp/newlisp-8.0.0-0.rc1-buildroot/usr/com mandir=/home/nigel/rpm/tmp/newlisp-8.0.0-0.rc1-buildroot/usr/share/man infodir=/home/nigel/rpm/tmp/newlisp-8.0.0-0.rc1-buildroot/usr/share/info install



This could probably be changed but I'm trying to stick to the example.

I'm working on the %makeinstall and %files at the moment.

I hope to have newlisp-8.0.0-0.rc1.rpm in a few days, I keep you updated.



PS If anyone is interested my newlisp.spec file is:

%define name    newlisp

%define version 8.0.0

%define release 0.rc1



Name:           %{name}

Summary:        Interpreter of a lisp dialect

Version:        %{version}

Release:        %{release}

Source0:        http://nuevatec.com/download/%25%7Bname%7D-%25%7Bversion%7D-%25%7Brelease%7D.tar.bz2">http://nuevatec.com/download/%{name}-%{ ... e}.tar.bz2">http://nuevatec.com/download/%{name}-%{version}-%{release}.tar.bz2

URL:            http://www.newlisp.org/">http://www.newlisp.org/

Group:          Development/Other

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot

License:        GPL

Requires:       readline



%description

Interpreter for newlisp dialect of lisp. Can run from interactive console input, listening on a port, or interpret lisp source code files or commandline specified source text.

%prep

%setup -q  



%build

 

%make linux



%install

rm -rf $RPM_BUILD_ROOT

%makeinstall



%clean

rm -rf $RPM_BUILD_ROOT



%files

%defattr(-,root,root,0755)

%doc LOCALIZATION CHANGES COPYING CREDITS newlisp_manual.html

%{_mandir}/man1/newlisp.1*

%{_mandir}/man1/newlisp-tk.1*

%{_bindir}/newlisp

%{_datadir}/newlisp/init.lsp

%{_datadir}/newlisp/cgi.lsp

%{_datadir}/newlisp/ftp.lsp

%{_datadir}/newlisp/hash.lsp

%{_datadir}/newlisp/infix.lsp

%{_datadir}/newlisp/mysql.lsp

%{_datadir}/newlisp/odbc.lsp

%{_datadir}/newlisp/pop3.lsp

%{_datadir}/newlisp/sqlite.lsp

%{_datadir}/newlisp/stat.lsp

%{_datadir}/newlisp/txt2pdf.lsp

%{_datadir}/newlisp/link.lsp

%{_datadir}/newlisp/newlisp-tk/*



%changelog

* Thu Apr 01 2004 Nigel Brown <n.brown@tpg.com.au> 8.0.0-0.rc1

- First rpming

Lutz

#22
A RPM made will only beusable for certaind distributions or for various/all?



Some directories are the same on all distributions like /usr/bin?, I don't know about doc, man, share etc.. I thought the LSB (Linux Standard Base) had done something about this by now, but I am not sure.



The Makefile as it is is easily understandable and can be modified even by one who only knows little about scripting. If the RPMs need a more elaborate one, I suggest we have a different one for the RPMs



Lutz

nigelbrown

#23
I will aim to have the rpm generic i586 LSB and will adjust the .spec etc

newlisp-8.0.0-1.i586.rpm rather than mandrake by name

newlisp-8.0.0-1mdk.i586.rpm.



 regarding directories, Mandrake recommends the LSB set out viz.

the mandrake rpm howto references this site http://www.pathname.com/fhs/">http://www.pathname.com/fhs/ that is:

"Filesystem Hierarchy Standard

Introduction

This page is the home of the Filesystem Hierarchy Standard (FHS).



The current version is 2.3. It was announced on January 29, 2004.



The filesystem standard has been designed to be used by Unix distribution developers, package developers, and system implementors. However, it is primarily intended to be a reference and is not a tutorial on how to manage a Unix filesystem or directory hierarchy. "



This is LSB I believe as one site says "For more information about the Linux directory structure see the Filesystem Hierarchy Standard (FHS) which is part of the Linux Standard Base (LSB)."

 newlisp follows it by having the binary in /usr/bin and fixed data (the init and lisp modules)  in /usr/share/newlisp and docs in /usr/share/doc





The only makefile change has been to change the install section to use $(datadir) and $(bindir):



#changed for rpm building

# where "make install" puts stuff can be set on command line

ifndef datadir

datadir=/usr/share

endif

ifndef bindir

datadir=/usr/bin

endif



install:

   -install -d $(datadir)/doc/newlisp

   -install -d $(datadir)/newlisp/newlisp-tk/images

   -install -m 755 newlisp $(bindir)/newlisp

   -install -m 755 newlisp-tk/newlisp-tk.tcl $(bindir)/newlisp-tk

   -install -m 644 init.lsp $(datadir)/newlisp/init.lsp

   -install -m 644 examples/link.lsp $(datadir)/newlisp/link.lsp

   -install -m 644 modules/mysql.lsp $(datadir)/newlisp/mysql.lsp

   -install -m 644 modules/pop3.lsp $(datadir)/newlisp/pop3.lsp

   -install -m 644 modules/ftp.lsp $(datadir)/newlisp/ftp.lsp

   -install -m 644 modules/infix.lsp $(datadir)/newlisp/infix.lsp

   -install -m 644 modules/smtp.lsp $(datadir)/newlisp/smtp.lsp

   -install -m 644 modules/odbc.lsp $(datadir)/newlisp/odbc.lsp

   -install -m 644 modules/sqlite.lsp $(datadir)/newlisp/sqlite.lsp

   -install -m 644 modules/cgi.lsp $(datadir)/newlisp/cgi.lsp

   -install -m 644 modules/stat.lsp $(datadir)/newlisp/stat.lsp

   -install -m 644 modules/hash.lsp $(datadir)/newlisp/hash.lsp

   -install -m 644 modules/txt2pdf.lsp $(datadir)/newlisp/txt2pdf.lsp

   -install -m 644 doc/COPYING $(datadir)/newlisp/COPYING

   -install -m 644 doc/newlisp_manual.html $(datadir)/doc/newlisp/newlisp_manual.html

   -install -m 644 doc/newlisp_index.html $(datadir)/doc/newlisp/newlisp_index.html

   -install -m 644 doc/manual_frame.html $(datadir)/doc/newlisp/manual_frame.html

   -install -m 644 newlisp-tk/newlisp-tk.html $(datadir)/doc/newlisp/newlisp-tk.html

   -install -m 644 newlisp-tk/*.lsp $(datadir)/newlisp/newlisp-tk/

   -install -m 644 newlisp-tk/images/* $(datadir)/newlisp/newlisp-tk/images/



the original install could be left and an ifdef used to select this altered version to keep everything in one place perhaps.



Nigel

Lutz

#24
Thanks Nigel for all the work. Good to know, that the current directory structure is LSB compliant. On cf.sourcefogre.net I found out that RedHat, Debian and SuSe follow it, plus Mandrake, which I am running on my own computer. This makes me think, that everybody else does the same (1), because those mentioned are the leading  Linux distributions. FreeBSD at my ISP also does it, but I don't know if RPMs are used on BSD. Mac OSX/Darwin, I guess is different? I don't know, it is currently not accessable on sf.sourceforge.net.



Anyway, I think we can live with those two added definitions of $(datadir) and $(bindir) putting the defs directly in front of the install script, like in your example.



I already have setup up everything for 8.0 release tomorrow, but I think we can still do an RPM with a changed install-part in Makefile. I also included  newlisp.1 (with minusular changes) in 8.0.



Lutz



(1) what I mean is: /usr/bin, /usr/share and /usr/share/doc

nigelbrown

#25
Here's a quick man page on newlisp-tk as the only commandline arg is [lisp-file] from what I can see. However, the man page has  a 'see also' referencing a man page for newlisp-tk.config that would explain the settings (like the man page for smb.conf, do "man smb.conf" to see it).

Now that extra memory commandline switches would make sense as parameters to newlisp-tk could they be allowed for in a future release?

eg newlisp-tk -s 4000 -m 100

here is a proposed newlisp-tk man page (it says 'see also newlisp-tk.config' which has not yet had a man page done for it) - does the newlisp-tk script pass back any exit code? I presume it does?



.TH newlisp-tk 1 "April 1, 2004" "version 8.0.0" "USER COMMANDS"

.SH NAME

newlisp-tk - Tcl/Tk front end for newlisp lisp dialect interpreter

.SH SYNOPSIS

.B newlisp-tk

[lisp-file]

.SH DESCRIPTION

newLISP-tk adds multiple LISP -aware editors / browsers and a source code debugger. It also adds the possibility to make newLISP programs that draw graphics or show graphical widgets of the underlying operating system like buttons, text entries, list boxes, menus etc..

.SH OPTIONS

.TP

lisp-file

specify this lisp file as a parameter to newlisp when starting newlisp.

.SH EXAMPLES

.TP

Start GUI session

.B newlisp-tk

.PP

.TP

Load file then start GUI session

.B newlisp-tk

myfile.lsp

.SH EXIT STATUS

newlisp-tk returns a zero exist status for normal exit unless exit command specifies a code to be returned. Non zero is returned in case of abnormal exit.

.SH AUTHOR

Lutz Mueller (contact (at) nuevatec.com)

.SH SEE ALSO

newlisp-tk.config(1)

nigelbrown

#26
When doing the man page above I realised the newlisp man doesn't list [lisp-filess...] in the option section - so I've fixed that and added an example:



.TH newlisp 1 "April 1, 2004" "version 8.0.0" "USER COMMANDS"

.SH NAME

newlisp - lisp dialect interpreter

.SH SYNOPSIS

.B newlisp

[-h] [-s stacksize] [-m max-mem-megabyte] [[-l | -L] [-p port-number | -d port-number]] [lisp-files ...] [-e programtext]

.SH DESCRIPTION

Invokes the newLisp lisp interpreter which first interprets init.lsp if present. Then one or more options and one or more newLISP source files can be specified. The options and source files are executed in the sequence they appear. For some options is makes sense to have source files loaded first like for the -p and -d options. For other options like -s and -m it is logical to specify these before the source files to be loaded. If a -e switch is used the programtext is interpreted and then newlisp exits otherwise interpretation continues interactively (unless an exit occurs during lisp-file interpretation).

.SH OPTIONS

.TP

-h

display a short help text

.TP

-s stacksize

stack size to use when starting newLISP. When no stack size is specified the stack defaults to 1024.

.TP

-m max-mem-megabyte

Limits memory to max-mem-megabyte megabytes for LISP cell memory.

.TP

lisp-files

load and interpret the specified lisp source files in sequence. If an (exit) is executed by one of the source files then newlisp exits and all processing ceases.

.TP

-e programtext

programtext is an expression enclosed in quotation marks which is evaluated and the result printed to standard out device (STDOUT). In most UNIX system shells apostrophes can also be used to delimit the expression. Newlisp exits after interpretation of programtext is complete.

.TP

-l -L

Logs the port connection, use the -l or -L option together with the -p or -d option. This registers time and IP number of the connecting client in file newlisp-log.txt. When using -L all remote commands received are also logged. If the logfile newlisp-log.txt already exists, new content is appended; otherwise newlisp-log.txt is created.

.TP

-p port-number

Listen for commands on a TCP/IP socket connection. In this case standard I/O is redirected to the port specified in the -p option. Any specified lisp-files will be interpreted the first time a connection is made, that is, before text is accepted from the port connection.



.TP

-d port-number

Run in demon mode. As for the -p option, but newLISP does not exit after a closed connection and stays in memory listening for a new connection.

.SH EXAMPLES

.TP

Start interactive session

.B newlisp

.PP

.TP

interpret lisp sources then enter interactive session.

.B newlisp

myfile1.lsp myfile2.lsp

.PP

.TP

Add 3 and 4, 7 prints on standard output

.B newlisp

-e "(+ 3 4)"

.PP

.TP

newLISP is started as a server (the & indicates to LINUX to run the process in the background) and can be connected to with telnet by issuing telnet localhost 1234

.B newlisp

-p 1234 &

.PP

.SH EXIT STATUS

newlisp returns a zero exist status for normal exit unless exit command specifies a code to be returned. Non zero is returned in case of abnormal exit.

.SH AUTHOR

Lutz Mueller (contact (at) nuevatec.com)

.SH SEE ALSO

newlisp-tk(1)

Lutz

#27
thanks, I still could merge newlisp.1 into 8.0 but will do newlisp-tk.1 in 8.0.1



Lutz

nigelbrown

#28
I'll work on newlisp-tl.config man page to go with it. Probably along the lines of a re-markedup cut and paste from sections of the newlisp-tk .html document.

nigelbrown

#29
Lutz,

could you post for me the install section of the proposed 8.0.0 release makefile so I can use the man bit for the rpm?

Thanks

Nigel