
 The NightView: CCD camera and telescope controller
 =================================================
 
       by F. Hroch (hroch@physics.muni.cz)


     http://www.physics.muni.cz/mb/nightview/


 The NightView package is a utility for control astronomical CCD
 cameras and telescope mounts. Currently, it contains only support for 
 the SBIG instruments supported by the S. Ashe and SBIGUdrv libraries.



 Download
 --------

 The NightView package can be downloaded from the address:

    ftp://integral.physics.muni.cz/pub/nightview/

 This directory contains a few subdirectories with milestones
 (usually obsolete) in source and binary format. 

 The current version is present in the directory as file

    nightview_YYYY-MM-DD.tar.gz

 e.g. name followed by the actual date. The file is created
 about local midnight from the CVS tree. It is recommended to
 by used. Don't worry about quality of the package, this file
 is usually used on Monteboo observatory as working version.
 If something is wrong for a long time (more than month), please
 inform me about the problem.
 

 Installation
 -----------

 After successful download of the nightview, you can  try to 
 install of the package. There is limited possibility  to fit 
 the installation according to your needs. By this way, you can 
 reduce of known "dependency hell". By running of the command
 
    ./configure --help

 you can show the possible options to compile it. For example:

  --with-sbig             build with driver library by S. Ashe (no)
  --with-sbigudrv         build with SBIG Universal Driver/Library (yes)
  --with-curl             build with cURL library support (no)
  --with-nighthttpd       build with nightview HTTP server (yes)
  --with-cgi              build with nightview cgi scripts (no)
  --with-mount            build with mount support (yes)
  --with-shell            build with command line utilities (yes)
  --with-gtknightview     build with graphical camera interface (yes)
  --with-xmove            build with graphical mount interface (yes)
  --with-doc              build more documentation (no)

 Default setting is recommended for typical installation. If you are 
 building the server (without graphical front-end) select:
 
    ./configure --without-gtknightview --without-xmove

  If you are building the package on non-Linux system (where the
  SBIG cameras are unsupported) select:

    ./configure --without-sbigudrv

  Simply, select what you want. The better description of requirements
  and dependencies is summarized in paragraph 'Installation requirements'.

  The setting of the environment variables can also control of the
  compilation. For example, an aggressive optimization of the output
  code is provided by CFLAGS variable

    bash$ CFLAGS=-O ./configure
  


  When the package is configured by the ./configure utility, simply
  run
     
    make install


  to install the package to directory /usr/local/ (if the option
  --prefix is not specified to configure).

 
  Note. The instalation on FreeBSD can work with parameters:
  
  csh:> ./configure --without-sbigudrv LDFLAGS=-L/usr/local/lib \
        CPPFLAGS=-I/usr/local/include


 Uninstallation
 -------------

 Type
    
    make uninstall

 in installation directory to do it.



 Installation requirements
 ------------------------

 * Linux or FreeBSD (may works on other systems), 
   the camera server requires Linux by manufacturer policy

 * cfitsio library

 * SBIG camera library (optional, for camera daemon)

 * cURL library (absolutely optional, the nightview contains
   simple http protocol implementation, but curl supports more
   features)
 
 * gdk, gtk ver 1.2, .. gdk-pixbuf libraries (for building
   an old gtknightview)

 * wxWidget library (for xnightview)

 * wxPython library (for xmove)


 SBIG library notes
 ------------------

 Before installation of the nightview, you need to install of the
 camera manufacturer library. There are my notes to do it for
 SBIG Universal library:

 1. get it: ftp://ftp.sbig.com/pub/devsw/LinuxDevKit.tar.gz
 2. untar, read README.txt (but not follow instructions!)
 3. install libusb and fxload from your distribution set
 4. copy only the files: 
        sbigudrv.h     -> /usr/local/include
        libsbigudrv.so -> /usr/local/lib
 5. read and follow instructions in udev subdirectory
    of the nightview
 6. Important!!! It is absolutely necessarily to have the
    libusb library in /usr/local/lib. The presence of the library
    only in /lib or /usr/lib (where your package system place it)
    is not sufficient. I think, this is probably due to a bug
    in sbigudrv library. A (soft) link is sufficient, so these 
    commands solves it:

       ln -s /lib/libusb-0.1.so.4 libusb.so
       ln -s libusb.so libusb-0.1.so.4

 
 This instructions works for 2.6.x Linux kernels above 2.6.13
 (for 2.4.x kernels use hot-plug, for 2.6.x < 2.6.13 needs to be
 modified scripts in udev directory).
 
 The sbigudrv library is linked agains to libstdc++.so.5, if you
 are running some recent Linux distribution, install it additionaly
 to rest of system libraries.  







