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 formats:
master
v<major>
v<major>.<minor>
DOGTAG_<major>_<minor>_BRANCH
During development PKI may require dependencies that are only available in COPR repositories.
The COPR repository names follow the following formats:
@pki/master
@pki/<major>
@pki/<major>.<minor>
Enable the COPR repository that corresponds to the current branch:
$ sudo dnf copr -y enable <repository>
To install PKI dependencies:
$ sudo dnf builddep -y --spec pki.spec
To build PKI:
$ ./build.sh [OPTIONS] <target>
Available targets:
dist
: build PKI binaries (default)install
: install PKI binariessrc
: build RPM sources (tarball and patch)spec
: build RPM sources and RPM specsrpm
: build RPM sources, RPM spec, and SRPM packagerpm
: build RPM sources, RPM spec, SRPM package, and RPM packages
To build the binaries:
$ ./build.sh dist
It will build the binaries with the current files in the source directory.
The package version number and release number will be determined by the macros defined in the pki.spec.
To install the binaries:
$ ./build.sh install
The default working directory is ~/build/pki
.
To change the working directory:
$ ./build.sh --work-dir=<path>
To build RPM packages:
$ ./build.sh rpm
The following subfolders will be created in the working directory:
BUILD
: contains unpacked source codeBUILDROOT
: contains installed binariesRPMS
: contains the binary packagesSOURCES
: contains the tarball and patch filesSPECS
: contains the spec fileSRPMS
: contains the source package
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 rpm
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=<name> rpm
Note: The distribution name should not be prefixed with a dot (e.g. fc36
).
To build with the source code already committed into the current branch:
$ ./build.sh --source-tag=HEAD rpm
This will produce the following file:
pki-<version>.tar.gz
: tarball containing the source code up to theHEAD
of the branch
To build with a tarball and a patch file:
$ ./build.sh --source-tag=<tag> rpm
This will produce the following files:
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 toHEAD
To build the specified packages only:
$ ./build.sh --with-pkgs=base,server,ca,kra,ocsp,tks,tps,acme rpm
To build everything except the specified packages:
$ ./build.sh --without-pkgs=javadoc,theme,meta,tests,debug rpm
Available packages:
base
server
ca
kra
ocsp
tks
tps
acme
javadoc
theme
meta
tests
debug
To install the RPM packages:
$ sudo dnf install ~/build/pki/RPMS/*