Skip to content

Latest commit

 

History

History
176 lines (120 loc) · 3.55 KB

Building_PKI.md

File metadata and controls

176 lines (120 loc) · 3.55 KB

Building PKI

Getting the Source Code

To clone the source repository:

$ git clone [email protected]:dogtagpki/pki.git
$ cd pki

By default it will checkout the master branch.

To list available branches:

$ git branch -r

To switch to a different branch:

$ git checkout <branch>

The branch names follow the following format:

DOGTAG_<major>_<minor>_BRANCH

Installing the Dependencies

During development PKI may require dependencies that are only available in PKI COPR repository.

To enable PKI COPR repository:

$ dnf copr -y enable @pki/<major>.<minor>

To install PKI dependencies:

$ dnf builddep -y --spec pki.spec

Building PKI Packages

To build PKI packages:

$ ./build.sh [OPTIONS] <target>

Available packages:

  • base
  • server
  • ca
  • kra
  • ocsp
  • tks
  • tps
  • javadoc
  • console
  • theme
  • meta
  • debug

Available targets:

  • src: build RPM sources (tarball and patch)
  • spec: build RPM spec and everything above
  • srpm: build SRPM package and everything above
  • rpm: build RPM packages and everything above (default)

The default working directory is $HOME/build/pki. During the build process the following subfolders will be created:

  • BUILD: contains unpacked source code
  • BUILDROOT: contains installed binaries
  • RPMS: contains the binary packages
  • SOURCES: contains the tarball and patch files
  • SPECS: contains the spec file
  • SRPMS: contains the source package

To start the build process:

$ ./build.sh

It will build all packages with the current files in the source directory.

The package version number and release number will be determined by the Version and Release attributes in the pki.spec.

Changing Working Directory

To change the working directory:

$ ./build.sh --work-dir=<working directory>

Adding Timestamp and Commit ID

To add the current timestamp and the latest commit ID of the current branch into the release number:

$ ./build.sh --with-timestamp --with-commit-id

Changing Distribution Name

The default distribution name can be obtained with the following command:

$ rpm --eval '%{dist}' | cut -c 2-

To change the distribution name:

$ ./build.sh --dist=<distribution name>

Note: The distribution name should not be prefixed with a dot (e.g. fc28).

Building with Checked-in Source Code

To build with the source code already checked into the current branch:

$ ./build.sh --source-tag=HEAD

This will produce the following source:

  • pki-<version>.tar.gz: tarball containing the source code up to the HEAD of the branch

Building with Patched Tarball

To build with a tarball and a patch file:

$ ./build.sh --source-tag=<tag>

This will produce the following sources:

  • pki-<version>.tar.gz: a tarball containing the source code tagged with <tag>
  • pki-<version>-<release>.patch: a combined patch containing all changes after <tag> up to HEAD

Building Select Packages

To build specified packages only:

$ ./build.sh --with-pkgs=base,server,ca,kra

To build everything except the specified packages:

$ ./build.sh --without-pkgs=base,server,ca,kra

It is equivalent to:

$ ./build.sh --with-pkgs=ocsp,tks,tps,javadoc,console,theme,meta,debug

Installing PKI Packages

To install the newly built packages:

$ dnf install $HOME/build/pki/RPMS/*