Skip to content
Commits on Source (119)
......@@ -3,5 +3,8 @@
<classpathentry excluding="samples/" kind="src" path=""/>
<classpathentry kind="src" path="samples"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="/usr/share/java/slf4j/slf4j-api.jar"/>
<classpathentry kind="lib" path="/usr/share/java/commons-lang.jar"/>
<classpathentry kind="lib" path="/usr/share/java/commons-codec.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
# BEGIN COPYRIGHT BLOCK
# (C) 2018 Red Hat, Inc.
# All rights reserved.
# END COPYRIGHT BLOCK
services:
- docker
env:
- FEDORA=27
- FEDORA=28
install:
- docker pull registry.fedoraproject.org/fedora:$FEDORA
- docker run
--name=container
--detach
-i
-v $(pwd):/root/jss
registry.fedoraproject.org/fedora:$FEDORA
- docker exec container dnf install -y dnf-plugins-core gcc make rpm-build
- docker exec container dnf copr -y enable @pki/10.6
- docker exec container dnf builddep -y --spec /root/jss/jss.spec.in
- docker exec container /root/jss/build.sh --with-timestamp --with-commit-id rpm
script:
- docker exec container rpm -Uvh /root/build/jss/RPMS/*
============================================
|| Upstream JSS Build/Test Instructions ||
============================================
(1) Prepare a work area
(a) For upstream builds which checkout and utilize
the current NSPR and NSS source repositories:
# mkdir sandbox
# cd sandbox
# hg clone https://hg.mozilla.org/projects/nspr
# hg clone https://hg.mozilla.org/projects/nss
# git clone git@github.com:dogtagpki/jss.git
# cd ..
(There is no need to clone every time. For additional builds,
simply use:
cd nspr; hg pull -u -v; cd ..; cd nss; hg pull -u -v; cd ..;
cd jss; hg pull -u -v; cd ..
)
(b) Alternatively, for upstream builds which use
the NSPR and NSS installed on the system:
# mkdir sandbox
# cd sandbox
# export USE_INSTALLED_NSPR=1
# export USE_INSTALLED_NSS=1
# export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
# export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
# export NSPR_INCLUDE_DIR=`/usr/bin/pkg-config --cflags-only-I nspr | sed 's/-I//'`
# export NSPR_LIB_DIR=`/usr/bin/pkg-config --libs-only-L nspr | sed 's/-L//'`
# export NSS_INCLUDE_DIR=`/usr/bin/pkg-config --cflags-only-I nss | sed 's/-I//'`
# export NSS_LIB_DIR=`/usr/bin/pkg-config --libs-only-L nss | sed 's/-L//'`
# export XCFLAGS="-g"
# hg clone https://hg.mozilla.org/projects/jss
# cd ..
(There is no need to clone every time. For additional builds,
simply use:
cd jss; hg pull -u -v; cd ..
)
(2) Prepare an interactive shell for building:
# export JAVA_HOME=/etc/alternatives/java_sdk_1.8.0_openjdk
# export USE_64=1
NOTE: JSS will now attempt to verify whether or not these two
environment variables have been set (JAVA_HOME is mandatory;
USE_64 is mandatory on 64-bit platforms when building 64-bit).
The following steps are optional, and left to the discretion of the user:
Debug vs. Optimized jar files:
By default, JSS will be built as a debuggable jar
(xpclass_dbg.jar - generally recommended for test builds);
to create an optimized jar (xpclass.jar), set the following
environment variable:
# export BUILD_OPT=1
Beta vs. Non-Beta builds:
Finally, by default, JSS is not built as a "beta" release (as
specified in 'org/mozilla/jss/util/jssver.h'):
#define JSS_BETA PR_FALSE
If a "beta" version of JSS is desired, reset this #define (as
specified in 'org/mozilla/jss/util/jssver.h') to:
#define JSS_BETA PR_TRUE
(3) Build JSS
# cd sandbox/jss
# make clean all
# cd ../..
(or you can run "# script -c 'make clean all' typescript.build")
NOTE: When build method (1)(a) is being utilized, if nss has not been
built, it will now automatically be built before jss; if nss has
already been built, only jss will be built/re-built.
(4) Install JSS on the System (Optional)
If JSS already exists on the system, run something similar to the
following command(s):
# sudo mv /usr/lib/java/jss4.jar /usr/lib/java/jss4.jar.orig
If the platform is 32-bit Linux:
# sudo mv /usr/lib/jss/libjss4.so /usr/lib/jss/libjss4.so.orig
else if the platform is 64-bit Linux:
# sudo mv /usr/lib64/jss/libjss4.so /usr/lib64/jss/libjss4.so.orig
If BUILD_OPT is undefined (default Debuggable Jar):
# sudo cp sandbox/dist/xpclass_dbg.jar /usr/lib/java/jss4.jar
else if BUILD_OPT is defined (Optimized Jar):
# sudo cp sandbox/dist/xpclass.jar /usr/lib/java/jss4.jar
# sudo chown root:root /usr/lib/java/jss4.jar
# sudo chmod 644 /usr/lib/java/jss4.jar
# sudo cp sandbox/jss/lib/Linux*.OBJ/libjss4.so /usr/lib64/jss/libjss4.so
# sudo chown root:root /usr/lib64/jss/libjss4.so
# sudo chmod 755 /usr/lib64/jss/libjss4.so
(5) Run JSS Tests (Optional, but only if build method (1)(a) was utilized)
If build method (1)(a) is being utilized, it is possible to run the
built-in JSS tests:
# cd sandbox/jss
# make test_jss
# cd ../..
(or you can run "# script -c 'make test_jss' typescript.tests")
NOTE: This command is currently only available on Linux and Macintosh
platforms when method (1)(a) has been utilized to build JSS
since the tests are dependent upon the work area as setup in
this method; currenty JSS must be built via 'make clean all' before
execution of this command (e.g. - build is separate from test).
(6) Restoration of non-Test-Only Systems (Optional)
If step (4) above was run, and the system is being used for purposes
other than test, the user may wish to restore the original system JSS
by running the following commands:
# sudo mv /usr/lib/java/jss4.jar.orig /usr/lib/java/jss4.jar
If the platform is 32-bit Linux:
# sudo mv /usr/lib/jss/libjss4.so.orig /usr/lib/jss/libjss4.so
else if the platform is 64-bit Linux:
# sudo mv /usr/lib64/jss/libjss4.so.orig /usr/lib64/jss/libjss4.so
NOTE: For this procedure, no ownership or permission changes should
be necessary.
(7) Tagging the Source Code for a Release
During development, several releases may be made. Consequently, it is
good practice to create a "regular tag" to the source code at these
various points in time using the following format:
# hg tag -m "message" JSS_<major>_<minor>_YYYYMMDD
where: <major> = JSS Major Version Number
<minor> = JSS Minor Version Number
YYYY = 4-digit year (e. g. - 2017)
MM = 2-digit month (e. g. - 01, ..., 12)
DD = 2-digit day of the month (e. g. - 01, ..., 31)
For example:
# hg id
b3e864205ff0+ tip
# hg tag -m "Added tag JSS_4_4_20170328 for changeset b3e864205ff0" JSS_4_4_20170328
At the appropriate time, a new major.minor version may be created. At this
time, it is important to create a maintenance branch for any future changes
to the previous major.minor version:
For example:
# hg id
f00f00f00f00+ tip
# hg branch -m "Created branch JSS_4_4_BRANCH for changeset f00f00f00f00" JSS_4_4_BRANCH
(8) Known Issues
* Mozilla Bug #1346410 - Load JSS libraries appropriately
NOTE: This issue should not occur unless step (4) above was skipped.
Testing failures were found while working on Bug 1346410 when loading the
JSS libraries to meet requirements of certain operating systems. Our
investigation revealed that due to the nature of the changes made via this
patch and its interaction with the HMAC Tests (both non-FIPS and FIPS),
that a failure may be encountered on one or more of the HMAC algorithms
causing these two tests to fail. On 64-bit Linux, for example, the
workaround for this issue is to perform the following steps before
re-running the tests:
(a) Install the new JSS builds by executing step (4) above
(b) Execute the following commands:
# cd sandbox/jss; make test_jss
NOTE: If the system is being used for purposes other than test, the user
may wish to restore the original JSS by executing step (6) above.
Network Security Services for Java (JSS)
========================================
Overview
--------
**Network Security Services for Java** is a Java interface to [NSS](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS).
JSS supports most of the security standards and encryption technologies supported by NSS.
JSS also provides a pure Java interface for ASN.1 types and BER/DER encoding.
* Website: http://www.dogtagpki.org/wiki/JSS
* Issues: https://pagure.io/jss/issues
Build/Test Instructions
-----------------------
### 1. Prepare a work area
(a) For upstream builds which checkout and utilize
the current NSPR and NSS source repositories:
```
# mkdir sandbox
# cd sandbox
# hg clone https://hg.mozilla.org/projects/nspr
# hg clone https://hg.mozilla.org/projects/nss
# git clone git@github.com:dogtagpki/jss.git
# cd ..
```
There is no need to clone every time. For additional builds,
simply use:
```
# cd nspr
# hg pull -u -v
# cd ..
# cd nss
# hg pull -u -v
# cd ..
# cd jss
# git pull -v
# cd ..
````
(b) Alternatively, for upstream builds which use
the NSPR and NSS installed on the system:
```
# mkdir sandbox
# cd sandbox
# export USE_INSTALLED_NSPR=1
# export USE_INSTALLED_NSS=1
# export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
# export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
# export NSPR_INCLUDE_DIR=`/usr/bin/pkg-config --cflags-only-I nspr | sed 's/-I//'`
# export NSPR_LIB_DIR=`/usr/bin/pkg-config --libs-only-L nspr | sed 's/-L//'`
# export NSS_INCLUDE_DIR=`/usr/bin/pkg-config --cflags-only-I nss | sed 's/-I//'`
# export NSS_LIB_DIR=`/usr/bin/pkg-config --libs-only-L nss | sed 's/-L//'`
# export XCFLAGS="-g"
# hg clone https://hg.mozilla.org/projects/jss
# cd ..
```
There is no need to clone every time. For additional builds,
simply use:
```
# cd jss
# git pull -v
# cd ..
```
### 2. Prepare an interactive shell for building
```
# export JAVA_HOME=/etc/alternatives/java_sdk_1.8.0_openjdk
# export USE_64=1
```
NOTE: JSS will now attempt to verify whether or not these two
environment variables have been set (JAVA_HOME is mandatory;
USE_64 is mandatory on 64-bit platforms when building 64-bit).
The following steps are optional, and left to the discretion of the user:
#### Normal vs. Optimized builds
By default, JSS will be built as a normal binaries.
To create an optimized build, set the following
environment variable:
```
# export BUILD_OPT=1
```
#### Beta vs. Non-Beta builds
Finally, by default, JSS is not built as a "beta" release (as
specified in 'org/mozilla/jss/util/jssver.h'):
```
#define JSS_BETA PR_FALSE
```
If a "beta" version of JSS is desired, reset this #define (as
specified in 'org/mozilla/jss/util/jssver.h') to:
```
#define JSS_BETA PR_TRUE
```
### 3. Build JSS
To build JSS, execute the following commands:
```
# cd sandbox/jss
# make clean all
# cd ../..
```
or you can run:
```
# script -c 'make clean all' typescript.build
```
NOTE: When build method (1)(a) is being utilized, if nss has not been
built, it will now automatically be built before jss; if nss has
already been built, only jss will be built/re-built.
### 4. Install JSS on the System (Optional)
If JSS already exists on the system, run something similar to the
following command(s):
```
# sudo mv /usr/lib/java/jss4.jar /usr/lib/java/jss4.jar.orig
```
If the platform is 32-bit Linux:
```
# sudo mv /usr/lib/jss/libjss4.so /usr/lib/jss/libjss4.so.orig
```
else if the platform is 64-bit Linux:
```
# sudo mv /usr/lib64/jss/libjss4.so /usr/lib64/jss/libjss4.so.orig
```
Then install the new JSS binaries:
```
# sudo cp sandbox/dist/xpclass.jar /usr/lib/java/jss4.jar
# sudo chown root:root /usr/lib/java/jss4.jar
# sudo chmod 644 /usr/lib/java/jss4.jar
# sudo cp sandbox/jss/lib/Linux*.OBJ/libjss4.so /usr/lib64/jss/libjss4.so
# sudo chown root:root /usr/lib64/jss/libjss4.so
# sudo chmod 755 /usr/lib64/jss/libjss4.so
```
### 5. Run JSS Tests (Optional, but only if build method (1)(a) was utilized)
If build method (1)(a) is being utilized, it is possible to run the built-in JSS tests:
```
# cd sandbox/jss
# make test_jss
# cd ../..
```
or you can run:
```
# script -c 'make test_jss' typescript.tests
```
NOTE: This command is currently only available on Linux and Macintosh
platforms when method (1)(a) has been utilized to build JSS
since the tests are dependent upon the work area as setup in
this method; currenty JSS must be built via 'make clean all' before
execution of this command (e.g. - build is separate from test).
### 6. Restoration of non-Test-Only Systems (Optional)
If step (4) above was run, and the system is being used for purposes
other than test, the user may wish to restore the original system JSS
by running the following commands:
```
# sudo mv /usr/lib/java/jss4.jar.orig /usr/lib/java/jss4.jar
```
If the platform is 32-bit Linux:
```
# sudo mv /usr/lib/jss/libjss4.so.orig /usr/lib/jss/libjss4.so
```
else if the platform is 64-bit Linux:
```
# sudo mv /usr/lib64/jss/libjss4.so.orig /usr/lib64/jss/libjss4.so
```
NOTE: For this procedure, no ownership or permission changes should
be necessary.
### 7. Tagging the Source Code for a Release
During development, several releases may be made. Consequently, it is
good practice to create a "regular tag" to the source code at these
various points in time using the following format:
```
# git tag -m "message" JSS_<major>_<minor>_<YYYYMMDD>
```
where:
* major = JSS Major Version Number
* minor = JSS Minor Version Number
* YYYY = 4-digit year (e. g. - 2017)
* MM = 2-digit month (e. g. - 01, ..., 12)
* DD = 2-digit day of the month (e. g. - 01, ..., 31)
For example:
```
# git rev-parse HEAD
b3e864205ff0...
# git tag -m "Added tag JSS_4_4_20170328 for changeset b3e864205ff0" JSS_4_4_20170328
```
At the appropriate time, a new major.minor version may be created. At this
time, it is important to create a maintenance branch for any future changes
to the previous major.minor version:
For example:
```
# git rev-parse HEAD
f00f00f00f00...
# git checkout -b JSS_4_4_BRANCH
```
### 8. Known Issues
Some of the known issues are:
* Mozilla Bug #1346410 - Load JSS libraries appropriately
NOTE: This issue should not occur unless step (4) above was skipped.
Testing failures were found while working on Bug 1346410 when loading the
JSS libraries to meet requirements of certain operating systems. Our
investigation revealed that due to the nature of the changes made via this
patch and its interaction with the HMAC Tests (both non-FIPS and FIPS),
that a failure may be encountered on one or more of the HMAC algorithms
causing these two tests to fail. On 64-bit Linux, for example, the
workaround for this issue is to perform the following steps before
re-running the tests:
* Install the new JSS builds by executing step (4) above
* Execute the following commands:
```
# cd sandbox/jss
# make test_jss
```
NOTE: If the system is being used for purposes other than test, the user
may wish to restore the original JSS by executing step (6) above.
#!/bin/bash -e
# BEGIN COPYRIGHT BLOCK
# (C) 2018 Red Hat, Inc.
# All rights reserved.
# END COPYRIGHT BLOCK
NAME=jss
SCRIPT_PATH=`readlink -f "$0"`
SCRIPT_NAME=`basename "$SCRIPT_PATH"`
SRC_DIR=`dirname "$SCRIPT_PATH"`
WORK_DIR="$HOME/build/$NAME"
SOURCE_TAG=
SPEC_TEMPLATE=
WITH_TIMESTAMP=
WITH_COMMIT_ID=
DIST=
VERBOSE=
DEBUG=
usage() {
echo "Usage: $SCRIPT_NAME [OPTIONS] <target>"
echo
echo "Options:"
echo " --work-dir=<path> Working directory (default: $WORK_DIR)."
echo " --source-tag=<tag> Generate RPM sources from a source tag."
echo " --spec=<file> Use the specified RPM spec."
echo " --with-timestamp Append timestamp to release number."
echo " --with-commit-id Append commit ID to release number."
echo " --dist=<name> Distribution name (e.g. fc28)."
echo " -v,--verbose Run in verbose mode."
echo " --debug Run in debug mode."
echo " --help Show help message."
echo
echo "Target:"
echo " src Generate RPM sources."
echo " spec Generate RPM spec."
echo " srpm Build SRPM package."
echo " rpm Build RPM packages (default)."
}
generate_rpm_sources() {
TARBALL="$NAME-$VERSION${_PHASE}.tar.gz"
if [ "$SOURCE_TAG" != "" ] ; then
if [ "$VERBOSE" = true ] ; then
echo "Generating $TARBALL from $SOURCE_TAG tag"
fi
git -C "$SRC_DIR" \
archive \
--format=tar.gz \
--prefix $NAME-$VERSION${_PHASE}/ \
-o "$WORK_DIR/SOURCES/$TARBALL" \
$SOURCE_TAG
if [ "$SOURCE_TAG" != "HEAD" ] ; then
TAG_ID=`git -C "$SRC_DIR" rev-parse $SOURCE_TAG`
HEAD_ID=`git -C "$SRC_DIR" rev-parse HEAD`
if [ "$TAG_ID" != "$HEAD_ID" ] ; then
generate_patch
fi
fi
return
fi
if [ "$VERBOSE" = true ] ; then
echo "Generating $TARBALL"
fi
tar czf "$WORK_DIR/SOURCES/$TARBALL" \
--transform "s,^./,$NAME-$VERSION${_PHASE}/," \
--exclude .git \
--exclude bin \
-C "$SRC_DIR" \
.
}
generate_patch() {
PATCH="$NAME-$VERSION-$RELEASE.patch"
if [ "$VERBOSE" = true ] ; then
echo "Generating $PATCH for all changes since $SOURCE_TAG tag"
fi
git -C "$SRC_DIR" \
format-patch \
--stdout \
$SOURCE_TAG \
> "$WORK_DIR/SOURCES/$PATCH"
}
generate_rpm_spec() {
RPM_SPEC="$NAME.spec"
if [ "$VERBOSE" = true ] ; then
echo "Generating $RPM_SPEC"
fi
# hard-code timestamp
commands="s/%{?_timestamp}/${_TIMESTAMP}/g"
# hard-code commit ID
commands="${commands}; s/%{?_commit_id}/${_COMMIT_ID}/g"
# hard-code phase
commands="${commands}; s/%{?_phase}/${_PHASE}/g"
# hard-code patch
if [ "$PATCH" != "" ] ; then
commands="${commands}; s/# Patch: jss-VERSION-RELEASE.patch/Patch: $PATCH/g"
fi
sed "$commands" "$SPEC_TEMPLATE" > "$WORK_DIR/SPECS/$RPM_SPEC"
# rpmlint "$WORK_DIR/SPECS/$RPM_SPEC"
}
while getopts v-: arg ; do
case $arg in
v)
VERBOSE=true
;;
-)
LONG_OPTARG="${OPTARG#*=}"
case $OPTARG in
work-dir=?*)
WORK_DIR=`readlink -f "$LONG_OPTARG"`
;;
source-tag=?*)
SOURCE_TAG="$LONG_OPTARG"
;;
spec=?*)
SPEC_TEMPLATE="$LONG_OPTARG"
;;
with-timestamp)
WITH_TIMESTAMP=true
;;
with-commit-id)
WITH_COMMIT_ID=true
;;
dist=?*)
DIST="$LONG_OPTARG"
;;
verbose)
VERBOSE=true
;;
debug)
VERBOSE=true
DEBUG=true
;;
help)
usage
exit
;;
'')
break # "--" terminates argument processing
;;
work-dir* | source-tag* | spec* | dist*)
echo "ERROR: Missing argument for --$OPTARG option" >&2
exit 1
;;
*)
echo "ERROR: Illegal option --$OPTARG" >&2
exit 1
;;
esac
;;
\?)
exit 1 # getopts already reported the illegal option
;;
esac
done
# remove parsed options and args from $@ list
shift $((OPTIND-1))
if [ "$#" -lt 1 ] ; then
BUILD_TARGET=rpm
else
BUILD_TARGET=$1
fi
if [ "$DEBUG" = true ] ; then
echo "WORK_DIR: $WORK_DIR"
echo "BUILD_TARGET: $BUILD_TARGET"
fi
if [ "$BUILD_TARGET" != "src" ] &&
[ "$BUILD_TARGET" != "spec" ] &&
[ "$BUILD_TARGET" != "srpm" ] &&
[ "$BUILD_TARGET" != "rpm" ] ; then
echo "ERROR: Invalid build target: $BUILD_TARGET" >&2
exit 1
fi
if [ "$SPEC_TEMPLATE" = "" ] ; then
SPEC_TEMPLATE="$SRC_DIR/$NAME.spec.in"
fi
VERSION="`rpmspec -P "$SPEC_TEMPLATE" | grep "^Version:" | awk '{print $2;}'`"
if [ "$DEBUG" = true ] ; then
echo "VERSION: $VERSION"
fi
RELEASE="`rpmspec -P "$SPEC_TEMPLATE" --undefine dist | grep "^Release:" | awk '{print $2;}'`"
if [ "$DEBUG" = true ] ; then
echo "RELEASE: $RELEASE"
fi
spec=$(<"$SPEC_TEMPLATE")
regex=$'%global *_phase *([^\n]+)'
if [[ $spec =~ $regex ]] ; then
_PHASE="${BASH_REMATCH[1]}"
fi
if [ "$DEBUG" = true ] ; then
echo "PHASE: ${_PHASE}"
fi
if [ "$WITH_TIMESTAMP" = true ] ; then
TIMESTAMP="`date +"%Y%m%d%H%M%S"`"
_TIMESTAMP=".$TIMESTAMP"
fi
if [ "$DEBUG" = true ] ; then
echo "TIMESTAMP: $TIMESTAMP"
fi
if [ "$WITH_COMMIT_ID" = true ]; then
COMMIT_ID="`git -C "$SRC_DIR" rev-parse --short=8 HEAD`"
_COMMIT_ID=".$COMMIT_ID"
fi
if [ "$DEBUG" = true ] ; then
echo "COMMIT_ID: $COMMIT_ID"
fi
echo "Building $NAME-$VERSION-$RELEASE${_TIMESTAMP}${_COMMIT_ID}"
################################################################################
# Initialize working directory
################################################################################
if [ "$VERBOSE" = true ] ; then
echo "Initializing $WORK_DIR"
fi
mkdir -p $WORK_DIR
cd $WORK_DIR
rm -rf BUILD
rm -rf RPMS
rm -rf SOURCES
rm -rf SPECS
rm -rf SRPMS
mkdir BUILD
mkdir RPMS
mkdir SOURCES
mkdir SPECS
mkdir SRPMS
################################################################################
# Generate RPM sources
################################################################################
generate_rpm_sources
echo "RPM sources:"
find "$WORK_DIR/SOURCES" -type f -printf " %p\n"
if [ "$BUILD_TARGET" = "src" ] ; then
exit
fi
################################################################################
# Generate RPM spec
################################################################################
generate_rpm_spec
echo "RPM spec:"
find "$WORK_DIR/SPECS" -type f -printf " %p\n"
if [ "$BUILD_TARGET" = "spec" ] ; then
exit
fi
################################################################################
# Build source package
################################################################################
OPTIONS=()
OPTIONS+=(--quiet)
OPTIONS+=(--define "_topdir ${WORK_DIR}")
if [ "$WITH_TIMESTAMP" = true ] ; then
OPTIONS+=(--define "_timestamp ${_TIMESTAMP}")
fi
if [ "$WITH_COMMIT_ID" = true ] ; then
OPTIONS+=(--define "_commit_id ${_COMMIT_ID}")
fi
if [ "$DIST" != "" ] ; then
OPTIONS+=(--define "dist .$DIST")
fi
if [ "$DEBUG" = true ] ; then
echo "rpmbuild -bs ${OPTIONS[@]} $WORK_DIR/SPECS/$RPM_SPEC"
fi
# build SRPM with user-provided options
rpmbuild -bs "${OPTIONS[@]}" "$WORK_DIR/SPECS/$RPM_SPEC"
rc=$?
if [ $rc != 0 ]; then
echo "ERROR: Unable to build SRPM package"
exit 1
fi
SRPM=`find "$WORK_DIR/SRPMS" -type f`
echo "SRPM package:"
echo " $SRPM"
if [ "$BUILD_TARGET" = "srpm" ] ; then
exit
fi
################################################################################
# Build binary packages
################################################################################
OPTIONS=()
if [ "$VERBOSE" = true ] ; then
OPTIONS+=(--define "_verbose 1")
fi
OPTIONS+=(--define "_topdir ${WORK_DIR}")
if [ "$DEBUG" = true ] ; then
echo "rpmbuild --rebuild ${OPTIONS[@]} $SRPM"
fi
# rebuild RPM with hard-coded options in SRPM
rpmbuild --rebuild "${OPTIONS[@]}" "$SRPM"
rc=$?
if [ $rc != 0 ]; then
echo "ERROR: Unable to build RPM packages"
exit 1
fi
# install SRPM to restore sources and spec file removed during rebuild
rpm -i --define "_topdir $WORK_DIR" "$SRPM"
# flatten folder
find "$WORK_DIR/RPMS" -mindepth 2 -type f -exec mv -i '{}' "$WORK_DIR/RPMS" ';'
# remove empty subfolders
find "$WORK_DIR/RPMS" -mindepth 1 -type d -delete
echo "RPM packages:"
find "$WORK_DIR/RPMS" -type f -printf " %p\n"
#use strict;
use Cwd qw(abs_path);
use File::Find;
use File::Compare;
use File::Basename;
......@@ -143,32 +144,45 @@ sub setup_vars {
$javah = "$ENV{JAVA_HOME}/bin/javah";
$javadoc = "$ENV{JAVA_HOME}/bin/javadoc";
$dist_dir = $cmdline_vars{SOURCE_PREFIX};
$dist_dir = abs_path($cmdline_vars{SOURCE_PREFIX});
$jce_jar = $ENV{JCE_JAR};
$class_release_dir = $cmdline_vars{SOURCE_RELEASE_PREFIX};
if( $ENV{BUILD_OPT} ) {
$class_dir = "$dist_dir/classes";
$class_jar = "$dist_dir/$cmdline_vars{XPCLASS_JAR}";
$class_release_dir .= "/$cmdline_vars{SOURCE_RELEASE_CLASSES_DIR}";
if( $ENV{BUILD_OPT} ) {
$javac_opt_flag = "-O";
$debug_source_file = "org/mozilla/jss/util/Debug_ship.jnot";
} else {
$class_dir = "$dist_dir/classes_DBG";
$class_jar = "$dist_dir/$cmdline_vars{XPCLASS_DBG_JAR}";
$class_release_dir .= "/$cmdline_vars{SOURCE_RELEASE_CLASSES_DBG_DIR}";
$javac_opt_flag = "-g";
$debug_source_file = "org/mozilla/jss/util/Debug_debug.jnot";
}
$jni_header_dir = "$dist_dir/private/jss/_jni";
if( $ENV{DEBIAN_BUILD} ) {
$jarFiles = "/usr/share/java/slf4j-api.jar:/usr/share/java/commons-codec.jar";
} else {
$jarFiles = "/usr/share/java/slf4j/slf4j-api.jar:/usr/share/java/commons-codec.jar";
}
$classpath = "-classpath $jarFiles:/usr/share/java/commons-lang.jar";
if( $jce_jar ) {
$classpath = "-classpath $jce_jar";
$classpath .= ":$jce_jar";
}
if( $ENV{CHECK_DEPRECATION} ) {
$javac_deprecation_flag = "-Xlint:deprecation";
} else {
$javac_deprecation_flag = "";
}
# retrieve present working directory
$pwd = `pwd`;
$pwd =~ chomp $pwd;
$jss_dir = `pwd`;
$jss_dir =~ chomp $jss_dir;
print "JSS directory: $jss_dir\n";
$work_dir = dirname($jss_dir);
print "Working directory: $work_dir\n";
# retrieve architecture
$arch = `uname -m`;
......@@ -178,13 +192,17 @@ sub setup_vars {
$os = `uname`;
$os =~ chomp $os;
$jss_objdir = "$work_dir/dist/$cmdline_vars{JSS_OBJDIR_NAME}";
print "jss_objdir=$jss_objdir\n";
if( ( $ENV{USE_INSTALLED_NSPR} ) && ( $ENV{USE_INSTALLED_NSS} ) ) {
print "Using the NSPR and NSS installed on the system to build JSS.\n";
} else {
# Verify existence of work area
if(( ! -d "$pwd/../nspr" ) ||
( ! -d "$pwd/../nss" ) ||
( ! -d "$pwd/../jss" )) {
if(( ! -d "$work_dir/nspr" ) ||
( ! -d "$work_dir/nss" ) ||
( ! -d "$jss_dir" )) {
my $workarea = "\nA work area must first be prepared; for example:\n\n"
. " mkdir sandbox\n"
. " cd sandbox\n"
......@@ -197,56 +215,41 @@ sub setup_vars {
}
# Build NSS if not already built
if( ! -d $dist_dir ) {
my $nss_latest_objdir = "$dist_dir/latest";
if( ! -e $nss_latest_objdir ) {
print("########################\n" .
"# BEGIN: Building NSS #\n" .
"########################\n");
print_do("cd ../nss;make clean nss_build_all;cd ../jss");
print_do("cd $work_dir/nss;make clean nss_build_all;cd $jss_dir");
print("######################\n" .
"# END: Building NSS #\n" .
"######################\n");
}
if( $os eq 'Linux' || $os eq 'Darwin' ) {
# set major and minor release numbers
$majorrel = `uname -r | cut -f1 -d.`;
$majorrel =~ chomp $majorrel;
$minorrel = `uname -r | cut -f2 -d.`;
$minorrel =~ chomp $minorrel;
$nss_objdir_name = `cat $nss_latest_objdir`;
chomp($nss_objdir_name);
# read the contents of the $dist_dir into an array
opendir DIR, $dist_dir or die "Cannot open directory: $!";
my @files = readdir DIR;
closedir DIR;
$nss_bin_dir = "$dist_dir/$nss_objdir_name/bin";
$nss_lib_dir = "$dist_dir/$nss_objdir_name/lib";
# process the array to obtain the NSS OBJDIR_NAME
my $prefix = "$os$majorrel.$minorrel";
foreach my $file (@files) {
if ((index($file, $prefix) != -1) &&
(index($file, "_cc") != -1)) {
$nss_objdir_name = $file;
print "NSS OBJDIR_NAME=$nss_objdir_name\n";
# craft JSS OBJDIR_NAME based upon value of NSS OBJDIR_NAME
$jss_objdir_name = $nss_objdir_name;
$jss_objdir_name =~ s/_cc//;
print "JSS OBJDIR_NAME=$jss_objdir_name\n";
break;
}
}
# create a JSS OBJDIR_NAME symlink to NSS OBJDIR_NAME in $dist_dir
$jss_symlink = "$pwd/../dist/$jss_objdir_name";
if( ! -l $jss_symlink ) {
my $cmd = "cd ../dist;"
# create a JSS OBJDIR_NAME symlink to NSS OBJDIR_NAME
if( ! -l $jss_objdir ) {
my $cmd = "cd $work_dir/dist;"
. "ln -s $nss_objdir_name $jss_objdir_name;"
. "cd ../jss";
. "cd $jss_dir";
print_do($cmd);
}
print "jss_symlink=$jss_symlink\n"
}
}
print "nss_bin_dir=$nss_bin_dir\n";
print "nss_lib_dir=$nss_lib_dir\n";
$jss_lib_dir = "$jss_objdir/lib";
print "jss_lib_dir=$jss_lib_dir\n";
}
sub clean {
......@@ -266,19 +269,23 @@ sub build {
}
#
# generate manifest.mf file in lib dir
# generate MANIFEST.MF file in dist dir
#
my $manifest_file = "MANIFEST.MF";
my $manifest_file = "$dist_dir/MANIFEST.MF";
print "Creating $manifest_file\n";
my $jss_revision = `grep JSS_VERSION org/mozilla/jss/util/jssver.h`;
chop($jss_revision);
$jss_revision = substr($jss_revision, 22, 3);
my $build_revision = $jss_revision;
$append = 0;
ensure_dir_exists($dist_dir);
if ($append) {
open(MYOUTFILE, ">MANIFEST.MF"); #open for write, overwrite
open(MYOUTFILE, ">$manifest_file"); #open for write, overwrite
} else {
open(MYOUTFILE, ">>MANIFEST.MF"); #open for write, append
open(MYOUTFILE, ">>$manifest_file"); #open for write, append
}
#*** Print freeform text, semicolon required ***
......@@ -330,10 +337,9 @@ MyLabel
#
if( scalar(@source_list) > 0 ) {
ensure_dir_exists($class_dir);
print_do("$javac $javac_opt_flag -sourcepath . -d $class_dir " .
print_do("$javac $javac_opt_flag $javac_deprecation_flag -sourcepath . -d $class_dir " .
"$classpath " . join(" ",@source_list));
print_do("sh -c 'pwd && cd $class_dir && pwd && rm -f $class_jar && pwd && ls -al && ls -al ../../dist && $jar -cvmf ../../jss/$manifest_file ../$class_jar *'");
print_do("rm -f $manifest_file");
print_do("sh -c 'cd $dist_dir/classes && $jar cvmf $dist_dir/MANIFEST.MF $dist_dir/xpclass.jar *'");
print "Exit status was " . ($?>>8) . "\n";
}
......@@ -373,7 +379,7 @@ sub needs_update {
# the source file's directory is different from its package, and it
# doesn't know about nested or inner classes.
# source_file: the relative path to the source file ("org/mozilla/jss/...")
# dest_dir: the directory where classes are output ("../../dist/classes_DBG")
# dest_dir: the directory where classes are output ("../../dist/classes")
# Returns 1 if the source file is newer than the class file, or the class file
# doesn't exist. Returns 0 if the class file is newer than the source file.
sub java_source_needs_update {
......@@ -427,7 +433,7 @@ sub javadoc {
ensure_dir_exists("$dist_dir/jssdoc");
my $targets = join(" ", @packages);
print "$targets\n";
print_do("$javadoc -breakiterator -sourcepath . -d $dist_dir/jssdoc $html_header_opt $targets");
print_do("$javadoc -breakiterator $classpath -sourcepath . -d $dist_dir/jssdoc $html_header_opt $targets");
print_do("cp $dist_dir/jssdoc/index.html $dist_dir/jssdoc/index.html.bak");
print_do("cp $dist_dir/jssdoc/overview-summary.html $dist_dir/jssdoc/index.html");
}
......@@ -437,11 +443,12 @@ sub test {
die "make test_jss is only available on upstream builds of Linux and MacOS platforms.";
} elsif( $os eq 'Linux' || $os eq 'Darwin' ) {
# Test JSS presuming that it has already been built
if(( -d $dist_dir ) &&
( -l $jss_symlink )) {
my $cmd = "cd $pwd/org/mozilla/jss/tests;"
. "perl all.pl dist $jss_symlink;"
. "cd $pwd";
( -d $jss_objdir || -l $jss_objdir )) {
my $cmd = "cd $jss_dir/org/mozilla/jss/tests;"
. "perl all.pl dist \"$dist_dir\" \"$nss_bin_dir\" \"$nss_lib_dir\" \"$jss_lib_dir\";"
. "cd $jss_dir";
print("#######################\n" .
"# BEGIN: Testing JSS #\n" .
......@@ -451,7 +458,7 @@ sub test {
"# END: Testing JSS #\n" .
"#####################\n");
} else {
die "JSS builds are not available at $jss_symlink.";
die "JSS builds are not available at $jss_objdir.";
}
} else {
die "make test_jss is only available on Linux and MacOS platforms.";
......
......@@ -21,11 +21,7 @@ endif
# set default location of the java classes repository
ifeq ($(JAVA_DESTPATH),)
ifdef BUILD_OPT
JAVA_DESTPATH = $(SOURCE_CLASSES_DIR)
else
JAVA_DESTPATH = $(SOURCE_CLASSES_DBG_DIR)
endif
endif
# set default location of the package under the java classes repository
......
......@@ -134,9 +134,8 @@ release_cpdistdir::
"SOURCE_RELEASE_PREFIX=$(SOURCE_RELEASE_XP_DIR)" \
"RELEASE_XP_DIR=$(RELEASE_XP_DIR)" \
"RELEASE_MD_DIR=$(RELEASE_MD_DIR)" \
"FILES=$(XPCLASS_JAR) $(XPCLASS_DBG_JAR) $(XPHEADER_JAR) $(MDHEADER_JAR) $(MDBINARY_JAR) XP_FILES MD_FILES" \
"FILES=$(XPCLASS_JAR) $(XPHEADER_JAR) $(MDHEADER_JAR) $(MDBINARY_JAR) XP_FILES MD_FILES" \
"$(XPCLASS_JAR)=$(SOURCE_RELEASE_CLASSES_DIR)|x"\
"$(XPCLASS_DBG_JAR)=$(SOURCE_RELEASE_CLASSES_DBG_DIR)|x"\
"$(XPHEADER_JAR)=$(SOURCE_RELEASE_XPHEADERS_DIR)|x" \
"$(MDHEADER_JAR)=$(SOURCE_RELEASE_MDHEADERS_DIR)|m" \
"$(MDBINARY_JAR)=$(SOURCE_RELEASE_MD_DIR)|m" \
......@@ -155,9 +154,8 @@ release_jars::
"OS_ARCH=$(OS_ARCH)" \
"RELEASE_VERSION=$(RELEASE_VERSION)" \
"SOURCE_RELEASE_DIR=$(SOURCE_RELEASE_DIR)" \
"FILES=$(XPCLASS_JAR) $(XPCLASS_DBG_JAR) $(XPHEADER_JAR) $(MDHEADER_JAR) $(MDBINARY_JAR)" \
"FILES=$(XPCLASS_JAR) $(XPHEADER_JAR) $(MDHEADER_JAR) $(MDBINARY_JAR)" \
"$(XPCLASS_JAR)=$(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_CLASSES_DIR)|b"\
"$(XPCLASS_DBG_JAR)=$(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_CLASSES_DBG_DIR)|b"\
"$(XPHEADER_JAR)=$(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_XPHEADERS_DIR)|a" \
"$(MDHEADER_JAR)=$(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_MDHEADERS_DIR)|a" \
"$(MDBINARY_JAR)=$(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_MD_DIR)|bi"
......@@ -181,24 +179,13 @@ ifneq ($(CLASSES),)
RELEASE_CLASSES := $(patsubst %,%,$(CLASSES))
ifdef BUILD_OPT
RELEASE_CLASS_PATH := $(patsubst %,$(SOURCE_CLASSES_DIR)/$(PACKAGE)/%, $(RELEASE_CLASSES))
RELEASE_NESTED := $(foreach file,$(RELEASE_CLASS_PATH),$(wildcard $(file)$$*))
RELEASE_FILES := $(patsubst %,%.class,$(RELEASE_CLASS_PATH)) $(RELEASE_NESTED)
else
RELEASE_DBG_CLASS_PATH:= $(patsubst %,$(SOURCE_CLASSES_DBG_DIR)/$(PACKAGE)/%, $(RELEASE_CLASSES))
RELEASE_DBG_NESTED := $(foreach file,$(RELEASE_DBG_CLASS_PATH),$(wildcard $(file)$$*))
RELEASE_DBG_FILES := $(patsubst %,%.class,$(RELEASE_DBG_CLASS_PATH)) $(RELEASE_DBG_NESTED)
endif
# Substitute \$ for $ so the shell doesn't choke
ifdef BUILD_OPT
release_classes::
$(INSTALL) -m 444 $(subst $$,\$$,$(RELEASE_FILES)) $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_CLASSES_DIR)/$(PACKAGE)
else
release_classes::
$(INSTALL) -m 444 $(subst $$,\$$,$(RELEASE_DBG_FILES)) $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_CLASSES_DBG_DIR)/$(PACKAGE)
endif
endif
......
......@@ -32,15 +32,10 @@ endif
#
SOURCE_CLASSES_DIR = $(SOURCE_XP_DIR)/classes
SOURCE_CLASSES_DBG_DIR = $(SOURCE_XP_DIR)/classes_DBG
SOURCE_XPHEADERS_DIR = $(SOURCE_XP_DIR)/public/$(MODULE)
SOURCE_XPPRIVATE_DIR = $(SOURCE_XP_DIR)/private/$(MODULE)
ifdef BUILD_OPT
IMPORT_XPCLASS_DIR = $(SOURCE_CLASSES_DIR)
else
IMPORT_XPCLASS_DIR = $(SOURCE_CLASSES_DBG_DIR)
endif
#
# <user_source_tree> machine-dependent (md) master import/export directory
......@@ -111,7 +106,6 @@ SOURCE_RELEASE_XP_DIR = $(SOURCE_RELEASE_PREFIX)
#
SOURCE_RELEASE_CLASSES_DIR = classes
SOURCE_RELEASE_CLASSES_DBG_DIR = classes_DBG
SOURCE_RELEASE_XPHEADERS_DIR = include
#
......@@ -119,16 +113,10 @@ SOURCE_RELEASE_XPHEADERS_DIR = include
#
XPCLASS_JAR = xpclass.jar
XPCLASS_DBG_JAR = xpclass_dbg.jar
XPHEADER_JAR = xpheader.jar
ifdef BUILD_OPT
SOURCE_RELEASE_XP_CLASSES_DIR = $(SOURCE_RELEASE_CLASSES_DIR)
IMPORT_XPCLASS_JAR = $(XPCLASS_JAR)
else
SOURCE_RELEASE_XP_CLASSES_DIR = $(SOURCE_RELEASE_CLASSES_DBG_DIR)
IMPORT_XPCLASS_JAR = $(XPCLASS_DBG_JAR)
endif
#
# <user_source_tree> machine-dependent (md) source-side master release directory
......
jss (4.5.0~a4-1) UNRELEASED; urgency=medium
* New upstream prerelease.
* fix-jdk9-ftbfs.diff: Updated, and disabled.
* rules:
- fix gentarball target
- fix build for new source layout
- override dh_auto_clean and dh_auto_test
* watch: Updated.
* control: Add libcommons-codec-java, libcommons-lang-java, libslf4j-
java to build-depends.
* rules: Create symlinks in dh_auto_install.
-- Timo Aaltonen <tjaalton@debian.org> Tue, 31 Jul 2018 00:03:14 +0300
jss (4.4.4-1) unstable; urgency=medium
* New upstream release.
* watch: Updated to point to github.
* control: Update homepage.
* control: Update maintainer address.
* Bump debhelper to 11.
* links, install: Updated.
* rules: Use dh.
* rules: Add gentarball target.
* README.source: Deleted, obsolete.
* Bump policy to 4.1.4, no changes.
-- Timo Aaltonen <tjaalton@debian.org> Fri, 01 Jun 2018 10:16:36 +0300
jss (4.4.3-1) unstable; urgency=medium
* New upstream release.
- jss-*.patch: Dropped, upstream
* control: Update VCS urls.
-- Timo Aaltonen <tjaalton@debian.org> Tue, 17 Apr 2018 10:42:06 +0300
jss (4.4.2-6) unstable; urgency=medium
* rules: Fix JAVA_HOME.
-- Timo Aaltonen <tjaalton@debian.org> Mon, 09 Apr 2018 15:35:35 +0300
jss (4.4.2-5) unstable; urgency=medium
* control: Build with jdk8, dogtag-pki needs it.
-- Timo Aaltonen <tjaalton@debian.org> Mon, 09 Apr 2018 14:03:10 +0300
jss (4.4.2-4) unstable; urgency=medium
* fix-jdk9-ftbfs.diff: Fix build with openjdk-9. (Closes: #893217)
-- Timo Aaltonen <tjaalton@debian.org> Wed, 04 Apr 2018 00:59:27 +0300
jss (4.4.2-3) unstable; urgency=medium
* patches: Add three new patches from upstream for Dogtag.
-- Timo Aaltonen <tjaalton@debian.org> Mon, 05 Feb 2018 12:25:43 +0200
jss (4.4.2-2) unstable; urgency=medium
* patches: Add six patches from Fedora for Dogtag.
* control: Update git urls to point to pkg-freeipa.
-- Timo Aaltonen <tjaalton@debian.org> Wed, 20 Dec 2017 16:52:36 +0200
jss (4.4.2-1) unstable; urgency=medium
* New upstream release. (Closes: #875589)
* patches: Drop all patches, everything upstream.
* files, links, rules: Packaging changes for the new version.
* control: Update the maintainer address to.
-- Timo Aaltonen <tjaalton@debian.org> Mon, 18 Sep 2017 21:44:04 +0300
jss (4.3.1-7) unstable; urgency=medium
* Sync patches with fedora 4.2.6-42.
- merge symkey
* control: Bump policy to 3.9.8, no changes.
* control: Use https for vcs urls.
-- Timo Aaltonen <tjaalton@debian.org> Tue, 30 Aug 2016 14:05:48 +0300
jss (4.3.1-6) unstable; urgency=medium
* jss-PBE-PKCS5-V2-secure-P12.patch: Bump NUM_ALGS. (Closes: #688472)
-- Timo Aaltonen <tjaalton@debian.org> Wed, 26 Nov 2014 15:48:14 +0200
jss (4.3.1-5) unstable; urgency=medium
* control: Bump policy to 3.9.6.
* Use debhelper 9.
* jss-support-TLS1_1-TLS1_2.patch: Add support for TLSv1.1 and v1.2.
* jss-RC4-strengh-verify.patch: Verify RC4 strength.
* control: Update my email.
* control: Update VCS urls.
-- Timo Aaltonen <tjaalton@debian.org> Sat, 25 Oct 2014 13:14:31 +0300
jss (4.3.1-4) unstable; urgency=low
[ Timo Aaltonen ]
* Update pull_coreconf.patch and match Linux3.0* during clean.
* rules:
- Remove dist/ on clean.
- Use openjdk-6 instead of gcj.
* patches: Add a bunch of patches from Fedora.
* control: Change the VCS header to point to the git repository.
* compat: Bump to 8.
* control: Build-depend on default-jdk.
* control: Update the maintainer address.
* control: Drop jre dependency per current java policy.
* patches: More patches from Fedora.
* rules: Install the library in /usr/lib/jss.
* control: Bump standards to 3.9.3, no changes.
* control: Update the uploaders field.
* rules: Added build-arch and build-indep targets.
* rules: Replace dh_clean -k with dh_prep.
[ Ghe Rivero ]
* Fixed JAVA_HOME default path
-- Timo Aaltonen <tjaalton@ubuntu.com> Wed, 27 Jun 2012 18:00:53 +0200
jss (4.3.1-3) unstable; urgency=low
* Update my email address
-- Michele Baldessari <michele@acksyn.org> Sun, 17 Oct 2010 23:41:15 +0200
jss (4.3.1-2) unstable; urgency=low
* Bump policy to 3.9.1
* Update to quilt 3.0 source package
-- Michele Baldessari <michele@pupazzo.org> Sat, 04 Sep 2010 20:48:04 +0200
jss (4.3.1-1) unstable; urgency=low
* New upstream
* Bump policy to 3.8.3
* Patch in coreconf build system for the time being
* Add ${misc:Depends} as we depend on debhelper
* Fix jar links to the right version
-- Michele Baldessari <michele@pupazzo.org> Sun, 24 Jan 2010 23:36:55 +0100
jss (4.2.5-2) unstable; urgency=low
* Bump to policy 3.8.0
* debian/control:
- Build-Depend on default-jdk-builddep instead of java-gcj-compat-dev
* Add VCS-* fields
* Fixed build-deps (added libnss3-dev and pkg-config)
* Changed section to "java"
-- Michele Baldessari <michele@pupazzo.org> Wed, 22 Apr 2009 21:31:06 +0200
jss (4.2.5-1) unstable; urgency=low
* Initial release (Closes: #474489)
-- Michele Baldessari <michele@pupazzo.org> Wed, 09 Apr 2008 16:09:59 +0200
Source: jss
Section: java
Maintainer: Debian FreeIPA Team <pkg-freeipa-devel@alioth-lists.debian.net>
Uploaders: Timo Aaltonen <tjaalton@debian.org>,
Priority: optional
Build-Depends: debhelper (>= 11),
openjdk-8-jdk,
libcommons-codec-java,
libcommons-lang-java,
libnss3-dev,
libslf4j-java,
pkg-config,
quilt,
Standards-Version: 4.1.4
Vcs-Git: https://salsa.debian.org/freeipa-team/jss.git
Vcs-Browser: https://salsa.debian.org/freeipa-team/jss
Homepage: https://github.com/dogtagpki/jss
Package: libjss-java
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Network Security Services for Java
Network Security Services for Java (JSS) is a Java interface
to NSS. It supports most of the security standards and
encryption technologies supported by NSS. JSS also provides
a pure Java interface for ASN.1 types and BER/DER encoding.
This diff is collapsed.
usr/share/java/jss*.jar
usr/lib/jss/libjss4.so
--- a/org/mozilla/jss/tests/SymKeyDeriving.java
+++ b/org/mozilla/jss/tests/SymKeyDeriving.java
@@ -40,7 +40,6 @@ import org.mozilla.jss.crypto.*;
import org.mozilla.jss.CryptoManager;
import org.mozilla.jss.InitializationValues;
-import sun.security.pkcs11.wrapper.PKCS11Constants;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Enumeration;
--- /dev/null
+++ b/org/mozilla/jss/tests/PKCS11Constants.java
@@ -0,0 +1,14 @@
+package org.mozilla.jss.tests;
+
+interface PKCS11Constants {
+ long CKA_ENCRYPT = 260L;
+ long CKA_DERIVE = 268L;
+ long CKM_DES_ECB = 289L;
+ long CKM_DES_CBC = 290L;
+ long CKM_DES3_ECB = 306L;
+ long CKM_DES3_CBC = 307L;
+ long CKM_CONCATENATE_BASE_AND_KEY = 864L;
+ long CKM_EXTRACT_KEY_FROM_KEY = 869L;
+ long CKM_AES_ECB = 4225L;
+ long CKM_AES_CBC = 4226L;
+}
#fix-jdk9-ftbfs.diff
#!/usr/bin/make -f
include /usr/share/quilt/quilt.make
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
UPSTREAM_VERSION := $(shell dpkg-parsechangelog | sed -n 's/^Version: *\(.*\)-.*$$/\1/ p' | sed -e 's/~.*//')
MOD_MAJOR_VERSION := $(word 1, $(subst ., ,$(UPSTREAM_VERSION)))
MOD_MINOR_VERSION := $(word 2, $(subst ., ,$(UPSTREAM_VERSION)))
MOD_PATCH_VERSION := $(word 3, $(subst ., ,$(UPSTREAM_VERSION)))
export USE_64 := $(shell echo "int main(void) { int assert[(sizeof(long) == 8) ? 1 : -1]; return 0; }" | gcc -o /dev/null -x c - 2> /dev/null && echo "USE_64=1")
CFLAGS := -Wall -pipe -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2 -fno-strict-aliasing
endif
CFLAGS += $(USE_64)
# Enable compiler optimizations and disable debugging code
BUILD_OPT=1
export BUILD_OPT
export XCFLAGS="-g"
BASEDIR := $(CURDIR)
export DEBIAN_BUILD=1
export SOURCE_PREFIX=$(BASEDIR)/dist
export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
export NSPR_INCLUDE_DIR=`/usr/bin/pkg-config --cflags-only-I nspr | sed 's/-I//'`
export NSPR_LIB_DIR=`/usr/bin/pkg-config --libs-only-L nspr | sed 's/-L//'`
export NSS_INCLUDE_DIR=`/usr/bin/pkg-config --cflags-only-I nss | sed 's/-I//'`
export NSS_LIB_DIR=`/usr/bin/pkg-config --libs-only-L nss | sed 's/-L//'`
export USE_INSTALLED_NSPR=1
export USE_INSTALLED_NSS=1
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-$(DEB_BUILD_ARCH)
# Generate symbolic info for debuggers
XCFLAGS="-g"
export XCFLAGS
export CFLAGS
override_dh_auto_build:
make -C coreconf $(USE_64)
make $(USE_64)
override_dh_auto_clean:
override_dh_clean:
-[ -f $(BASEDIR)/Makefile ] || $(MAKE) -C $(BASEDIR) clean
-[ -f $(BASEDIR)/coreconf/Makefile ] || $(MAKE) -C $(BASEDIR)/coreconf clean
-find . -name "*.class" -type f -exec rm -f "{}" \;
-find . -name "*.so.*" -type f -exec rm -f "{}" \;
-find . -name ".so" -type f -exec rm -f "{}" \;
-find . -type d -name "Linux*_glibc_PTH_*DBG.OBJ" -exec rm -rf "{}" \;
-find . -type d -name "Linux*_glibc_PTH_*OPT.OBJ" -exec rm -rf "{}" \;
rm -f $(BASEDIR)/org/mozilla/jss/util/Debug.java
rm -rf $(CURDIR)/dist || true
dh_clean
override_dh_auto_install:
mkdir -p $(CURDIR)/debian/tmp/usr/lib/jss
mkdir -p $(CURDIR)/debian/tmp/usr/share/java
install -m 644 dist/xpclass.jar $(CURDIR)/debian/tmp/usr/share/java/jss-$(MOD_MAJOR_VERSION).$(MOD_MINOR_VERSION).$(MOD_PATCH_VERSION).jar
install -m 0755 dist/Linux*.OBJ/lib/libjss4.so $(CURDIR)/debian/tmp/usr/lib/jss
# Required by ldapjdk
ln -s jss-$(MOD_MAJOR_VERSION).$(MOD_MINOR_VERSION).$(MOD_PATCH_VERSION).jar \
$(CURDIR)/debian/tmp/usr/share/java/jss.jar
# Required by idm-console-framework
ln -s jss-$(MOD_MAJOR_VERSION).$(MOD_MINOR_VERSION).$(MOD_PATCH_VERSION).jar \
$(CURDIR)/debian/tmp/usr/share/java/jss4.jar
override_dh_auto_test:
# For maintainer use only, generate a tarball:
gentarball: UV=$(shell dpkg-parsechangelog|awk '/^Version:/ {print $$2}'|sed 's/-.*$$//')
gentarball:
git archive --format=tar upstream --prefix=jss-$(UV)/ | \
xz --best \
> ../jss_$(UV).orig.tar.xz
%:
dh $@ --with quilt
version=3
options=uversionmangle=s/-/~/ \
https://github.com/dogtagpki/jss/tags/ (?:.*?/)?v@ANY_VERSION@\.tar\.gz
......@@ -6,28 +6,48 @@ Summary: Java Security Services (JSS)
URL: http://www.dogtagpki.org/wiki/JSS
License: MPLv1.1 or GPLv2+ or LGPLv2+
Version: 4.4.4
Release: 1%{?_timestamp}%{?_commit_id}%{?dist}
Version: 4.5.0
Release: 0.4%{?_timestamp}%{?_commit_id}%{?dist}
%global _phase -a4
# To generate the source tarball:
#
# git clone https://github.com/dogtagpki/jss.git
# cd jss
# git archive --format=tar.gz --prefix jss-VERSION/jss/ -o jss-VERSION.tar.gz -v HEAD
#
Source: https://github.com/dogtagpki/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
# $ git clone https://github.com/dogtagpki/jss.git
# $ cd jss
# $ git archive \
# --format=tar.gz \
# --prefix jss-VERSION/ \
# -o jss-VERSION.tar.gz \
# <version tag>
Source: https://github.com/dogtagpki/%{name}/archive/v%{version}%{?_phase}/%{name}-%{version}%{?_phase}.tar.gz
# To create a patch for all changes since a version tag:
# $ git format-patch \
# --stdout \
# <version tag> \
# > jss-VERSION-RELEASE.patch
# Patch: jss-VERSION-RELEASE.patch
Conflicts: idm-console-framework < 1.1.17-4
Conflicts: pki-base < 10.4.0
Conflicts: tomcatjss < 7.2.1
################################################################################
# Build Dependencies
################################################################################
# autosetup
BuildRequires: git
BuildRequires: gcc-c++
BuildRequires: nss-devel >= 3.28.4-6
BuildRequires: nspr-devel >= 4.13.1
BuildRequires: java-devel
BuildRequires: jpackage-utils
BuildRequires: slf4j
%if 0%{?rhel} && 0%{?rhel} <= 7
# no slf4j-jdk14
%else
BuildRequires: slf4j-jdk14
%endif
BuildRequires: apache-commons-lang
BuildRequires: apache-commons-codec
%if 0%{?fedora} >= 25 || 0%{?rhel} > 7
BuildRequires: perl-interpreter
%endif
......@@ -35,6 +55,18 @@ BuildRequires: perl-interpreter
Requires: nss >= 3.28.4-6
Requires: java-headless
Requires: jpackage-utils
Requires: slf4j
%if 0%{?rhel} && 0%{?rhel} <= 7
# no slf4j-jdk14
%else
Requires: slf4j-jdk14
%endif
Requires: apache-commons-lang
Requires: apache-commons-codec
Conflicts: idm-console-framework < 1.1.17-4
Conflicts: pki-base < 10.6.3
Conflicts: tomcatjss < 7.3.2
%description
Java Security Services (JSS) is a java native interface which provides a bridge
......@@ -55,7 +87,7 @@ This package contains the API documentation for JSS.
################################################################################
%prep
%autosetup -n %{name}-%{version} -p 1 -S git
%autosetup -n %{name}-%{version}%{?_phase} -p 1 -S git
################################################################################
%build
......@@ -66,10 +98,7 @@ This package contains the API documentation for JSS.
[ -z "$USE_INSTALLED_NSPR" ] && export USE_INSTALLED_NSPR=1
[ -z "$USE_INSTALLED_NSS" ] && export USE_INSTALLED_NSS=1
# Enable compiler optimizations and disable debugging code
# NOTE: If you ever need to create a debug build with optimizations disabled
# just comment out this line and change in the %%install section below the
# line that copies jars xpclass.jar to be xpclass_dbg.jar
# Enable compiler optimizations
export BUILD_OPT=1
# Generate symbolic info for debuggers
......@@ -99,59 +128,51 @@ export USE_64
%endif
# The Makefile is not thread-safe
make -C jss/coreconf
make -C jss
make -C jss javadoc
make -C coreconf
make
make javadoc
################################################################################
%install
# Copy the license files here so we can include them in %%doc
cp -p jss/MPL-1.1.txt .
cp -p jss/gpl.txt .
cp -p jss/lgpl.txt .
# There is no install target so we'll do it by hand
# jars
install -d -m 0755 $RPM_BUILD_ROOT%{_jnidir}
# NOTE: if doing a debug no opt build change xpclass.jar to xpclass_dbg.jar
install -m 644 dist/xpclass.jar ${RPM_BUILD_ROOT}%{_jnidir}/jss4.jar
install -m 644 ../dist/xpclass.jar ${RPM_BUILD_ROOT}%{_jnidir}/jss4.jar
# We have to use the name libjss4.so because this is dynamically
# loaded by the jar file.
install -d -m 0755 $RPM_BUILD_ROOT%{_libdir}/jss
install -m 0755 dist/Linux*.OBJ/lib/libjss4.so ${RPM_BUILD_ROOT}%{_libdir}/jss/
install -m 0755 ../dist/Linux*.OBJ/lib/libjss4.so ${RPM_BUILD_ROOT}%{_libdir}/jss/
pushd ${RPM_BUILD_ROOT}%{_libdir}/jss
ln -fs %{_jnidir}/jss4.jar jss4.jar
popd
# javadoc
install -d -m 0755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -rp dist/jssdoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -p jss/jss.html $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -p jss/*.txt $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -rp ../dist/jssdoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -p jss.html $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -p *.txt $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
# No ldconfig is required since this library is loaded by Java itself.
################################################################################
%files
%defattr(-,root,root,-)
%doc jss/jss.html jss/MPL-1.1.txt jss/gpl.txt jss/lgpl.txt
%{_libdir}/jss/*
%doc jss.html MPL-1.1.txt gpl.txt lgpl.txt
%{_libdir}/*
%{_jnidir}/*
%{_libdir}/jss/lib*.so
################################################################################
%files javadoc
%defattr(-,root,root,-)
%dir %{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}-%{version}/*
%{_javadocdir}/%{name}-%{version}/
################################################################################
%changelog
* Tue May 29 2018 Dogtag PKI Team <pki-devel@redhat.com> 4.4.0-0
* Tue May 29 2018 Dogtag PKI Team <pki-devel@redhat.com> 4.5.0-0
- To list changes in <branch> since <tag>:
$ git log --pretty=oneline --abbrev-commit --no-decorate <tag>..<branch>