From 8f6de6fd339c156ce3aad13ad5d45b635d194f79 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Mon, 25 Nov 2013 12:43:03 -0500 Subject: Added option to build without server packages. The build scripts have been modified to accept an optional parameter to build pki-core without the server packages. --- CMakeLists.txt | 4 ++-- base/CMakeLists.txt | 29 +++++++++++++++-------------- scripts/compose_functions | 28 +++++++++++++++++----------- scripts/compose_pki_core_packages | 6 +++++- specs/pki-console.spec | 6 +++++- specs/pki-core.spec | 31 +++++++++++++++++++++++++++++-- specs/pki-tps.spec | 6 +++++- 7 files changed, 78 insertions(+), 32 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e679d06e..2748a51d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,8 +14,8 @@ string(REGEX REPLACE "^([0-9]+).*" "\\1" APPLICATION_VERSION_MAJOR ${VERSION}) string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" APPLICATION_VERSION_MINOR ${VERSION}) string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" APPLICATION_VERSION_PATCH ${VERSION}) -option(WITH_JAVADOC "Build with Javadoc" ON) -option(BUILD_PKI_SELINUX "Build pki-selinux" OFF) +option(WITH_JAVADOC "Build Javadoc" ON) +option(WITH_SERVER "Build Server" ON) if (BUILD_IPA_PKI_THEME) set(APPLICATION_FLAVOR_IPA_PKI_THEME TRUE) diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt index 0dc513666..3410ed876 100644 --- a/base/CMakeLists.txt +++ b/base/CMakeLists.txt @@ -3,26 +3,27 @@ project(base) # The order is important! if (APPLICATION_FLAVOR_PKI_CORE) add_subdirectory(test) - add_subdirectory(setup) add_subdirectory(symkey) add_subdirectory(util) add_subdirectory(common) add_subdirectory(native-tools) add_subdirectory(java-tools) - add_subdirectory(server) - if(BUILD_PKI_SELINUX) - add_subdirectory(selinux) - endif(BUILD_PKI_SELINUX) - add_subdirectory(ca) - add_subdirectory(kra) - add_subdirectory(ocsp) - add_subdirectory(tks) - add_subdirectory(tps) - add_subdirectory(silent) - if(WITH_JAVADOC) - add_subdirectory(javadoc) - endif(WITH_JAVADOC) + if(WITH_SERVER) + add_subdirectory(server) + add_subdirectory(ca) + add_subdirectory(kra) + add_subdirectory(ocsp) + add_subdirectory(tks) + add_subdirectory(tps) + add_subdirectory(setup) + add_subdirectory(silent) + + if(WITH_JAVADOC) + add_subdirectory(javadoc) + endif(WITH_JAVADOC) + + endif(WITH_SERVER) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/VERSION diff --git a/scripts/compose_functions b/scripts/compose_functions index d5996ae1b..6996c7412 100644 --- a/scripts/compose_functions +++ b/scripts/compose_functions @@ -109,9 +109,10 @@ Usage() printf " ${MESSAGE}\n\n" printf "Options:\n" printf " --without-javadoc do not build Javadoc RPMS\n\n" - printf " --createrepo= create a \n" - printf " repository with the rpms built." - printf " Provide the configuration file with the details. \n\n" + printf " --without-server do not build server RPMS\n\n" + printf " --createrepo= create a \n" + printf " repository with the rpms built." + printf " Provide the configuration file with the details. \n\n" } @@ -307,7 +308,7 @@ Create_repo_after_build() ## Check for command line argument validity ## -GETOPT=`getopt -o '' -l without-javadoc,work-dir:,createrepo: -n "$0" -- "$@"` +GETOPT=`getopt -o '' -l without-javadoc,without-server,work-dir:,createrepo: -n "$0" -- "$@"` if [ $? != 0 ] ; then Usage @@ -318,7 +319,8 @@ eval set -- "$GETOPT" while true ; do case "$1" in - --without-javadoc) JAVADOC="--without javadoc" ; shift ;; + --without-javadoc) WITHOUT_JAVADOCS="--without javadoc" ; shift ;; + --without-server) WITHOUT_SERVER="--without server" ; shift ;; --work-dir) WORK_DIR="$2" ; shift 2 ;; --createrepo) CREATEREPO="Y" ; REPO_CFG_FILE="$2" ; shift 2 ;; --) shift ; break ;; @@ -331,32 +333,36 @@ if [ $# -ne 1 ] ; then exit 255 fi +OPTIONS="--define \"_topdir \`pwd\`\" $WITHOUT_JAVADOCS $WITHOUT_SERVER" + if [ $1 = "srpm" ] ; then - RPMBUILD_CMD="rpmbuild --define \"_topdir \`pwd\`\" $JAVADOC -bs" + OPTIONS="$OPTIONS -bs" FETCH_SOURCE_TARBALL=0 FETCH_PATCH_FILES=0 elif [ $1 = "hybrid_srpm" ] ; then - RPMBUILD_CMD="rpmbuild --define \"_topdir \`pwd\`\" $JAVADOC -bs" + OPTIONS="$OPTIONS -bs" FETCH_SOURCE_TARBALL=0 FETCH_PATCH_FILES=1 elif [ $1 = "patched_srpm" ] ; then - RPMBUILD_CMD="rpmbuild --define \"_topdir \`pwd\`\" $JAVADOC -bs" + OPTIONS="$OPTIONS -bs" FETCH_SOURCE_TARBALL=1 FETCH_PATCH_FILES=1 elif [ $1 = "rpms" ] ; then - RPMBUILD_CMD="rpmbuild --define \"_topdir \`pwd\`\" $JAVADOC -ba" + OPTIONS="$OPTIONS -ba" FETCH_SOURCE_TARBALL=0 FETCH_PATCH_FILES=0 elif [ $1 = "hybrid_rpms" ] ; then - RPMBUILD_CMD="rpmbuild --define \"_topdir \`pwd\`\" $JAVADOC -ba" + OPTIONS="$OPTIONS -ba" FETCH_SOURCE_TARBALL=0 FETCH_PATCH_FILES=1 elif [ $1 = "patched_rpms" ] ; then - RPMBUILD_CMD="rpmbuild --define \"_topdir \`pwd\`\" $JAVADOC -ba" + OPTIONS="$OPTIONS -ba" FETCH_SOURCE_TARBALL=1 FETCH_PATCH_FILES=1 else Usage exit 255 fi + +RPMBUILD_CMD="rpmbuild $OPTIONS" export RPMBUILD_CMD diff --git a/scripts/compose_pki_core_packages b/scripts/compose_pki_core_packages index 23d58e0d0..67d85a599 100755 --- a/scripts/compose_pki_core_packages +++ b/scripts/compose_pki_core_packages @@ -38,12 +38,16 @@ PKI_CORE_VERSION="10.2.0" ## PKI_SPECS_FILE="${PKI_DIR}/specs/${PKI_CORE}.spec" -PKI_COMPONENT_LIST="test setup symkey util common native-tools java-tools server selinux ca kra ocsp tks tps-tomcat silent" +PKI_COMPONENT_LIST="test symkey util common native-tools java-tools" if [ "$WITHOUT_JAVADOC" = "" ]; then PKI_COMPONENT_LIST="$PKI_COMPONENT_LIST javadoc" fi +if [ "$WITHOUT_SERVER" = "" ]; then + PKI_COMPONENT_LIST="$PKI_COMPONENT_LIST server ca kra ocsp tks tps-tomcat setup silent" +fi + ## ## Establish the TARGET files/directories of the 'pki-core' source/spec files ## diff --git a/specs/pki-console.spec b/specs/pki-console.spec index 38394098f..c7827b8cf 100644 --- a/specs/pki-console.spec +++ b/specs/pki-console.spec @@ -6,6 +6,8 @@ URL: http://pki.fedoraproject.org/ License: GPLv2 Group: System Environment/Base +%bcond_without javadoc + BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -61,7 +63,9 @@ cd build -DVAR_INSTALL_DIR:PATH=/var \ -DBUILD_PKI_CONSOLE:BOOL=ON \ -DJAVA_LIB_INSTALL_DIR=%{_jnidir} \ - %{?_without_javadoc:-DWITH_JAVADOC:BOOL=OFF} \ +%if ! %{with javadoc} + -DWITH_JAVADOC:BOOL=OFF \ +%endif .. %{__make} VERBOSE=1 %{?_smp_mflags} diff --git a/specs/pki-core.spec b/specs/pki-core.spec index 9b4171547..13acc5478 100644 --- a/specs/pki-core.spec +++ b/specs/pki-core.spec @@ -11,6 +11,9 @@ URL: http://pki.fedoraproject.org/ License: GPLv2 Group: System Environment/Daemons +%bcond_without server +%bcond_without javadoc + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: cmake >= 2.8.9-1 @@ -239,6 +242,8 @@ This package is a part of the PKI Core used by the Certificate System. %{overview} +%if %{with server} + %package -n pki-server Summary: Certificate System - PKI Server Framework Group: System Environment/Base @@ -479,6 +484,8 @@ This package is a part of the PKI Core used by the Certificate System. %{overview} +%endif # %{with server} + %prep %setup -q -n %{name}-%{version}%{?prerel} @@ -498,7 +505,12 @@ cd build %else -DRESTEASY_LIB=/usr/share/java/resteasy \ %endif - %{?_without_javadoc:-DWITH_JAVADOC:BOOL=OFF} \ +%if ! %{with server} + -DWITH_SERVER:BOOL=OFF \ +%endif +%if ! %{with javadoc} + -DWITH_JAVADOC:BOOL=OFF \ +%endif .. %{__make} VERBOSE=1 %{?_smp_mflags} all # %{__make} VERBOSE=1 %{?_smp_mflags} test @@ -509,6 +521,8 @@ cd build cd build %{__make} install DESTDIR=%{buildroot} INSTALL="install -p" +%if %{with server} + # Scanning the python code with pylint. A return value of 0 represents there are no # errors or warnings reported by pylint. sh ../pylint-build-scan.sh %{buildroot} `pwd` @@ -537,6 +551,9 @@ if [ -d /etc/sysconfig/pki/%i ]; then \ done \ fi \ ) + +%endif # %{with server} + %{__mkdir_p} %{buildroot}%{_localstatedir}/log/pki %{__mkdir_p} %{buildroot}%{_sharedstatedir}/pki @@ -590,6 +607,8 @@ then rm -f %{_sysconfdir}/pki/pki.version fi +%if %{with server} + %post -n pki-ca # Attempt to update ALL old "CA" instances to "systemd" if [ -d /etc/sysconfig/pki/ca ]; then @@ -791,6 +810,9 @@ fi ## from EITHER 'sysVinit' OR previous 'systemd' processes to the new ## PKI deployment process +%endif # %{with server} + + %files -n pki-symkey %defattr(-,root,root,-) %doc base/symkey/LICENSE @@ -854,6 +876,8 @@ fi %{_mandir}/man1/pki.1.gz +%if %{with server} + %files -n pki-server %defattr(-,root,root,-) %doc base/common/THIRD_PARTY_LICENSES @@ -895,6 +919,7 @@ fi %{_datadir}/pki/setup/ %{_datadir}/pki/server/ + %files -n pki-ca %defattr(-,root,root,-) %doc base/ca/LICENSE @@ -958,16 +983,18 @@ fi %{_datadir}/pki/tps/setup/ %{_datadir}/pki/tps/webapps/ -%if %{?_without_javadoc:0}%{!?_without_javadoc:1} +%if %{with javadoc} %files -n pki-javadoc %defattr(-,root,root,-) %{_javadocdir}/pki-%{version}/ %endif +%endif # %{with server} %changelog * Fri Nov 22 2013 Dogtag Team 10.2.0-0.1 - Updated version number to 10.2.0-0.1. +- Added option to build without server packages. * Fri Nov 15 2013 Ade Lee 10.1.0-1 - Trac Ticket 788 - Clean up spec files diff --git a/specs/pki-tps.spec b/specs/pki-tps.spec index 19a29981b..a78839443 100644 --- a/specs/pki-tps.spec +++ b/specs/pki-tps.spec @@ -6,6 +6,8 @@ URL: http://pki.fedoraproject.org/ License: LGPLv2 Group: System Environment/Daemons +%bcond_without javadoc + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: cmake >= 2.8.9-1 @@ -128,7 +130,9 @@ cd build %else -DRESTEASY_LIB=/usr/share/java/resteasy \ %endif - %{?_without_javadoc:-DWITH_JAVADOC:BOOL=OFF} \ +%if ! %{with javadoc} + -DWITH_JAVADOC:BOOL=OFF \ +%endif .. %{__make} VERBOSE=1 %{?_smp_mflags} -- cgit