OT: (but I do not know who ask for): buildin an RPM from scratch
I builded a RPM from scratch of an application of mine. The SRC rpm works: it builds 2 i586 architecture packages, it has got good controls, it check dependecies and so on. My trouble is this: how to force the user to answer some questions before install the package ? I wrote down theese lines: %pre echo Bla bla bla.; echo -n Answer (yes | no | later); read chiave while ( test -z $chiave ); do read chiave done; that produce a /var/tmp/rpm-tmp.19101 as follow: echo Bla bla bla.; echo -n Answer (yes | no | later); read chiave while ( test -z $chiave ); do read chiave done; The problem is that $chiave is NEVER != zero. Some one can help me ? Realy tnx, Miguel Beccari
Re: OT: (but I do not know who ask for): buildin an RPM from scratch
Miguel Beccari wrote: %pre echo Bla bla bla.; echo -n Answer (yes | no | later); read chiave while ( test -z $chiave ); do read chiave done; OK. In the docs I read: There are certain caveats about these scripts which you should take into account. Number one, each must fit inside a 8192 buffer, and number two, they should be non-interactive. Anything which requires manual input from the user is wrong, as this will break non-interactive RPM installation procedures. Regards, Miguel Beccari
Re: OT: (but I do not know who ask for): buildin an RPM from scratch
On Fri, 31 May 2002, Miguel Beccari wrote: I builded a RPM from scratch of an application of mine. The SRC rpm works: it builds 2 i586 architecture packages, it has got good controls, it check dependecies and so on. My trouble is this: how to force the user to answer some questions before install the package ? I wrote down theese lines: %pre echo Bla bla bla.; echo -n Answer (yes | no | later); read chiave while ( test -z $chiave ); do read chiave done; that produce a /var/tmp/rpm-tmp.19101 as follow: echo Bla bla bla.; echo -n Answer (yes | no | later); read chiave while ( test -z $chiave ); do read chiave done; The problem is that $chiave is NEVER != zero. Some one can help me ? Are you saying the script behave differently in the RPM than if you just run it? I would do something a little more bulletproof, which would force them to answer one of your choices, unless they ctrl-C out of it: #!/bin/sh echo Bla bla bla.; GoodAnswer () { # do something now echo You answered $chiave } GetInput () { echo -n Answer (yes | no | later); read chiave while [ -z $chiave ]; do GetInput done; } GetInput case $chiave in yes | no | later) GoodAnswer ;; *) GetInput ;; esac Of course if they install with rpmdrake or whatever, you need to call up a terminal window. Others may have even better suggestions. Stew Benedict -- MandrakeSoft PPC FAQ: http://www.linux-mandrake.com/en/ppcFAQ.php3 IRC: irc.openproject.net #cooker-ppc
Re: OT: (but I do not know who ask for): buildin an RPM from scratch
Stew Benedict wrote: Are you saying the script behave differently in the RPM than if you just run it? I would do something a little more bulletproof, which would force them to answer one of your choices, unless they ctrl-C out of it: Yes (I am saying the script behave differently). I used your suggestions, but the result is the same. If I run sh /var/tmp/rpm-tmp.54377 I have got the promt Answer (yes | no | later) If I answer the script goes on as well. It is OK. But when I run rpm -Uhv I have a loop: Answer (yes | no | later) Answer (yes | no | later) Answer (yes | no | later) Answer (yes | no | later) Answer (yes | no | later) Answer (yes | no | later) [etc...] This because of $chiave is empty GetInput () { echo -n Answer (yes | no | later); read chiave while [ -z $chiave ]; do GetInput done; } Because of $chiave is empry GetInput is looped. Miguel Beccari
Re: OT: (but I do not know who ask for): buildin an RPM fromscratch
When the script is run by rpm, it probably has input redirected from /dev/null. As the docs say, it should be non-interactive. Anything else will break scripted installations. If you want the user to answer questions, you will have to do as Microsoft does (I don't believe I just said that! 8-/) The first time the program is run, it asks questions of the user and does a bunch of setup stuff. In Microsoft's case, they use this to get your product registration number. Rick From: Miguel Beccari [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Date: Fri, 31 May 2002 15:45:14 +0200 To: [EMAIL PROTECTED] Subject: Re: OT: (but I do not know who ask for): buildin an RPM from scratch OK. In the docs I read: There are certain caveats about these scripts which you should take into account. Number one, each must fit inside a 8192 buffer, and number two, they should be non-interactive. Anything which requires manual input from the user is wrong, as this will break non-interactive RPM installation procedures.
Re: OT: (but I do not know who ask for): buildin an RPM from scratch
Rick Thomas wrote: When the script is run by rpm, it probably has input redirected from /dev/null. As the docs say, it should be non-interactive. Anything else will break scripted installations. Yes. It is so. In fact I used something like %pre $bashscript = /tmp/myfile echo #!/bin/sh $bashscript echo Stew Benedict suggestion $bashscript chmod 700 $bashscript sh $bashscript So i was REALLY sure it was a bash script to be executed (sorry but I am new to rpms) and the problem was the same. Then I run /tmp/myfile and it worked... so I think the input is redirected from /dev/null. OK. I will write a mini setup program as Microsft does ;) Up to now I just echo out the instructions and the license (with a line that sounds like 'using the software presumes you have accepted the license terms at all Regards, Miguel Beccari
Appletalk printing on Laserwriter 320 - pap
i there, I already tried everything I could find on the internet to configure the printcap file in /etc but I cannot print with the lpd to my Apple Laserwriter 320 (directy connected to my iMac via a bridge). I am, however, able to print directly to the laserwriter with the pap command: pap -p Lasertje:Laserwriter name.eps This works but it does not cut off pages, so it keeps on printing and half lines are printed. Has anyone ever succesfully configured such a printer ? I would be grateful if anyone could help me with this Jeroen Diederen http://diederen.demon.nl
Re: OT: (but I do not know who ask for): buildin an RPM from scratch
I will write a mini setup program as Microsft does ;) Up to now I just echo out the instructions and the license (with a line that sounds like 'using the software presumes you have accepted the license terms at all Intel's free compiler, Mathematica, and maple take the following approach: write a simple script that reviews the license, asks/determines which parts /things to install, unpacks the appropriate rpm's and installs them -- relocating to users chosen path if that is an option. These can be run from a script by catting in the required answers: install_ace_package my_options. Generally such packages are add-ons and go in /opt and are individually installed. On the other hand if you have used rpm to mark your license type and have included it in the distro then arguable an installer is/should be aware of it. VMware + staroffice(?) take an alternative approach -- rpm's to install but a first-time script to be run by users to setup the network daemons etc: vmware-config.pl and soffice. Alternatively you can have the program auto-detect different features like SSE1/2 MMX support for multimedia libraries. Hopefully you should be inspired by one of these examples. Good luck, Q.
Re: Appletalk printing on Laserwriter 320 - pap
On 5/31/02 3:29 PM, Jeroen Diederen [EMAIL PROTECTED] wrote: i there, I already tried everything I could find on the internet to configure the printcap file in /etc but I cannot print with the lpd to my Apple Laserwriter 320 Have you seen this page ? http://gdr.free.fr/linux2.html MJF