From 8da1c2f60394a110346b57659a39928eb2fd8f6f Mon Sep 17 00:00:00 2001 From: Elio Maldonado Date: Wed, 19 May 2021 09:29:23 -0700 Subject: [PATCH] Cleanup of the samples directory - needed since CapabiltiesList was moved to become a test --- samples/CapabilitiesList/Makefile | 40 ----------- samples/CapabilitiesList/README.md | 50 ------------- .../CapabilitiesList/adjustments4openSUSE.txt | 13 ---- samples/CapabilitiesList/build.sh | 65 ----------------- samples/CapabilitiesList/help.txt | 14 ---- samples/CapabilitiesList/systemjssBuild.sh | 65 ----------------- samples/CapabilitiesList/systemjssMakefile | 65 ----------------- samples/CapabilitiesList/useownnssdbBuild.sh | 71 ------------------- samples/CapabilitiesList/useownnssdbMakefile | 44 ------------ samples/README.txt | 1 - 10 files changed, 428 deletions(-) delete mode 100644 samples/CapabilitiesList/Makefile delete mode 100644 samples/CapabilitiesList/README.md delete mode 100644 samples/CapabilitiesList/adjustments4openSUSE.txt delete mode 100755 samples/CapabilitiesList/build.sh delete mode 100644 samples/CapabilitiesList/help.txt delete mode 100755 samples/CapabilitiesList/systemjssBuild.sh delete mode 100644 samples/CapabilitiesList/systemjssMakefile delete mode 100755 samples/CapabilitiesList/useownnssdbBuild.sh delete mode 100644 samples/CapabilitiesList/useownnssdbMakefile diff --git a/samples/CapabilitiesList/Makefile b/samples/CapabilitiesList/Makefile deleted file mode 100644 index 62ccfee30..000000000 --- a/samples/CapabilitiesList/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -# Invoked by build.sh script where the user can set -# the BUILDROOT and SLF4JPATH for the makefile and the target - -export LD_LIBRARY_PATH=${BUILDROOT}/jss/build:/usr/share/java -export CLASSPATH=.:${BUILDROOT}/jss/build/jss4.jar:${SLF4JPATH} - - -JFLAGS = -g -classpath ${CLASSPATH} -sourcepath . -d . -JC = javac -JVM= java -FILE= - -.SUFFIXES: .java .class - -.java.class: - $(JC) $(JFLAGS) $*.java - - -CLASSES = \ - CapabilitiesList.java - -MAIN = CapabilitiesList - - -default: classes - -classes: $(CLASSES:.java=.class) - -# -# List capabilities of all providers -# -run: $(MAIN).class - $(JVM) -classpath ${CLASSPATH} $(MAIN) - -clean: - $(RM) *.class - -remove-listings: - $(RM) -r listings - diff --git a/samples/CapabilitiesList/README.md b/samples/CapabilitiesList/README.md deleted file mode 100644 index 007f8b409..000000000 --- a/samples/CapabilitiesList/README.md +++ /dev/null @@ -1,50 +0,0 @@ -CapabilitiesList -======================================== - -Overview -======================================== - -**CapabilitiesList** has a Java application to list the capabilities -of the "Mozilla-JSS" provider and other installed providers - -Dependencies -======================================== - -This project has the following dependencies: - - - [JSS](https://github.com/dogtagpki/jss) - - [OpenJDK](https://openjdk.java.net/) - -To install these dependencies on Fedora, execute the following: - - sudo dnf install apache-commons-codec apache-commons-lang gcc-c++ \ - java-devel jpackage-utils slf4j zlib-devel \ - glassfish-jaxb-api nss-tools nss-devel cmake \ - junit - -Building -======================================== -To build CapabilitiesList: - - Once jss has been cloned - cd jss/samples/capabilitiesList - Launch build.sh [with-some-options] - where ./build.sh -h will enumerate the options - -LIMITATIONS: -======================================== -Using cmake: -Currently doesn't work. - -Using make: -This currently works on Fedora 30 and Debian 10 and also on -openSUSE Tumbleweed where some manual adjustments are needed -when building against system-installed JSS. For the needed changes -see the adjustements4openSUSE.txt file in this directory. - -TODO: -################################################# -- Explore using cmake, as JSS does, as it should allow us to detect environment - variables and thus make it easier to enable supporting other distros - but for now ./build.sh and systemBuild.sh work okay -- Add support for other Linux distributions as they are requested diff --git a/samples/CapabilitiesList/adjustments4openSUSE.txt b/samples/CapabilitiesList/adjustments4openSUSE.txt deleted file mode 100644 index 7d57a7c0d..000000000 --- a/samples/CapabilitiesList/adjustments4openSUSE.txt +++ /dev/null @@ -1,13 +0,0 @@ -Builds against the system jss need manual adjustments -As stated in systemjssMakefile change - - export LD_LIBRARY_PATH=${librarypath4fedora} - export CLASSPATH=${classpath4fedora} - - to - - export LD_LIBRARY_PATH=${librarypath4opensuse} - export CLASSPATH=${classpath4opensuse} - - These are meant to be strictly local changes. - diff --git a/samples/CapabilitiesList/build.sh b/samples/CapabilitiesList/build.sh deleted file mode 100755 index 7ca399555..000000000 --- a/samples/CapabilitiesList/build.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env bash - -cwd=$(cd $(dirname $0); pwd -P) - -# Usage info -show_help() -{ - cat "$cwd/help.txt" - exit -} - -buildroot=${HOME}/buildjss -target4make=run - -# -# Parse command line arguments. -# - -while [[ "$1" =~ ^- && ! "$1" == "--" ]]; do case $1 in - -h | --help ) - shift; show_help; - ;; - -s | --slf4jpath ) - shift; slf4jpath=$1 - ;; - -t | --target4make) - shift; target4make=$1 - ;; - -b | --buildroot ) - buildroot=$1 - ;; -esac; shift; done -if [[ "$1" == '--' ]]; then shift; fi - -if [[ ! -f /etc/os-release ]] ; then - echo 'File "/etc/os-release" is not there, aborting.' - exit -fi - -isFedora=`grep fedora /etc/os-release` -isDebian=`grep debian /etc/os-release` -isOpenSUSE=`grep opensuse /etc/os-release` - - -if [[ "${isOpenSUSE}" != '' ]]; then - echo "openSUSE build" - slf4jpath=/usr/share/java/slf4j/api.jar:/usr/share/java/slf4j/slf4j-jdk14.jar -elif [[ "${isDebian}" != '' ]]; then - echo "Debian build" - slf4jpath=/usr/share/java/slf4j-api.jar:/usr/share/java/jdk14.jar -elif [[ "${isFedora}" != '' ]]; then - echo "Fedora build" - slf4jpath=/usr/share/java/slf4j/api.jar:/usr/share/java/slf4j/jdk14.jar -else - echo "Unsupported distribution" - exit -fi - -# Now make - -BUILDROOT=${buildroot} \ -SLF4JPATH=${slf4jpath} \ -TARGET4MAKE=${target4make} \ -make -f Makefile ${target4make} - diff --git a/samples/CapabilitiesList/help.txt b/samples/CapabilitiesList/help.txt deleted file mode 100644 index 50144c1c3..000000000 --- a/samples/CapabilitiesList/help.txt +++ /dev/null @@ -1,14 +0,0 @@ -Usage: build.sh [-h] [-b] [-s] [-t] - -This script builds capabilites apps with make. - -Capabilities build tool options: - - -h display this help and exit - -b path to where jss was built - -s path to slf4j jar file, either system's or latest built - -t target for makefile [ empty for build | run ] - - -Since './build.sh -t clean' is not working, use the Makefile directly to -remove classes and/or the listings directory. diff --git a/samples/CapabilitiesList/systemjssBuild.sh b/samples/CapabilitiesList/systemjssBuild.sh deleted file mode 100755 index 6bc7fecc0..000000000 --- a/samples/CapabilitiesList/systemjssBuild.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env bash - -cwd=$(cd $(dirname $0); pwd -P) - -# Usage info -show_help() -{ - cat "$cwd/help.txt" - exit -} - -buildroot=${HOME}/buildjss -target4make=run - -# -# Parse command line arguments. -# - -while [[ "$1" =~ ^- && ! "$1" == "--" ]]; do case $1 in - -h | --help ) - shift; show_help; - ;; - -s | --slf4jpath ) - shift; slf4jpath=$1 - ;; - -t | --target4make) - shift; target4make=$1 - ;; - -b | --buildroot ) - buildroot=$1 - ;; -esac; shift; done -if [[ "$1" == '--' ]]; then shift; fi - -if [[ ! -f /etc/os-release ]] ; then - echo 'File "/etc/os-release" is not there, aborting.' - exit -fi - -isFedora=`grep fedora /etc/os-release` -isDebian=`grep debian /etc/os-release` -isOpenSUSE=`grep opensuse /etc/os-release` - - -if [[ "${isOpenSUSE}" != '' ]]; then - echo "openSUSE build" - slf4jpath=/usr/share/java/slf4j/api.jar:/usr/share/java/slf4j/slf4j-jdk14.jar -elif [[ "${isDebian}" != '' ]]; then - echo "Debian build" - slf4jpath=/usr/share/java/slf4j-api.jar:/usr/share/java/jdk14.jar -elif [[ "${isFedora}" != '' ]]; then - echo "Fedora build" - slf4jpath=/usr/share/java/slf4j/api.jar:/usr/share/java/slf4j/jdk14.jar -else - echo "Unsupported distribution" - exit -fi - -# Now make - -BUILDROOT=${buildroot} \ -SLF4JPATH=${slf4jpath} \ -TARGET4MAKE=${target4make} \ -make -f systemjssMakefile ${target4make} - diff --git a/samples/CapabilitiesList/systemjssMakefile b/samples/CapabilitiesList/systemjssMakefile deleted file mode 100644 index a2f1ea24a..000000000 --- a/samples/CapabilitiesList/systemjssMakefile +++ /dev/null @@ -1,65 +0,0 @@ -# Makefile that uses the system installed jss -# Invoked by systemjssBuild.sh script where the user can set -# the BUILDROOT and SLF4JPATH for the makefile and the target - -# The following will change as the various distros get upgraded - -# settings to use system jss in fedora 30 -librarypath4fedora=/usr/lib64:/usr/lib64/jss:/usr/share/java -classpath4fedora=.:/usr/lib/java/jss4.jar:/usr/share/java/slf4j/api.jar - -# settings to use system jss in debian 9 -librarypath4debian9=/usr/lib64:/usr/lib64/jss:/usr/share/java -classpath4debian9=.:/usr/share/java/jss-4.3.1.jar:/usr/share/java/slf4j/api.jar - -# settings to use system jss in debian 10 -librarypath4debian10=/usr/lib64:/usr/lib64/jss:/usr/share/java -classpath4debian10=.:/usr/share/java/jss-4.5.1.jar:/usr/share/java/slf4j-api.jar - -# settings to use system jss in ubuntu 19 -librarypath4ubuntu=/usr/lib64:/usr/lib64/jss:/usr/share/java -classpath4ubuntu=.:/usr/share/java/jss-4.5.1.jar:/usr/share/java/slf4j/api.jar - -# settings to use system jss in openSUSE -librarypath4opensuse=/usr/lib64:/usr/share/java -classpath4opensuse=.:/usr/lib64/java/jss4-4.5.0.jar:/usr/share/java/slf4j/api.jar - -# -# change these two to the ones you wish to use -# -export LD_LIBRARY_PATH=${librarypath4fedora} -export CLASSPATH=${classpath4fedora} - -JFLAGS = -g -classpath ${CLASSPATH} -sourcepath . -d . -JC = javac -JVM= java -FILE= - -.SUFFIXES: .java .class - -.java.class: - $(JC) $(JFLAGS) $*.java - - -CLASSES = \ - CapabilitiesList.java - -MAIN = CapabilitiesList - - -default: classes - -classes: $(CLASSES:.java=.class) - -# -# List capabilities of all providers -# -run: $(MAIN).class - $(JVM) -classpath ${CLASSPATH} $(MAIN) - -clean: - $(RM) *.class - -remove-listings: - $(RM) -r listings - diff --git a/samples/CapabilitiesList/useownnssdbBuild.sh b/samples/CapabilitiesList/useownnssdbBuild.sh deleted file mode 100755 index fe12b0ee0..000000000 --- a/samples/CapabilitiesList/useownnssdbBuild.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env bash - -# Modified build.sh to use own nssdb from latest build - -cwd=$(cd $(dirname $0); pwd -P) - -# Usage info -show_help() -{ - cat "$cwd/help.txt" - exit -} - -buildroot=${HOME}/buildjss -target4make=run - -# -# Parse command line arguments. -# - -while [[ "$1" =~ ^- && ! "$1" == "--" ]]; do case $1 in - -h | --help ) - shift; show_help; - ;; - -s | --slf4jpath ) - shift; slf4jpath=$1 - ;; - -t | --target4make) - shift; target4make=$1 - ;; - -b | --buildroot ) - buildroot=$1 - ;; -esac; shift; done -if [[ "$1" == '--' ]]; then shift; fi - -if [[ ! -f /etc/os-release ]] ; then - echo 'File "/etc/os-release" is not there, aborting.' - exit -fi - -isFedora=`grep fedora /etc/os-release` -isDebian=`grep debian /etc/os-release` -isOpenSUSE=`grep opensuse /etc/os-release` - - -if [[ "${isOpenSUSE}" != '' ]]; then - echo "openSUSE build" - slf4jpath=/usr/share/java/slf4j/api.jar:/usr/share/java/slf4j/slf4j-jdk14.jar -elif [[ "${isDebian}" != '' ]]; then - echo "Debian build" - slf4jpath=/usr/share/java/slf4j-api.jar:/usr/share/java/jdk14.jar -elif [[ "${isFedora}" != '' ]]; then - echo "Fedora build" - slf4jpath=/usr/share/java/slf4j/api.jar:/usr/share/java/slf4j/jdk14.jar -else - echo "Unsupported distribution" - exit -fi - -# Now make - -removeNssdb= -if [[ "$target4make" == "run" ]]; then - removeNssdb=remove-nssdb -fi -BUILDROOT=${buildroot} \ -SLF4JPATH=${slf4jpath} \ -TARGET4MAKE=${target4make} \ -make -f useownnssdbMakefile ${removeNssdb} ${target4make} - diff --git a/samples/CapabilitiesList/useownnssdbMakefile b/samples/CapabilitiesList/useownnssdbMakefile deleted file mode 100644 index 3c399f230..000000000 --- a/samples/CapabilitiesList/useownnssdbMakefile +++ /dev/null @@ -1,44 +0,0 @@ -# Invoked by useownnssdbBuild.sh script where the user can set -# the BUILDROOT and SLF4JPATH for the makefile and the target -# Supports using the nssdb from the latest build - -export LD_LIBRARY_PATH=${BUILDROOT}/jss/build:/usr/share/java -export CLASSPATH=.:${BUILDROOT}/jss/build/jss4.jar:${SLF4JPATH} - - -JFLAGS = -g -classpath ${CLASSPATH} -sourcepath . -d . -JC = javac -JVM= java -FILE= - -.SUFFIXES: .java .class - -.java.class: - $(JC) $(JFLAGS) $*.java - - -CLASSES = \ - CapabilitiesList.java - -MAIN = CapabilitiesList - - -default: classes - -classes: $(CLASSES:.java=.class) - -# -# List capabilities of all providers -# -run: $(MAIN).class - $(JVM) -classpath ${CLASSPATH} $(MAIN) - -clean: - $(RM) *.class - -remove-nssdb: - $(RM) -r ${BUILDROOT}/jss/build/results/nssdb - -remove-listings: - $(RM) -r listings - diff --git a/samples/README.txt b/samples/README.txt index 5599e727e..8a6982cd5 100644 --- a/samples/README.txt +++ b/samples/README.txt @@ -1,2 +1 @@ Better sample code is available in the org/mozilla/jss/tests directory. -The CapabilitiesList will likely move there once it can be built with cmake.