Skip to content

Commit

Permalink
Merge branch 'fossology:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
GMishx authored Feb 27, 2023
2 parents 837770f + 0a83c48 commit 8556c5b
Show file tree
Hide file tree
Showing 233 changed files with 9,001 additions and 3,030 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ indent_size = 2

[Makefile]
indent_style = tab

[rules]
indent_style = tab
14 changes: 11 additions & 3 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,15 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.1']
config:
- {
php: "8.1",
phpunit: "^10.0.12",
}
- {
php: "7.4",
phpunit: "^9.6.3",
}
services:
postgres:
image: postgres:12
Expand Down Expand Up @@ -241,9 +249,9 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
php-version: ${{ matrix.config.php }}
extensions: gettext, mbstring, gd, json, xml, zip, pgsql, curl, uuid, posix, sqlite3
tools: phpunit
tools: phpunit:${{ matrix.config.phpunit }}
coverage: xdebug
env:
fail-fast: true
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ jobs:
echo PACKAGE_NAME=$(echo "FOSSology-${VERSION}-$(lsb_release -si | tr [:upper:] [:lower:])-$(lsb_release -sc | tr [:upper:] [:lower:]).tar.gz") >> $GITHUB_ENV
- name: Configure and Generate CMake Project
run: |
mkdir build
cd build
cmake -GNinja ..
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DFO_SYSCONFDIR=/etc/fossology -DFO_LOCALSTATEDIR=/var -S. -B./build -G Ninja
- name: Build Debs
run: ninja -C build package
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
run: |
echo '{"extends": ["spectral:oas"]}' > .spectral.json
- name: Run spectral
uses: stoplightio/[email protected].2
uses: stoplightio/[email protected].10
with:
file_glob: src/www/ui/api/documentation/openapi.yaml

Expand Down
17 changes: 16 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# SPDX-License-Identifier: FSFAP
/.idea
/.vscode
/.phpstorm
*iml
_*.c
_*.h
Expand Down Expand Up @@ -61,11 +62,21 @@ src/cli/fossupload_status
src/cli/exportLicenseRefUsingSPDX
src/clixml/agent/version.php
src/clixml/agent/clixml
src/copyright/agent/ipra
src/copyright/agent/copyright
src/copyright/agent/keyword
src/copyright/agent/fo_unicode_clean
src/copyright/agent_tests/Functional/copyright
src/copyright/agent_tests/Unit/test_copyright
src/copyright/agent_tests/results
src/decider/agent/decider
src/decider/agent/version.php
src/deciderjob/agent/deciderjob
src/deciderjob/agent/version.php
src/decisionexporter/agent/decisionexporter
src/decisionexporter/agent/version.php
src/decisionimporter/agent/decisionimporter
src/decisionimporter/agent/version.php
src/delagent/agent/delagent
src/demomod/agent/demomod
src/lib/c/fossconfigTest
Expand All @@ -86,6 +97,7 @@ src/mimetype/agent/mimetype
src/mimetype/agent_tests/Unit/test_mimetype
src/monk/agent/_squareVisitor.h.gen
src/monk/agent/monk
src/monk/agent/monkbulk
src/monk/agent/monk_cov
src/monk/agent/monkbulk_cov
src/monk/agent/squareBuilder
Expand Down Expand Up @@ -151,6 +163,8 @@ variable.list
/src/deciderjob/agent/version.php
/src/decider/agent/decider
/src/decider/agent/version.php
/src/decisionexporter/agent/version.php
/src/decisionexporter/agent/decisionexporter
/testReport/
/src/readmeoss/agent/version.php
/src/reuser/agent/reuser
Expand All @@ -159,7 +173,8 @@ variable.list
/src/copyright/VERSION-ecc
/src/copyright/VERSION-keyword
/src/copyright/VERSION-copyright
/src/spdx2/agent_tests/Functional/spdx-tools-2.2.2-jar-with-dependencies.jar*
/src/copyright/VERSION-ipra
/src/spdx2/agent_tests/Functional/tools-java-*-jar-with-dependencies.jar
/src/spdx2/agent/version.php
/src/unifiedreport/agent/unifiedreport
/src/unifiedreport/agent/version.php
Expand Down
2 changes: 1 addition & 1 deletion .gitpod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN install-packages --option Dpkg::Options::="--force-confold" \
libdbd-sqlite3-perl libdistro-info-perl libgcrypt20-dev \
libicu66 libicu-dev libjson-c-dev libjsoncpp-dev \
liblocal-lib-perl libmagic-dev libmxml-dev libpcre3-dev libpq-dev \
librpm-dev libspreadsheet-writeexcel-perl libsqlite3-0 libsqlite3-dev \
librpm-dev libzstd-dev libspreadsheet-writeexcel-perl libsqlite3-0 libsqlite3-dev \
libssl-dev libtext-template-perl libxml2-dev lsb-release ninja-build p7zip \
p7zip-full poppler-utils postgresql-12 postgresql-contrib-12 \
postgresql-server-dev-all rpm sleuthkit s-nail sqlite3 subversion tar \
Expand Down
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ project(FOSSOLOGY)
# set defaults for the project
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/SetDefaults.cmake)

