home *** CD-ROM | disk | FTP | other *** search
/ AMIGA PD 1 / AMIGA-PD-1.iso / NetBSD / docs-netbsd / Packages.txt < prev    next >
Text File  |  1994-11-27  |  10KB  |  262 lines

  1. This is mainly an intro to the EasyInstall-scripts.
  2.  
  3. This goes to the amiga-mailing-list and to all who have compiled optional
  4. packages for NetBSD/Amiga. Sorry if this is a bit lengthy ...
  5.  
  6. ---------------------------------------------------------------------------
  7.  
  8.     Using and making optional packages available for NetBSD/Amiga
  9.     #############################################################
  10.                 (C) Hubert Feyrer, September 15th, 1994
  11.  
  12.  
  13.        Summary:
  14.        ~~~~~~~~
  15.        This document describes how optional packages should be
  16.        structured so they can be easily installed and removed.
  17.        Furthermore,  a method for simplifying the installation
  18.        is  introduced and hints   on how to configure optional
  19.        packages are included.
  20.  
  21.  
  22. 0) Contents
  23. ~~~~~~~~~~~
  24.   0. Contents
  25.   1. Introduction
  26.      1.1 Format of packages
  27.      1.2 Accessing packages easily
  28.      1.3) Other things to do while installing packages
  29.   2. The installation process
  30.      2.1 Things done while installing
  31.      2.2 Things done while uninstalling
  32.   3. Configuring the installation process
  33.   4. Notes on configuring packages
  34.   5. Future plans
  35.   6. Disclaimer & legal stuff
  36.   7. Availability
  37.   8. Final note
  38.  
  39.  
  40. 1) Introduction
  41. ~~~~~~~~~~~~~~~
  42. As stated in an earlier posting, I'd like to see all optional packages
  43. reside in their own directory below one common directory
  44. (/usr/local). Packages are placed in subdirectories below /usr/local, with
  45. the directory name of the package giving name and version of the package,
  46. e.g. /usr/local/fvwm-1.23f, /usr/local/bash-1.14.1.
  47.  
  48.  
  49. 1.1) Format of packages
  50. ~~~~~~~~~~~~~~~~~~~~~~~
  51. Below the package-directories, files are stored in the following
  52. subdirectories:
  53.  
  54.  - binaries:             bin
  55.  - formatted man-pages:     man/cat[1-8]
  56.  - unformatted man-pages:     man/man[1-8]
  57.  - misc files:             etc
  58.  - libraries:             lib
  59.  - includes:             include
  60.  - info-files:             info
  61.  
  62. Information for installing the package is provided in the subdirectory
  63. "install", namely as a script "install.sh" for installation and
  64. (recommended) "uninstall.sh" for removing the package.
  65.  
  66.  
  67. 1.2) Accessing packages easily
  68. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  69. Having several packages installed would force users to include serveral
  70. bin-directories into their $PATH, get unwieldly long $MANPATHs, ... To
  71. prevent this, files that are accessed by users are linked to some public
  72. directories below /usr/local. The directories used are exactly the same as
  73. the ones used inside the packages. Doing this has two advantages:
  74.  
  75. - easy installation of packages
  76. - users have to include only one directory into their $PATH (/usr/local/bin),
  77.   $MANPATH (/usr/local/man), ...  
  78.  
  79. This document is intended to describe a mechanism for making packages
  80. accessible via those public directories.
  81.  
  82.  
  83. 1.3) Other things to do while installing packages
  84. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  85. There are also some more things to handle when installing packages,
  86. namely:
  87.  
  88.  - installing X application defaults
  89.  - making files setuid root
  90.  - creating auxiliary directories (for more libraries, includes, ...)
  91.  - Pre/Post-install scripts (not yet)
  92.  
  93.  
  94. 2) The installation process
  95. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  96. I've written some shell scripts that should help installing optional
  97. (precompiled) packages on ones system by doing the things mentioned
  98. above. All one has to do to configure the installation is to set some
  99. variables in a (shell)script that will be uses for installation as
  100. well as de-installation.
  101.  
  102.  
  103. 2.1) Things done while installing
  104. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  105. The "install.sh"-script does the following things while making a package
  106. publically available:
  107.  
  108. a) If application defaults are to be installed, figure out the directory
  109.    where to put them. The following directories are searched:
  110.  
  111.     - /usr/lib/X11/app-defaults
  112.     - /usr/local/X11R6/lib/X11/app-defaults
  113.     - /usr/X11R6/lib/X11/app-defaults
  114.     - /usr/local/X11R5/lib/X11/app-defaults
  115.     - /usr/X11R5/lib/X11/app-defaults
  116.     - $BASE/X11R6/lib/X11/app-defaults 
  117.     - $BASE/X11R5/lib/X11/app-defaults
  118.  
  119.     (BASE is the directory below which packages are installed, usually
  120.      /usr/local, but can be changed, although this is not recommended)
  121.  
  122.    If no directory can be found, the user will be prompted to insert on.
  123. b) Create /usr/local and additional directories (for includes, libraries,
  124.    ...).
  125. c) Link files specified from /usr/local/<package>/bin to /usr/local/bin.
  126.    Same for files
  127.    in etc, lib, man/man[1-8], man/cat[1-8], info and include. Directories
  128.    that do not exist will be created.
  129. d) Install X application defaults into the directory previously figured
  130.    out. 
  131. e) Set specified files setuid root.
  132.  
  133.  
  134. 2.2) Things done while uninstalling
  135. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  136. "uninstall.sh" performs the following tasks while removing the package from
  137. public directories:
  138.  
  139. a) Find out directory for application defaults as described above.
  140. b) Remove files from public directories: bin, etc, lib, man/man[1-8],
  141.    man/cat[1-8], info, include. After that, directories will be removed if
  142.    they are empty.
  143. c) The X application default file is removed.
  144. d) Remove misc directories for libraries, etc.
  145.  
  146. Please note: the package itself (/usr/local/<package>) is *not* removed!
  147.  
  148.  
  149. 3) Configuring the installation process
  150. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  151. The two scripts "install.sh" and "uninstall.sh" are expected to be placed
  152. in a packages "install" subdirectory. This is also the place where the two
  153. scripts look for a file "package" which describes the package.
  154.  
  155. The packag-file contains only definitions for some (environment) variables,
  156. namely:
  157.  
  158. - BASE: Base of public directories. Defaults to "/usr/local" and should not
  159.         be changed.
  160. - PKG: Absolute patch of the package, usually "$BASE/package-name".
  161. - BIN: Which files to link from $PKG/bin to $BASE/bin. Must be enclosed in 
  162.        "quotes" if more than one file is given (space-seperated).
  163. - ETC: Which files from $PKG/etc will be needed in $BASE/etc? (Note: You
  164.        should compile in /usr/local/packagename as base for packages, not
  165.        /usr/local. This way you won't have to link files into /usr/local/etc.)
  166. - LIB: Libraries of public interrest, relative to $PKG/lib. Additional
  167.        libraries can be created by setting MISCDIRS (see below).
  168. - MAN1: which unformatted man-pages to link from $PKG/man/man1 to
  169.         $BASE/man/man1 (including ".1"-suffix!). Descriptions for general
  170.         commands go here.  
  171. - MAN2: same as MAN1 (suffix: ".2"), just for system calls.
  172. - MAN3: same as MAN1 (suffix: ".3"), just for C libraries.
  173. - MAN4: same as MAN1 (suffix: ".4"), just for device drivers.
  174. - MAN5: same as MAN1 (suffix: ".5"), just for file formats.
  175. - MAN6: same as MAN1 (suffix: ".6"), just for games.
  176. - MAN7: same as MAN1 (suffix: ".7"), just for miscellaneous things that
  177.         don't fit else where.  
  178. - MAN8: same as MAN1 (suffix: ".8"), just for system administrative
  179.         commands. 
  180. - CAT1: which formatted man-pages to link from $PKG/man/cat1 to
  181.         $BASE/man/cat1 (including ".0"-suffix!). Descriptions for general 
  182.         commands go here. 
  183. - CAT2: same as CAT1 (suffix: ".0"), just for system calls.
  184. - CAT3: same as CAT1 (suffix: ".0"), just for C libraries.
  185. - CAT4: same as CAT1 (suffix: ".0"), just for device drivers.
  186. - CAT5: same as CAT1 (suffix: ".0"), just for file formats.
  187. - CAT6: same as CAT1 (suffix: ".0"), just for games.
  188. - CAT7: same as CAT1 (suffix: ".0"), just for miscellaneous things that
  189.         don't fit else where. 
  190. - CAT8: same as CAT1 (suffix: ".0"), just for system administrative commands.
  191. - INFO: files to link to $BASE/info. Modification of "$BASE/info/dir"
  192.         should be done by some smart post-processing script (once these are 
  193.         implemented ;-).
  194. - APPDEF: Application default files, relative to $PKG, usually
  195.           "lib/XApp.ad". Suffix ".ad" will be stripped in link.
  196. - INCLUDE: Files to link into $BASE/include, e.g. for libraries like
  197.            readline. Additional subdirectories can be created by setting
  198.            MISCDIRS. 
  199. - SUIDROOT: Which files (relative to $PKG) to make setuid-root (just in
  200.             case tar goofed some protections/ownerships).
  201. - MISCDIRS: Which additional directories to create under $BASE. Usually for
  202.             grouping includes or libraries.
  203.  
  204.  
  205. 4.) Notes on configuring packages
  206. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  207. When compiling optional packages, make the base-directory
  208. "/usr/local/package", not "/usr/local". By doing so you don't have to put
  209. every single file into public directories, but only the ones of interrest
  210. for users (usually binaries and man pages).
  211.  
  212. Please do *not* upload modified sources of freely distributable
  213. programs. Send them to the authors instead so the changes will be
  214. incorporated in the next release.
  215.  
  216.  
  217. 5.) Future plans
  218. ~~~~~~~~~~~~~~~~
  219. There are two things I can think of that might be useful:
  220.  
  221.  - Pre/Post-install-scripts which will be run before/after the installation
  222.    to backup files, etc.
  223.  - Some smart script to edit config-files. Useful for adding info-files to
  224.    the dir-file or think if one wants to install wu-ftpd: editing
  225.    /etc/inetd.conf by hand. :-/
  226.  
  227.  
  228. 6.) Disclaimer & legal stuff
  229. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  230. Use at your own risk. All rights reserved.
  231.  
  232.  
  233. 7.) Availability
  234. ~~~~~~~~~~~~~~~~
  235. I'll put this all together into a package "EasyInstall-1.1.tar.gz" and place
  236. it into /pub/NetBSD-Amiga/contrib on ftp.uni-regensburg.de. I'll place this
  237. document into the docs-directory as "Packages.txt".
  238.  
  239.  
  240. 8.) Final note
  241. ~~~~~~~~~~~~~~
  242.  
  243. Call for discussion!
  244.  
  245. What do you think about all of this? Are the two scripts useful, will
  246. anyone use it? What can be improved? How about the method for detecting the
  247. appdef-dir? Are there any public directories I've missed?
  248.  
  249. Tell me! Either via private email (hubert.feyrer@rz.uni-regensburg.de) or
  250. the NetBSD/amiga mailing list (amiga@netbsd.org).
  251.  
  252.  
  253. Enjoy,
  254.  
  255.        Hubert
  256.  
  257. =============== Hubert Feyrer ============================================
  258.       Weekdays: Rennerstr. 19, D-93053 Regensburg,  Tel. 0941/701788
  259.       Weekends: Bachstr. 40,   D-84066 Mallersdorf, Tel. 08772/6084
  260.       Internet: hubert.feyrer@rz.uni-regensburg.de == IRC: hubertf
  261. ==========================================================================
  262.