Getting Source Package#

To clone Fedora NSS package repository:

$ fedpkg clone nss Fedora/nss

Getting Patched Source Code#

Extract the patched source code with the following commands:

$ cd Fedora/nss
$ fedpkg prep

The above commands will extract the patched source code into Fedora/nss/nss-3.36.1 folder.

Creating a New Patch#

Create a copy of the patched source code:

$ cd nss-3.36.1
$ git init .
$ git add .
$ git commit -a -m "Initial import"

Change the code as needed, commit the changes, then generate a patch:

$ git format-patch -1 -o ..

Edit nss.spec to include the patch:

Source0:     ...
...
Patch<N>:    <patch>
%prep
...
%patch<N> -p1

Verify with the following command:

$ fedpkg prep

Updating Source Tarball#

To generate a new source tarball:

$ cd nss
$ git archive --format=tar.gz --prefix nss-3.58/nss/ -o nss-3.58.tar.gz NSS_3_58_BRANCH

To remove the old tarball checksum:

$ cd Fedora/nss
$ sed -i '/\(nss-.*.tar.gz\)/d' sources

To add a new tarball checksum:

$ cd Fedora/nss
$ sha512sum nss-*.tar.gz --tag >> sources

Creating Binary Packages#

Creating Local Build#

To build the binary packages:

$ cd Fedora/nss
$ fedpkg local

To build the packages without running the test suite:

$ SKIP_NSS_TEST_SUITE=1 fedpkg local

To include specific tests only, edit nss.spec as follows:

%global nss_cycles "standard"
%global nss_tests "ssl_gtests"
%global nss_ssl_tests "normal_fips"
%global nss_ssl_run "auth"

Then build the packages as follows:

$ fedpkg local

Creating COPR Build#

To create a COPR build for Rawhide:

$ fedpkg srpm
$ copr build @pki/10.6 <SRPM> -r fedora-rawhide-x86_64

To create a COPR build for released Fedora:

$ fedpkg srpm
$ copr build @pki/10.6 <SRPM> -r fedora-27-x86_64 -r fedora-28-x86_64

Installing Binary Packages#

To install the packages:

$ dnf reinstall x86_64/*.rpm