# Check latest version info from git
message(STATUS "Current fossology version ${FO_VERSION}")
message(STATUS "Latest commit hash: ${FO_COMMIT_HASH}")
message(STATUS "Current Branch: ${FO_BRANCH}")
message(STATUS "Current Build Date: ${FO_BUILD_DATE}")
message(STATUS "Latest Commit Date: ${FO_COMMIT_DATE}")

if(TESTING)
enable_testing()
endif()
Expand Down
8 changes: 4 additions & 4 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# SPDX-FileCopyrightText: © 2014 Siemens AG
# SPDX-FileCopyrightText: © 2014,2022, Siemens AG

# SPDX-License-Identifier: GPL-2.0-only AND LGPL-2.1-only
$post_up_message = <<WELCOME
Expand Down Expand Up @@ -45,9 +45,9 @@ cd /fossology
DEBIAN_FRONTEND=noninteractive ./utils/fo-installdeps -y
sudo make clean
make
sudo make install
sudo cmake -DCMAKE_BUILD_TYPE=Release -S. -B./build -G Ninja
sudo cmake --build ./build --parallel
sudo ninja -C ./build install
sudo /usr/local/lib/fossology/fo-postinstall
Expand Down
90 changes: 80 additions & 10 deletions cmake/FoPackaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,15 @@ set(CPACK_COMPONENTS_ALL
vendor
buckets
copyright
ecc
keyword
ipra
db
debug
decider
deciderjob
decisionexporter
decisionimporter
delagent
mimetype
monk
Expand All @@ -64,7 +69,7 @@ set(CPACK_COMPONENTS_ALL
ojo
pkgagent
readmeoss
unifiedReport
unifiedreport
reuser
reso
scancode
Expand All @@ -89,8 +94,9 @@ fossology-common package.")

set(CPACK_DEBIAN_FOSSOLOGY_PACKAGE_DEPENDS
"fossology-web, fossology-scheduler, fossology-ununpack,
fossology-copyright, fossology-buckets, fossology-mimetype,
fossology-delagent, fossology-wgetagent")
fossology-copyright, fossology-ecc, fossology-keyword, fossology-ipra,
fossology-buckets, fossology-mimetype, fossology-delagent,
fossology-wgetagent")
set(CPACK_DEBIAN_FOSSOLOGY_PACKAGE_RECOMMENDS
"fossology-monk, fossology-monkbulk, fossology-decider,
fossology-readmeoss, fossology-spdx2, fossology-reportimport,
Expand All @@ -112,11 +118,11 @@ This package contains the resources needed by all of the other
fossology components. This includes admin tools for maintenance.")

set(CPACK_DEBIAN_FOSSOLOGY-COMMON_PACKAGE_DEPENDS
"php7.2-pgsql | php7.3-pgsql | php7.4-pgsql, php-pear,
php7.2-cli | php7.3-cli | php7.4-cli, php-mbstring,
php7.2-json | php7.3-json | php7.4-json, php-zip, php-xml,
php7.2-curl | php7.3-curl | php7.4-curl, php-uuid,
php7.2-gd | php7.3-gd | php7.4-gd")
"php7.2-pgsql | php7.3-pgsql | php7.4-pgsql | php8.1-pgsql, php-pear,
php7.2-cli | php7.3-cli | php7.4-cli | php8.1-cli, php-mbstring,
php7.2-json | php7.3-json | php7.4-json | php8.1-json, php-zip, php-xml,
php7.2-curl | php7.3-curl | php7.4-curl | php8.1-curl, php-uuid,
php7.2-gd | php7.3-gd | php7.4-gd | php8.1-gd")

set(CPACK_DEBIAN_FOSSOLOGY-COMMON_PACKAGE_SECTION "utils")
set(CPACK_DEBIAN_FOSSOLOGY-COMMON_PACKAGE_CONTROL_EXTRA
Expand All @@ -131,8 +137,8 @@ ${FO_PACKAGE_COMMON_DESCRIPTION}
This package depends on the packages for the web interface.")

set(CPACK_DEBIAN_WWW_PACKAGE_DEPENDS
"fossology-common, apache2, php7.2-gd|php7.3-gd|php7.4-gd,
libapache2-mod-php7.2|libapache2-mod-php7.3|libapache2-mod-php7.4")
"fossology-common, apache2, php7.2-gd|php7.3-gd|php7.4-gd|php8.1-gd,
libapache2-mod-php7.2|libapache2-mod-php7.3|libapache2-mod-php7.4|libapache2-mod-php8.1")

set(CPACK_DEBIAN_WWW_PACKAGE_SECTION "utils")
set(CPACK_DEBIAN_WWW_PACKAGE_RECOMMENDS "fossology-db")
Expand Down Expand Up @@ -252,6 +258,44 @@ set(CPACK_DEBIAN_COPYRIGHT_PACKAGE_DEPENDS

set(CPACK_DEBIAN_COPYRIGHT_PACKAGE_SECTION "utils")

## FOSSOLOGY-ECC
set(CPACK_DEBIAN_ECC_PACKAGE_NAME "fossology-ecc")
set(CPACK_DEBIAN_ECC_FILE_NAME "fossology-ecc_${FO_PACKAGE_VERSION}-1_amd64.deb")
set(CPACK_DEBIAN_ECC_DESCRIPTION
"architecture for analyzing software, ecc
${FO_PACKAGE_COMMON_DESCRIPTION}
This package contains the ecc agent programs and their resources.")

set(CPACK_DEBIAN_ECC_PACKAGE_DEPENDS
"fossology-common, fossology-copyright, libpcre3")

set(CPACK_DEBIAN_ECC_PACKAGE_SECTION "utils")

## FOSSOLOGY-KEYWORD
set(CPACK_DEBIAN_KEYWORD_PACKAGE_NAME "fossology-keyword")
set(CPACK_DEBIAN_KEYWORD_FILE_NAME "fossology-keyword_${FO_PACKAGE_VERSION}-1_amd64.deb")
set(CPACK_DEBIAN_KEYWORD_DESCRIPTION
"architecture for analyzing software, keyword
${FO_PACKAGE_COMMON_DESCRIPTION}
This package contains the keyword agent programs and their resources.")

set(CPACK_DEBIAN_KEYWORD_PACKAGE_DEPENDS
"fossology-common, fossology-copyright, libpcre3")
set(CPACK_DEBIAN_KEYWORD_PACKAGE_SECTION "utils")

## FOSSOLOGY-IPRA
set(CPACK_DEBIAN_IPRA_PACKAGE_NAME "fossology-ipra")
set(CPACK_DEBIAN_IPRA_FILE_NAME "fossology-ipra_${FO_PACKAGE_VERSION}-1_amd64.deb")
set(CPACK_DEBIAN_IPRA_DESCRIPTION
"architecture for analyzing software, ipra
${FO_PACKAGE_COMMON_DESCRIPTION}
This package contains the ipra agent programs and their resources.")

set(CPACK_DEBIAN_IPRA_PACKAGE_DEPENDS
"fossology-common, fossology-copyright, libpcre3")

set(CPACK_DEBIAN_IPRA_PACKAGE_SECTION "utils")

## FOSSOLOGY-BUCKETS
set(CPACK_DEBIAN_BUCKETS_PACKAGE_NAME "fossology-buckets")
set(CPACK_DEBIAN_BUCKETS_FILE_NAME "fossology-buckets_${FO_PACKAGE_VERSION}-1_amd64.deb")
Expand Down Expand Up @@ -422,6 +466,32 @@ set(CPACK_DEBIAN_DECIDERJOB_PACKAGE_DEPENDS

set(CPACK_DEBIAN_DECIDERJOB_PACKAGE_SECTION "utils")

## FOSSOLOGY-DECISIONEXPORTER PACKAGE
set(CPACK_DEBIAN_DECISIONEXPORTER_PACKAGE_NAME "fossology-decisionexporter")
set(CPACK_DEBIAN_DECISIONEXPORTER_FILE_NAME "fossology-decisionexporter_${FO_PACKAGE_VERSION}-1_amd64.deb")
set(CPACK_DEBIAN_DECISIONEXPORTER_DESCRIPTION
"architecture for analyzing software, decisionexporter
${FO_PACKAGE_COMMON_DESCRIPTION}
This package contains the decisionexporter agent program and its resources.")

set(CPACK_DEBIAN_DECISIONEXPORTER_PACKAGE_DEPENDS
"fossology-common")

set(CPACK_DEBIAN_DECISIONEXPORTER_PACKAGE_SECTION "utils")

## FOSSOLOGY-DECISIONIMPORTER PACKAGE
set(CPACK_DEBIAN_DECISIONIMPORTER_PACKAGE_NAME "fossology-decisionimporter")
set(CPACK_DEBIAN_DECISIONIMPORTER_FILE_NAME "fossology-decisionimporter_${FO_PACKAGE_VERSION}-1_amd64.deb")
set(CPACK_DEBIAN_DECISIONIMPORTER_DESCRIPTION
"architecture for analyzing software, decisionimporter
${FO_PACKAGE_COMMON_DESCRIPTION}
This package contains the decisionimporter agent program and its resources.")

set(CPACK_DEBIAN_DECISIONIMPORTER_PACKAGE_DEPENDS
"fossology-common")

set(CPACK_DEBIAN_DECISIONIMPORTER_PACKAGE_SECTION "utils")

## FOSSOLOGY-READMEOSS PACKAGE
set(CPACK_DEBIAN_READMEOSS_PACKAGE_NAME "fossology-readmeoss")
set(CPACK_DEBIAN_READMEOSS_FILE_NAME "fossology-readmeoss_${FO_PACKAGE_VERSION}-1_amd64.deb")
Expand Down
7 changes: 1 addition & 6 deletions cmake/FoUtilities.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ macro(getGitVersion)
"\\1.\\3\\2" VERSION_GIT ${VERSION_GIT})
endif()
set(FO_VERSION ${VERSION_GIT} CACHE INTERNAL "fossology version")
message(STATUS "Current fossology version ${FO_VERSION}")

execute_process(
COMMAND "${GIT_EXECUTABLE}" show -s --format=%h
Expand All @@ -52,7 +51,6 @@ macro(getGitVersion)
)
string(SUBSTRING "${COMMIT_HASH}" 0 6 COMMIT_HASH)
set(FO_COMMIT_HASH ${COMMIT_HASH} CACHE INTERNAL "latest commit hash")
message(STATUS "Latest commit hash: ${FO_COMMIT_HASH}")

execute_process(
COMMAND "${GIT_EXECUTABLE}" rev-parse --abbrev-ref HEAD
Expand All @@ -62,7 +60,6 @@ macro(getGitVersion)
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(FO_BRANCH ${BRANCH} CACHE INTERNAL "current branch")
message(STATUS "Current Branch: ${FO_BRANCH}")

execute_process(
COMMAND date +"%Y/%m/%d %R %:z"
Expand All @@ -71,7 +68,6 @@ macro(getGitVersion)
WORKING_DIRECTORY ${FO_SOURCEDIR}
)
set(FO_BUILD_DATE ${BUILD_DATE} CACHE INTERNAL "latest build date")
message(STATUS "Current Build Data: ${FO_BUILD_DATE}")

execute_process(
COMMAND "${GIT_EXECUTABLE}" show -s --format=@%ct
Expand All @@ -80,8 +76,7 @@ macro(getGitVersion)
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${FO_SOURCEDIR}
)
set(FO_COMMIT_DATE ${COMMIT_DATE} CACHE INTERNAL "latest commit hash")
message(STATUS "Latest Commit date: ${FO_COMMIT_DATE}")
set(FO_COMMIT_DATE ${COMMIT_DATE} CACHE INTERNAL "latest commit date")

set_property(GLOBAL APPEND
PROPERTY CMAKE_CONFIGURE_DEPENDS
Expand Down
22 changes: 16 additions & 6 deletions cmake/SetDefaults.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,29 @@ if(DEFINED CMAKE_CXX_COMPILER)
find_package(Boost REQUIRED regex system filesystem program_options)
endif()
find_package(Git REQUIRED)
foreach(SCHE_LIBS glib-2.0 gthread-2.0 gio-2.0 gobject-2.0)

# libmagic, libgcrypt does not have pc module on Debian buster
# json-c does not have cmake aware packages on Debian buster
foreach(SCHE_LIBS
glib-2.0 gthread-2.0 gio-2.0 gobject-2.0 rpm libxml-2.0 libxslt icu-uc
json-c
)
string(REPLACE "-2.0" "" LIB_NAME ${SCHE_LIBS})
pkg_check_modules(${LIB_NAME} REQUIRED ${SCHE_LIBS})
endforeach()
pkg_check_modules(jsoncpp REQUIRED jsoncpp)
pkg_check_modules(jsonc REQUIRED json-c)

if(TESTING)
foreach(TEST_LIBS
cunit cppunit
)
pkg_check_modules(${TEST_LIBS} REQUIRED ${TEST_LIBS})
endforeach()
endif(TESTING)

set(CMAKE_INSTALL_MESSAGE NEVER) # control if messages should be displayed while installing

include(${FO_CMAKEDIR}/FoUtilities.cmake)
if(NOT DEFINED FO_COMMIT_DATE)
getGitVersion()
endif(NOT DEFINED FO_COMMIT_DATE)
getGitVersion()

# Variables for testing
execute_process(
Expand Down
Loading

0 comments on commit 8556c5b

Please sign in to comment.