Howto use CAP on NeXTSTEP/OpenStep - Setup examples

NOTE: CAPer V6 does all setup for you except defining the USER DEFINEABLE FILE TYPES, so this information does only apply for CAPer V4 and below.



     NEXTSTEP setup

         1)   Make sure your password is no more than eight
              characters long.

         2)   Make a subdirectory of your UNIX home directory or
              work area to be your Macintosh volume, say 'mac'.
              Create two additional subdirectories named
              .resource and .finderinfo at the same level, then
              change your working directory to the mac subdirec-
              tory and make the same subdirectories again.  For

                    % mkdir mac
                    % mkdir .finderinfo .resource
                    % cd mac
                    % mkdir .finderinfo .resource

              The top level .finderinfo directory is used to
              store information about the volume window size,
              position and layout. You can do without the top
              level .finderinfo and .resource directories but
              the window will always open with default settings,
              changes to which will not be saved.

          3)  Make a file named afpvols or .afpvols in your home
              directory to designate your Macintosh directory,
              with a line like:


               where the part before the colon is the UNIX
               pathname (here relative to my home directory) and
               the part after is the volume name that the Macin-
               tosh will use and display.

               For a system wide setup edit the file 
               /usr/local/lib/cap/afpvols. CAPer will open it
               for you in the Script menu.
               Now startup or restart CAP on the NeXT.

     Macintosh setup and use

          1)   Make sure you have installed AppleShare client
               code (version 1.1 or later) and Chooser (version
               3.0 or later) on your Macintosh startup disk.
               Your Macintosh must be connected to an AppleTalk
               net that is bridged to the Ethernet.

          2)   Follow these steps to mount your AUFS volume:

               a)   Select Chooser from the Apple menu. When the
                    Chooser menu window comes up, click on the
                    AppleShare icon in the upper left corner (if
                    you do not have this icon, you have not prop-
                    erly installed AppleShare).  Activate
                    AppleTalk if it is not already activated.

               b)   Chooser will query the net for available file
                    servers and list their names.  Double click
                    on the file server you wish to use.  You may
                    need to select another AppleTalk zone to find
                    the server.

               c)   A connection request menu window will now
                    appear.  Click the button for registered user
                    if it is not already clicked.  Type your UNIX
                    login account name in the Name: field
                    (Chooser will supply the name from its name
                    field as the default).  Click in the Pass-
                    word: field to activate text entry there and
                    type in either your UNIX password ("Clear
                    text" is specified in the login dialog box)
                    or your AUFS password (asterisks will show
                    instead of the characters you typed for secu-
                    rity).  Press the RETURN key or click on OK.
                    guest connections may also be allowed at your

               d)   The AUFS server logs you in and a final menu
                    window appears, listing the available
                    "volumes" (directories) that you may mount.
                    This list consists of the entries in your
                    afpvols or .afpvols file, plus any volumes
                    that the UNIX system manager has made avail-
                    able for general use.  Click on the desired
                    volume name and then click OK to mount it
                    (you may shift-click to select several
                    volumes).  The AUFS volume icon (a NeXT "cube") 
                    should appear on your desktop.

               e)   You are returned to the Chooser main menu.
                    Click its close box to return to your appli-

          3)   You work with this AUFS volume as if it were an
               attached Macintosh hard disk.  Note that the fig-
               ures for space used and available refer to the
               entire UNIX disk partition, not just your Macin-
               tosh volume directory.

          4)   To dismount an AUFS volume, simply drag its icon
               to the trash can. AUFS volumes will also be
               dismounted if you select Shutdown from the
               Finder's Special menu.

               For more information read the AUFS(1) man page,
               see CAPers Info menu.


          1)   Open and startup CAP if it is not yet running.

          2)   Click on 'Mount remote' in the Activity->Network menu.

          3)   After a few seconds the names of the AFP servers in your
               network appears in the CAPer console. Locate the one you
               want to connect to and enter its full (!) AFP name into the
               'Mount remote filesystem' dialog. (Spaces are important!)

          4)   Select your mountpoint, every afpmount must have a unique
               one. I suggest the names '/apple1','/apple2','/apple3'...
               The remote system will show up with all available volumes
               in this mountpoint.

          5)   Enter your login name and password or leave the fields
               blank for guest access.
          6)   Select your desired character mapping. For most people
               the default 'NeXT' is ok.

          7)   Check all entries and click on 'Mount'. CAPer will now
               issue the following command for you:

               /usr/local/cap/afpmount -u USER:PASSWORD -c CHARMAPPING

               (As you surely have recognized all versal names are placeholders.)

          8)   Select the filesystem in Workspace, you should see all
               exported volumes from the given server. If the mountpoint
               shows up empty your user/password is perhaps wrong.

