tazpkg diff README.devel @ rev 822

Add README.devel; introduce libexec for modules; rename modules; support install variables in Makefile.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Jul 25 16:50:18 2015 +0300 (2015-07-25)
parents
children bbc6b0a453a7
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/README.devel	Sat Jul 25 16:50:18 2015 +0300
     1.3 @@ -0,0 +1,107 @@
     1.4 +README file for TazPkg developers
     1.5 +=================================
     1.6 +
     1.7 +
     1.8 +Desktop integration
     1.9 +-------------------
    1.10 +
    1.11 +mimeapps.list: this file deprecated and not installed
    1.12 +https://wiki.archlinux.org/index.php/Default_applications
    1.13 +(Also, defaults.list deprecated.)
    1.14 +
    1.15 +MIME-type "x-scheme-handler/tazpkg" already listed in the tazpkg-url.desktop
    1.16 +
    1.17 +
    1.18 +Categories for .desktop files are listed here:
    1.19 +http://standards.freedesktop.org/menu-spec/menu-spec-1.0.html
    1.20 +
    1.21 +tazpanel-pkgs.desktop: sub-category PackageManager -> category Settings
    1.22 +
    1.23 +
    1.24 +TazPkg modules
    1.25 +--------------
    1.26 +
    1.27 +About 4,000 lines of code is too big to effectively maintain it in single file.
    1.28 +
    1.29 +Linux way [https://en.wikibooks.org/wiki/Linux_Guide/How_Linux_Works]:
    1.30 +> The Linux Way can be summarized as:
    1.31 +>   * Use programs that do only one task, but do it well.
    1.32 +>   * To accomplish complex tasks, use several programs linked together.
    1.33 +>   * Store information in human-readable plain text files whenever it is
    1.34 +>     possible.
    1.35 +>   * There is no "one true way" to do anything.
    1.36 +>   * Prefer commandline tools over graphical tools.
    1.37 +
    1.38 +It decided to split single tazpkg code into few independent modules.
    1.39 +
    1.40 +Goals: not to scroll thousand of lines to move forth and back to the internal
    1.41 +tazpkg functions and to the main tazpkg code; knowledge that single code
    1.42 +changing in the one place will not have side effect in the other place; reduce
    1.43 +the barrier to entry for new developers.
    1.44 +
    1.45 +
    1.46 +Place best fit tazpkg modules is /usr/libexec directory.
    1.47 +http://www.linuxbase.org/betaspecs/fhs/fhs/ch04s07.html
    1.48 +
    1.49 +> /usr/libexec includes internal binaries that are not intended to be executed
    1.50 +> directly by users or shell scripts. Applications may use a single subdirectory
    1.51 +> under /usr/libexec.
    1.52 +
    1.53 +> Applications which use /usr/libexec in this way must not also use /usr/lib to
    1.54 +> store internal binaries, though they may use /usr/lib for the other purposes
    1.55 +> documented here.
    1.56 +
    1.57 +So, directory for tazpkg modules is /usr/libexec/tazpkg/.
    1.58 +It is out of the PATH, so modules will not interfere with original Linux
    1.59 +commands and will not autocomplete in the terminal. Nothing changed with the
    1.60 +user experience: it is still single tazpkg.
    1.61 +
    1.62 +
    1.63 +To execute module we need to know full path to the module.
    1.64 +We can use simple names for modules such as "help", "convert", "list", etc.
    1.65 +
    1.66 +
    1.67 +Directory variables
    1.68 +-------------------
    1.69 +
    1.70 +Many programs can be configured using variables such as prefix, docdir, etc.:
    1.71 +  make prefix=/usr install
    1.72 +
    1.73 +All variables are in lower case (only DESTDIR is in upper case). See more here:
    1.74 +https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
    1.75 +
    1.76 +Makefile contains variables support with default values.
    1.77 +Default prefix=/usr, all other variables are defaults to values described
    1.78 +at the given link.
    1.79 +
    1.80 +
    1.81 +Code commenting
    1.82 +---------------
    1.83 +
    1.84 +Developer comments are very important to understand how program works.
    1.85 +But that comments are useless to the end user and they just increase the size
    1.86 +of the scripts without making any changes to the script business logic. It also
    1.87 +increase the size of the scripts that includes shared "libs" such as libtaz.sh.
    1.88 +
    1.89 +We can strip all the comments from installed scripts, leaving that comments
    1.90 +for developers in the SliTaz Hg repositories.
    1.91 +
    1.92 +We need only to leave "#!/bin/sh" line and one-two lines of comments described
    1.93 +what it is and where you can find the original scripts if you want to develop
    1.94 +them.
    1.95 +
    1.96 +
    1.97 +Tests
    1.98 +-----
    1.99 +
   1.100 +Tests are the important part of the development process. TazPkg development is
   1.101 +not easy. We have no automated tests at the moment. Only we can do manual tests,
   1.102 +but we even have no check-list.
   1.103 +
   1.104 +To test tazpkg effectively we need two sorts of the tests. One set of the tests
   1.105 +we can reproduce in the local file system (inside special prepared chroot
   1.106 +environment). For other tests we need special test-server that provide special
   1.107 +test cases (emulate package database changes), also provide both main and few
   1.108 +undigest repositories. We can set up special scripts and test repository on the
   1.109 +existing server (cook.slitaz.org).
   1.110 +