--------------------------------------------------------------------------

 Older notes, not recomended to read.

 
 
 Quick way how to use it
 -----------------------

 Install (preferably use your packaging system) these dependency
 libraries

    cfitsio, gdkpixbuf (gtk+, gdk, ...).

 Unpack sources (change xxx to current values), switch to directory,
 configure the sources, compile and install it

    tar zxf nightview-xxx.tar.gz
    cd nightview-xxx
    ./configure --with-sbigudrv --prefix=/usr/local/bin 
    make install
    
  To run camera server type:
    /usr/local/bin/nightviewd

  The server can be 

    


 Detailed information
 --------------------

  * cfitsio(http://heasarc.nasa.gov/fitsio/fitsio.html)





 Instalation
 -----------
 
 Get the sbig library from
 
    ftp://ftp.dimensional.com/users/ashe/
    
 and install developemnt version of the libraries: gtk, gdk, gdkpixbuf
 and curl. On the top directory type:
 
    make
    
 Wait for a time, and
 
    make install 
    
 to install.

-----------------------------------------------------------------

 Problems:

 Question: My instalation crash with error:
..                                                                              
cc -O -D_REENTRANT -I../include -L. -fPIC -c ccdsbig.c                          
ccdsbig.c:29: sbig.h: No such file or directory                                 
...                                                                             

 Answer:
   You haven't instaled sbig.h, sbig.a, sbig.so in system wide
   directory (or nothing instaled). Set the enviroment variable

 export INC_SBIG=/your/directory

---------------------------------------------------------------

Debian

under debian, install all maintaines tools (see 
http://www.debian.org/doc/maint-guide/). Than go to main
directory and type:

dpkg-buildpackage -rfakeroot


--------------------------------------------------------------

RPM specific distributions

Go to rpm subdirectory and type

 rpmbuild -ba nightview.spec
 
 to create package set od rpm-based system. 
 
The packaging on debian specific system can be done with
rpm package installed as ordinal user:

 cp -a /usr/src/rpm/ /home/hroch/
 rpm --initdb --dbpath '/home/hroch/rpm'
 cd /home/hroch/rpm/SOURCES
 ln -s $NIGHTVIEW_DIRECTORY/nightview-${version}.tar.gz .
 ln -s $NIGHTVIEW_DIRECTORY/rpm/*.redhat .
 ln -s $NIGHTVIEW_DIRECTORY/rpm/*.patch .
 cd /home/hroch/nightview/rpm
 ln -s /usr/share/common-licenses/GPL COPYING
 cd $NIGHTVIEW_DIRECTORY/rpm/nightview.spec
# comment out the 'Debian specific features': build dependencies and doc patch
 rpmbuild  --dbpath '/home/hroch/rpm'  --define '_topdir /home/hroch/rpm' \
      -ba nightview.spec 

-----------------------------------------------------------------------

Instalation without dependecies (static)

To staticaly link output binaries use command:

LDFLAGS="-Wl,-static"  configure --prefix=/somewhere

(it doesn't work for gtknightview, of course, due to problems 
in staticaly linking of Gtk applications)


#---------------------------------------------------------------------
#
# $Id: README,v 1.13 2007-07-23 12:28:42 hroch Exp $
#