EXPORTING PRINTERS (LaserWriter 8 access)

	  1)   A printer is a local UNIX queue, so create one using
      first if you don't have one handy.
               Remember its name for later use.

          2)   To export a single printer, open the file
               /usr/local/lib/cap/lwsrv.conf and enter the name from
               1. in the place of 'myUnixQueue'. Save it, restart
               CAP, it should work now. You are done.
          [3]) To export additional printers open the file 
               /usr/local/cap/start-cap-server and search the line:

               ${CAP}/lwsrv8 /usr/local/lib/cap/lwsrv.conf

               Copy and change it so it becomes:

               ${CAP}/lwsrv8 /usr/local/lib/cap/lwsrv.conf
               ${CAP}/lwsrv8 /usr/local/lib/cap/lwsrv2.conf

               Save the startup script now.

               (The idea is to start a new lwsrv8 process per
               exported printer. It is possible to server all
               printers with one lwsrv8 but in my tests this
               sometimes leads to the loss of PS jobs in the
               queue, so to stay on the safe side just start
               a new one for each queue)

          [4]) Copy the file /usr/local/lib/cap/lwsrv.conf to the
               name /usr/local/lib/cap/lwsrv2.conf. Open it and
               change the name of the printer queue as explained
               above. Change the entity name to something reasonable.
               Save it, restart CAP, it should work now. You are done.

          To change the printer type, just change the 'include'
          statement in the lwsrv.conf file. See /usr/local/lib/cap/DBfile
          for some built-in printer types. 


          1)   Startup CAP if it is not running yet.
          2)   Select Activity->Network->Show printers
               You should see a list of available network printers
               in your network.

          3)   To test access just issue a 

               /usr/local/cap/lwpr -p "REMOTE PRINTER NAME:LaserWriter@ZONE" FILE

               where REMOTE PRINTER NAME and ZONE are taken from the list
               in the CAPer log.

               FILE should be a normal PostScript file. It should be send to
               the remote printer.

          4)   To setup a permanent queue, startup and
               create a new printer. Use the correct type (or add its PPD
               to /NeXTLibrary/PrinterTypes/English.lproj (or your language)).
               We assume the name 'Appletalk_printer' in the following 

          5)   Write a little script in /usr/local/cap, call it as you like,
               in our example we choose the name 'printer1'.

                export PSTEXT
                # pass the printer name and the arguments lpd passed us
                /usr/local/cap/papif -P PRINTER_NAME  $*

               Save it and make it executable.

          6)   Create (or edit) the file /etc/cap.printers to include the line


               (As you surely have recognized all versal names are placeholders.)
               You can now test the communication by typing

               /usr/local/cap/printer1 < FILE

               where FILE is a PostScript file.

	  7)   We now must setup the printer queue. As NeXT does not use the 
               /etc/printcap we have to manipulate the netinfo database.

               [NOTE: you can backup your local netinfo DB by doing a
                      cd /etc
                      gnutar czvf netinfo_backup.tar.gz netinfo

               you can later (if everything else fails) restore the DB by
                      cd /etc
                      gnutar xzvf netinfo_backup.tar.gz netinfo

               as a last resort. Please note that this is only needed for
               emergency cases.]
               In a shell, do a 

               niutil -read . /printers/Appletalk_printer

               you should see a list of attributes. Look for the if: one, it
               should read

               if: /usr/local/lib/NextPrinter/Server/prserver

               Now issue a (careful, watch the spaces!)

               niutil -createprop . /printers/Appletalk_printer if /usr/local/cap/printer1

               and check it with a

               niutil -read . /printers/Appletalk_printer

               the 'if' property should now read

               if: /usr/local/cap/printer1

          8)   Print a test page using

          See the papif.8 man page for more information.


          Using CAP it is possible to define a 'map' what UNIX
          file extension maps to what Apple TYPE/CREATOR and if a
          automatic translation should be done on the file to
          change the line ends. AUFS is compiled with the USRFILETYPES
          in so all you have to do is put a file in your home directory
          called '.afpfile' with a similar content to this example:

# This is a sample CAP AUFS afpfile 
# It controls the type of translation performed on the file content and the
# mapping between UNIX filename extension and the Macintosh Creator and Type.
# The available forms of translation are
#	Ascii, map LF to CR and vice versa
#	Text, map Mac quotes to UNIX quotes (not vice-versa, implies Ascii)
#	Iso, map to/from ISO 8859 characters (requires ISO_TRANSLATE)
#	Raw, no translation
.c	Ascii	'MPS '	'TEXT'	"This is a UNIX C source file."
.h	Ascii	'MPS '	'TEXT'	"This is a UNIX C source header file."
.p	Ascii	'KAHL'	'TEXT'	"This is a UNIX pascal source file."
.o	Raw	'unix'	'OBJ '	"This is a UNIX object file."
.a	Raw	'unix'	'AR  '	"This is a UNIX archive file."
.Z	Raw	'LZIV'	'ZIVU'	"This is a UNIX compressed file."
.ps	Raw	'ASPS'	'TEXT'	"This is a UNIX PostScript file."
.sit	Raw	'SIT!'	'SIT!'	"This is a UNIX StuffIt file."
.gif	Raw	'JRVL'	'GIFf'	"This is a UNIX GIF file."
.tar	Raw	'TAR '	'TARF'	"This is a UNIX Tar file."
.tex	Raw	'*TEX'	'TEXT'	"This is a UNIX TeX source file."
.fram	Raw	'Fram'	'FASL'	"This is a UNIX FrameMaker file."
.xlt	Ascii	'XCEL'	'TEXT'	"This is a UNIX Excel Text file."
.hqx	Ascii	'BnHq'	'TEXT'	"This is a UNIX BinHex file."
.wrd	Ascii	'MSWD'	'TEXT'	"This is a UNIX Text file."
.wrt	Ascii	'MACA'	'TEXT'	"This is a UNIX Text file."
.txt	Ascii	'ttxt'	'TEXT'	"This is a UNIX Text file."
.*	Raw	'ttxt'	'TEXT'	"This is a UNIX created file."

This information is given without any warranty, it is perhaps not accurate. You are working at your own risk. If you find an error please notify me immediately. All trademarks are used for identification purpose only. Written by Frank Siegert.

Back to Franks Home Page