Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ RUN set -x \
&& /fossology/install/scripts/php-conf-fix.sh --overwrite \
&& /fossology/utils/fo-installdeps -e -y \
&& $_cleanup
RUN curl -sS https://getcomposer.org/installer | php && \
mv composer.phar /usr/local/bin/composer
RUN make composer_install

ADD . .
RUN chmod +x /fossology/docker-entrypoint.sh
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ use, since the the standalone image does not take care of data persistency.

A pre-built Docker image is available from [Docker Hub](https://hub.docker.com/r/fossology/fossology/) and can be run using following command:
``` sh
docker run -p 8081:8081 fossology/fossology
docker run -p 8081:80 fossology/fossology
```

The docker image can then be used using http://IP_OF_DOCKER_HOST:8081/repo user fossy passwd fossy.

Execution with external database container can be done using Docker Compose.
The Docker Compose file is located under the `/install` folder can can be run using following command:
``` sh
Expand Down
3 changes: 1 addition & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ sudo apt-get update -qq -y

sudo apt-get install -qq curl php5 git libspreadsheet-writeexcel-perl libdbd-sqlite3-perl

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/bin/composer
make composer_install

# install spdx-tools
/vagrant/install/scripts/install-spdx-tools.sh
Expand Down
11 changes: 9 additions & 2 deletions install/fo-apache.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ Alias /repo /usr/share/fossology/www/ui
<Directory "/usr/share/fossology/www/ui">
AllowOverride None
Options FollowSymLinks MultiViews
Order allow,deny
Allow from all

<IfVersion < 2.3>
order allow,deny
allow from all
</IfVersion>
<IfVersion >= 2.3>
Require all granted
</IfVersion>

# uncomment to turn on php error reporting
#php_flag display_errors on
#php_value error_reporting 2039
Expand Down
4 changes: 2 additions & 2 deletions install/src-install-apache-example.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# FOSSology example apache config

Alias /repo/ /usr/local/share/fossology/www/ui/
Alias /repo /usr/local/share/fossology/www/ui

<Directory "/usr/local/share/fossology/www/ui/">
<Directory "/usr/local/share/fossology/www/ui">
AllowOverride None
Options FollowSymLinks MultiViews

Expand Down
51 changes: 44 additions & 7 deletions pbconf/Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

#
# original script by [email protected]
# additions by [email protected]
#
# SPDX-License-Identifier: GPL-2.0
#
# this script starts a VM in order to run project builder inside
# for development and debugging
#

#
# std vagrant setup
#
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"

Expand All @@ -9,7 +23,11 @@ Vagrant.configure("2") do |config|
end

config.vm.synced_folder "..", "/home/vagrant/prj/fossology", type: "rsync"
config.vm.network "forwarded_port", guest: 80, host: 8081

#
# part to prepare dependencies
#
config.vm.provision "shell" do |s|
s.inline = <<SCRIPT
set -ex
Expand Down Expand Up @@ -52,7 +70,11 @@ systemctl start docker

SCRIPT
end


#
# checking out and preparing project builder
# note that triple backslashes are because of cat and vagrant escaping
#
config.vm.provision "shell" do |s|
s.privileged = false
s.inline = <<SCRIPT
Expand All @@ -79,13 +101,28 @@ PBRC
################################################################################
# sbx = sandbox
# actually, sbx2pkg is included in sbx2pkg2ins
pb -t -p fossology sbx2build fossology
pb -p fossology build2prep fossology
# pb -t -p fossology sbx2pkg fossology
pb -t -p fossology sbx2pkg2ins fossology
for pkg in "fossology-composer" "fossology"; do
pb -t -p fossology sbx2build $pkg
pb -p fossology build2prep $pkg
# pb -t -p fossology sbx2pkg $pkg
pb -t -p fossology sbx2pkg2ins $pkg
done

SCRIPT
end

#
# applying some work around
#
config.vm.provision "shell" do |s|
s.privileged = false
s.inline = <<SCRIPT

# uahhh: disabling SELinux
# remove if the https://github.com/fossology/fossology/issues/727
setenforce 0

SCRIPT
end

config.vm.network "forwarded_port", guest: 80, host: 8081
end
end
2 changes: 1 addition & 1 deletion pbconf/fossology.pb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ testver fossology = true
# Additional repository to add at build time
# addrepo centos-5-x86_64 = http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm,ftp://ftp.project-builder.org/test/centos/5/pb.repo
# addrepo centos-4-x86_64 = http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el4.rf.x86_64.rpm,ftp://ftp.project-builder.org/test/centos/4/pb.repo
addrepo centos-7-x86_64 = https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
addrepo centos-7-x86_64 = ftp://ftp.project-builder.org/centos/7/x86_64/pb.repo,https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

# Adapt to your needs:
# Optional if you need to overwrite the global values above
Expand Down
5 changes: 3 additions & 2 deletions pbconf/fossology/rpm/fossology.spec
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#
# $Id$
#
%define srcname PBPKG

Name: PBREALPKG
Name: PBPKG
Version: PBVER
Release: PBTAGPBSUF
License: PBLIC
Expand Down Expand Up @@ -187,7 +188,7 @@ This package contains the monk agent programs and their resources.
This package contains the monkbulk agent programs and their resources.

%prep
%setup -q
%setup -q -n %{name}-%{version}PBEXTDIR
#PBPATCHCMD
# This is not clean, but should allow to work menawhild a better solution is found
make SYSCONFDIR=%{_sysconfdir}/fossology PREFIX=%{_usr} LOCALSTATEDIR=%{_var} composer_download
Expand Down
11 changes: 4 additions & 7 deletions pbconf/pbfilter/all.pbf
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@
# PBREPO is replaced by the root URL to access the repository
filter PBREPO = $pb->{'repo'}

# PBSRC is replaced by the source package location after the repo
filter PBSRC = http://sourceforge.net/projects/fossology/files/fossology/%{name}-%{version}.tar.gz
# Used if virtual name != real name (perl, ...)
#filter PBSRC = src/%{srcname}-%{version}.tar.gz
# PBSRC is replaced by the source package format
filter PBSRC = src/%{srcname}-%{version}$pb->{'extdir'}.tar.gz

# PBVER is replaced by the version ($pb->{'ver'} in code)
filter PBVER = $pb->{'ver'}$pb->{'extdir'}
filter PBVTARGET = $pb->{'ver'}
filter PBVER = $pb->{'ver'}

# PBDATE is replaced by the date ($pb->{'date'} in code)
filter PBDATE = $pb->{'date'}

# PBEXTDIR is replaced by the testdir extension if needed ($pb->{'extdir'} in code)
# PBEXTDIR is replaced by the date ($pb->{'extdir'} in code)
filter PBEXTDIR = $pb->{'extdir'}

# PBPATCHSRC is replaced by the patches names if value is yes. Patches are located under the pbpatch dir of the pkg.
Expand Down
2 changes: 1 addition & 1 deletion pbconf/pbfilter/centos-7.pbf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ filter PBDEP = cabextract,genisoimage,sleuthkit,file
#filter PBREC = Recommends: upx

# PBBUILDDEP is replaced by the list of build dependencies
filter PBBUILDDEP = perl-Text-Template,perl-podlators
filter PBBUILDDEP = perl-Text-Template,perl-podlators,file-devel

# PBSUF is replaced by the package suffix ($pbsuf'} in code)
#filter PBSUF = %{dist}
Expand Down
2 changes: 1 addition & 1 deletion pbconf/pbfilter/debian-6.pbf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Filter for debian build
#
# PBDEBSTD is replaced by the Debian standard version
filter PBDEBSTD = 3.9.1
filter PBDEBSTD = 3.8.0

# PBDEBCOMP is replaced by the Debian Compatibility value
filter PBDEBCOMP = 7
Expand Down
13 changes: 13 additions & 0 deletions pbconf/pbfilter/debian-8.pbf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# $Id$
#
# Filter for debian build
#
# PBDEBSTD is replaced by the Debian standard version
filter PBDEBSTD = 3.9.1

# PBDEBCOMP is replaced by the Debian Compatibility value
filter PBDEBCOMP = 7

filter PBBUILDDEP = postgresql-server-dev-9.1
filter PBDEP = postgresql (>= 8.1) | postgresql-9.1
8 changes: 8 additions & 0 deletions pbconf/pbfilter/ubuntu-15.10.pbf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# $Id$
#
# Filter for Ubuntu 14.04 build

# for Ubuntu 14.04 use the postgres 9.3 libpq headers
# according to thread at http://postgresql.1045698.n5.nabble.com/Details-about-libpq-cross-version-compatibility-td5723830.html the API has not changed significantly since 7.4
filter PBBUILDDEP = postgresql-server-dev-9.4
8 changes: 8 additions & 0 deletions pbconf/pbfilter/ubuntu-16.04.pbf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# $Id$
#
# Filter for Ubuntu 14.04 build

# for Ubuntu 14.04 use the postgres 9.3 libpq headers
# according to thread at http://postgresql.1045698.n5.nabble.com/Details-about-libpq-cross-version-compatibility-td5723830.html the API has not changed significantly since 7.4
filter PBBUILDDEP = postgresql-server-dev-9.4
8 changes: 8 additions & 0 deletions pbconf/pbfilter/ubuntu-16.10.pbf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# $Id$
#
# Filter for Ubuntu 14.04 build

# for Ubuntu 14.04 use the postgres 9.3 libpq headers
# according to thread at http://postgresql.1045698.n5.nabble.com/Details-about-libpq-cross-version-compatibility-td5723830.html the API has not changed significantly since 7.4
filter PBBUILDDEP = postgresql-server-dev-9.4
9 changes: 2 additions & 7 deletions pbconf/pbfilter/ubuntu.pbf
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
# Filter for debian build
#
# PBDEBSTD is replaced by the Debian standard version
filter PBDEBSTD = 3.9.1
filter PBDEBSTD = 3.8.3

# PBDEBCOMP is replaced by the Debian Compatibility value
filter PBDEBCOMP = 7

# for Ubuntu prior to 12.04, use the postgres 8.4 libpq headers
filter PBBUILDDEP = postgresql-server-dev-8.4
# and allow any postgres version 8.1 or better at runtime
filter PBDEP = postgresql (>= 8.1) | postgresql-8.4 | postgresql-9.1
filter PBDEBCOMP = 7
4 changes: 2 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

TOP = ..
VARS = $(TOP)/Makefile.conf
COMPOSERTMP = /tmp/composer
COMPOSERTMP = $(TOP)/tmp/composer
include $(VARS)

# the directories we do things in by default
Expand Down Expand Up @@ -86,7 +86,7 @@ composer_download:
composer_install:
@echo "current dir: '$${PWD}'"
$(INSTALL_DATA) composer.json composer.lock $(DESTDIR)$(MODDIR)
(cd $(DESTDIR)$(MODDIR); $(COMPOSERTMP)/composer install -q --no-dev)
(cd $(DESTDIR)$(MODDIR); export COMPOSER_HOME=/dev/null ; $(COMPOSERTMP)/composer install -q --no-dev)

.PHONY: subdirs $(BUILDDIRS)
.PHONY: subdirs $(DIRS)
Expand Down
3 changes: 1 addition & 2 deletions src/copyright/agent/regexConfProvider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,9 @@ const char* RegexConfProvider::getRegexValue(const string& identity,
const string& key)
{
const string* rv;
map<string,RegexMap> rmm = RegexConfProvider::_regexMapMap;
#pragma omp critical(rmm)
{
rv = &(rmm[identity][key]);
rv = &(RegexConfProvider::_regexMapMap[identity][key]);
}
return (*rv).c_str();
}
13 changes: 11 additions & 2 deletions src/phpunit-bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,14 @@
$classLoader = require __DIR__ . '/vendor/autoload.php';

$hamcrestUtilPath = $classLoader->findFile('\Hamcrest\Util');
require dirname($hamcrestUtilPath) . '/../Hamcrest.php';

if($hamcrestUtilPath != null && $hamcrestUtilPath != "") {
$hamcrestPath = dirname($hamcrestUtilPath) . '/..';
}else{
// failed to find folder with classLoader, try fallback
$hamcrestPath = __DIR__ . "/vendor/hamcrest/hamcrest-php/hamcrest";
if(! is_dir($hamcrestPath) || ! is_file($hamcrestPath . '/Hamcrest.php')){
// fallback folder or file does not exist
exit(1);
}
}
require $hamcrestPath . '/Hamcrest.php';
3 changes: 3 additions & 0 deletions utils/fo-installdeps
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ if [ $BUILDTIME ]; then
isadora) apt-get $YesOpt install postgresql-server-dev-8.4;;
precise|oneiric|quantal|raring|saucy) apt-get $YesOpt install postgresql-server-dev-9.1;;
trusty|jessie) apt-get $YesOpt install postgresql-server-dev-9.3;;
xenial) apt-get $YesOpt install postgresql-server-dev-9.5;;
*) echo "ERROR: Unknown or Unsupported $DISTRO release, please report to the mailing list"; exit 1;;
esac
fi
Expand Down Expand Up @@ -189,6 +190,8 @@ if [ $RUNTIME ]; then
apt-get $YesOpt install postgresql-9.1;;
trusty|jessie)
apt-get $YesOpt install postgresql-9.3;;
xenial)
apt-get $YesOpt install postgresql-9.5;;
*) echo "ERROR: Unknown or Unsupported $DISTRO release, please report to the mailing list"; exit 1;;
esac
fi
Expand Down