tpm

Created: 2011-07-18 19:44
Updated: 2014-03-11 05:40

README.md

Available commands

  • help: Provides detailed information on commands.
  • install: Installs a package on the local selected environment.
  • list: List remote and local packages.
  • search: Search for remote or local packages based on their name.
  • stage: Stages up an environment
  • uninstall: Uninstalls local packages for the currently selected environment.
  • update: Updates local packages using the currently selected environment.
  • usage: Provides information on the available commands.

Library layout

This is a standard open source library layout. And additional package.conf file is here to add some meta data to the project.

  • library_name
    • CMakeLists.txt
    • package.conf
    • include
      • library_name
        • header.h
    • source
      • source.cpp

Repository layout

Libraries could be located anywhere on the repository, but grouping them in a common libraries/ directory is a good practice. Note that libraries are respecting a standard SVN layout, using branches, tags and trunk directories. Environments are just directories containing symlinks to specific tags of the libraries. You could even directly point to the library itself if you want an up to date environment. Users could create their own environments under their private repositories.

  • libraries
    • library1
      • branches
      • tags
        • branch1
        • branch2
      • trunk
        • CMakeLists.txt
        • package.conf
        • include
          • library1
            • header.h
        • source
          • source.cpp
    • library2
      • branches
      • tags
        • branch1
        • branch2
      • trunk
        • CMakeLists.txt
        • package.conf
        • include
          • library2
            • header.h
        • source
          • source.cpp
  • environments
    • stable
      • library1 -> //repo/libraries/library1/tags/branch1
      • library2 -> //repo/libraries/library2/tags/branch2
    • dev
      • library1 -> //repo/libraries/library1
      • library2 -> //repo/libraries/library2
  • users
    • username
      • custom_env
        • library1 -> //repo/libraries/library1/tags/branch2
        • library2 -> //repo/libraries/library2/tags/branch2

Local layout

An environment file describes all the necessary variables that TPM needs to know in order to select the right libraries. Variables are self-explanatory.

  • stable.env

    repos_type: svn
    repos_url : svn://svn.host.com/environments/stable
    root_path : /opt/tpm/env/stable
    
  • ~/.tpmrc

    repo_type: perforce
    repo_url : //depot/users/username/custom_env
    root_path: /home/username/.tpm/custom
    

Source directory layout

The TPM_SOURCE_PATH directory only contains a pristine checkout of the remote package.

  • TPM_SOURCE_PATH
    • library1
      • contents of library1 checkout...

Build directory layout

The TPM_BUILD_PATH directory is where is package is going to be built. TPM will generate some logs in it, that the user could refer to if anything goes wrong during the install process. The install_manifest.txt file is automatically generated by CMake during the install target, and contains all the components that were installed on the filesystem. After a build, the clean target is called.

  • TPM_BUILD_PATH
    • library1
      • install_manifest.txt
      • checkout.log
      • configuration.log
      • build.log
      • install.log

Install directory layout

This is just a pretty standard /usr directory layout. Note than when installing a package, a file FindPackage.cmake is generated and contains everything needed to find and link the package if necessary. Using FindX.cmake files is standard CMake practice and should be encouraged.

  • TPM_INSTALL_PATH
    • bin
      • package1
      • package2
    • lib
      • package3.so
      • package4.a
    • include
      • package1
        • package1.h
      • package2
        • package2.h

package.conf format

name        = "gnome"
depends     = ["x11", "freetype"]
description = "The gnome window manager"
Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more