Skip to content

Conversation

bill-auger
Copy link
Contributor

the explicit requirement of PHP5 cause build to fail on debian 9 which has PHP7

$ sudo utils/fo-installdeps 
...
Package libapache2-mod-php5 is not available, but is referred to by another package.
E: Package 'libapache2-mod-php5' has no installation candidate
Package php5 is not available, but is referred to by another package.
Package php5-pgsql is not available, but is referred to by another package.
Package php5-cli is not available, but is referred to by another package.
Package php5-curl is not available, but is referred to by another package.
E: Package 'php5' has no installation candidate
E: Package 'php5-pgsql' has no installation candidate
E: Package 'php5-cli' has no installation candidate
E: Package 'php5-curl' has no installation candidate
...

this PR addis the appropriate package for debian 'stretch' and ubuntu 'yakkety','zesty', and 'artful' - although this was not tested on ubuntu the package names were gathered from the following URLs:

the additional 'php-xml' package was needed when bulding on debian 9

$ sudo  /usr/local/lib/fossology/fo-postinstall
....
PHP Fatal error:  Uncaught Error: Class 'DOMDocument' not found in /usr/local/share/fossology/vendor/symfony/config/Symfony/Component/Config/Util/XmlUtils.php:52
Stack trace:
#0 /usr/local/share/fossology/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php(232): Symfony\Component\Config\Util\XmlUtils::loadFile('/usr/local/shar...', Array)
....

it should be noted that, instead of this PR, the entire debian/ubuntu sections could probably be greatly simplified to resemble the other distro sections by requiring only these meta packages - i.e. these would probably work for any release:

postgresql-server-dev-all
instead of
postgresql-server-dev-9.5
or
postgresql-server-dev-9.6

postgresql php php-pgsql php-cli php-curl php-xml
instead of
postgresql-9.5 libapache2-mod-php5 php5 php5-pgsql php5-cli php5-curl
or
postgresql-9.6 libapache2-mod-php7.0 php7.0 php7.0-pgsql php7.0-cli php7.0-curl php7.0-xml;;

note that 'libapache2-mod-php7.0' is be omitted in this PR because it is required by 'php7.0'

$ apt depends php php-pgsql php-cli php-curl php-xml 
php
  Depends: php7.0
php-pgsql
  Depends: php-common
  Depends: php7.0-pgsql
php-cli
  Depends: php7.0-cli
php-curl
  Depends: php-common
  Depends: php7.0-curl
php-xml
  Depends: php-common
  Depends: php7.0-xml

$ apt depends php7.0
php7.0
 |Depends: libapache2-mod-php7.0
 |Depends: php7.0-fpm
  Depends: php7.0-cgi
  Depends: php7.0-common

@max-wittig
Copy link
Contributor

max-wittig commented Jun 26, 2017

There is already an open pull request for this. But this could replace or enhance PR #857

@bill-auger
Copy link
Contributor Author

noting that PR #857 is in a failing state perhaps it is doing to much - this patch and PR #862 are all that i need to do to get it to build and travis is happy with both of them as individual patches

the only problem i had was while using it issue #860 - maybe there is something in PR #857 to help with that

@bill-auger
Copy link
Contributor Author

oh also i needed to manually add the apache config to /etc/apache2/sites-available/but i was not not sure if this was a bug or intended behavior

@max-wittig
Copy link
Contributor

Intended behavior, but this will be fixed by PR #859. Travis was nearly happy. Just had some problems with the docker container. Nice contributions, but why do all the work a second time? Next time you should maybe check the existing Pull Requests first and help out there, instead of starting from zero.

@bill-auger
Copy link
Contributor Author

indeed i was too impatient tho i wanted to get this working today - the red "do not merge" label indicates i would have had to wait if not do it myself - also it is good to see that the dev team is responsive - thanks

this was my second attempt actually - the day before i had first gotten it to build on parabola which is an archlinux derrivative but then i hit a PHP error running the post install script - i could send a PR with what i have so far if you are interested in supporting archlinux variants

@max-wittig
Copy link
Contributor

max-wittig commented Jun 27, 2017

Sure why not. Contributions are welcome The pull request actually works on debian 9. There is just one error with the docker container, which actually runs with debian 8.8. So unrelated problem to debian stable. The label reads "do not merge yet". Stands for soon to be merged PR.

Copy link
Contributor

@max-wittig max-wittig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me and I had no issues with the copyright (#860) and combined with PR #862

Copy link
Member

@mcjaeger mcjaeger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think breaking the php conf script is serious (because of the hard reference there to php5), because it is default executed by the package installation.

Would you mind to check with the
https://github.com/fossology/fossology/blob/master/install/scripts/php-conf-fix.sh
?

@bill-auger bill-auger force-pushed the update-debian-deps branch from 35f10ca to 9d12a88 Compare July 7, 2017 13:09
Copy link
Contributor

@max-wittig max-wittig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No tests are executed for PHP 7.0. That's why travis actually doesn't fail with the PHPUnit tests.

@bill-auger
Copy link
Contributor Author

bill-auger commented Jul 10, 2017

so you want a switch something like this in install/scripts/php-conf-fix.sh ?

case "$CODENAME" in
  squeeze|wheezy|jessie)
  lucid|natty|isadora|precise|oneiric|quantal|raring|saucy|trusty|xenial|yakkety)
    phpIni=/etc/php5/apache2/php.ini
  stretch|buster|sid|zesty|artful)
    phpIni=/etc/php7/apache2/php.ini
esac

 * debian stretch,buster,sid
 * ubuntu yakkety,zesty,artful
@bill-auger bill-auger force-pushed the update-debian-deps branch from 9d12a88 to 800b685 Compare July 10, 2017 12:49
@bill-auger bill-auger changed the title update packages deps for debian stretch and ubuntu yakkety,zesty,artful update packages deps for latest debian and ubuntus Jul 10, 2017
@bill-auger
Copy link
Contributor Author

i may be in a bit over my head at this point - 'php5' is hard-coded in many places and PR #857 has not touched on any of these yet so it looks like there is much more work to complete debian9 support

again to be clear tho - my install on debian9 includes only the changes currently in this patch and it seems to be working fully (though i am not familiar with all of the features)

the following files contain the literal text 'php5':

./Vagrantfile
./Dockerfile
./CHANGELOG.md
./pbconf/fossology/deb/control
./pbconf/fossology/deb/fossology-web.postinst
./debian/control
./debian/fossology-web.postinst
./utils/fo-installdeps
./.travis.yml
./install/scripts/php-conf-fix.sh
./install/docker-compose.Dockerfile
./src/decider/agent/DeciderAgent.php
./src/pkgagent/agent_tests/testdata/control
./src/testing/jenkins/Fossology_Package_Install.xml
./src/testing/jenkins/Fossology_Source_Install.xml
./src/testing/jenkins/Fossology_Migration.xml
./src/testing/install/test4migrationinstall/testdata.php
./src/testing/install/pkgConfig.php
./src/testing/install/test4packageinstall/testdata.php
./src/www/ui_tests/startUpTest.php
./src/www/ui/Makefile

this is the complete listing:

./Vagrantfile
31:sudo apt-get install -qq curl php5 git libspreadsheet-writeexcel-perl libdbd-sqlite3-perl

./Dockerfile
19:    apt-get install -y lsb-release sudo postgresql php5-curl libpq-dev libdbd-sqlite3-perl libspreadsheet-writeexcel-perl && \

./CHANGELOG.md
47:* chore(testing): travis php7.1, phpunit5 for php56

./pbconf/fossology/deb/control
5:Build-Depends: debhelper, libglib2.0-dev, libmagic-dev, libxml2-dev, libtext-template-perl, librpm-dev, subversion, rpm, libpcre3-dev, libssl-dev, libboost-regex-dev, libboost-program-options-dev, php5, curl, PBBUILDDEP
28:Depends: php5-pgsql, php-pear, php5-cli, php5-json, ${shlibs:Depends}, ${misc:Depends}
41:Depends: fossology-common, fossology-db, fossology-decider, apache2, libapache2-mod-php5, ${misc:Depends}

./pbconf/fossology/deb/fossology-web.postinst
27:    sed -r -i.bak 's/;? ?upload_max_filesize ?= ?[0-9]+[kmgKMG]*/upload_max_filesize = 750M/' /etc/php5/apache2/php.ini

./debian/control
5:Build-Depends: debhelper, libglib2.0-dev, libmagic-dev, libxml2-dev, libmxml-dev, libtext-template-perl, librpm-dev, subversion, rpm, libpcre3-dev, libssl-dev, postgresql-server-dev-all, libboost-regex-dev, libboost-program-options-dev, libjson0-dev, php5-cli
11:Depends: php5-cli
40:Depends: php5-pgsql, php-pear, php5-cli, php5-json, ${shlibs:Depends}, ${misc:Depends}
53:Depends: fossology-common, fossology-db, fossology-decider, apache2, libapache2-mod-php5, ${misc:Depends}

./debian/fossology-web.postinst
27:    sed -r -i.bak 's/;? ?upload_max_filesize ?= ?[0-9]+[kmgKMG]*/upload_max_filesize = 750M/' /etc/php5/apache2/php.ini

./utils/fo-installdeps
181:                 apt-get $YesOpt install postgresql-8.4 libapache2-mod-php5 php5 php5-pgsql php5-cli php5-curl;;
183:                 apt-get $YesOpt install postgresql-9.1 libapache2-mod-php5 php5 php5-pgsql php5-cli php5-curl;;
185:                 apt-get $YesOpt install postgresql-8.4 libapache2-mod-php5 php5 php5-pgsql php5-cli php5-curl;;
187:                 apt-get $YesOpt install postgresql-8.4 libapache2-mod-php5 php5 php5-pgsql php5-cli php5-curl;;
189:                 apt-get $YesOpt install postgresql-9.1 libapache2-mod-php5 php5 php5-pgsql php5-cli php5-curl;;
191:                 apt-get $YesOpt install postgresql-9.3 libapache2-mod-php5 php5 php5-pgsql php5-cli php5-curl;;
193:                 apt-get $YesOpt install postgresql-9.4 libapache2-mod-php5 php5 php5-pgsql php5-cli php5-curl;;
195:                 apt-get $YesOpt install postgresql-9.5 libapache2-mod-php5 php5 php5-pgsql php5-cli php5-curl;;

./.travis.yml
27: - sudo apt-get install -qq apache2 libapache2-mod-php5 php5-pgsql php-pear php5-cli

./install/scripts/php-conf-fix.sh
13:    phpIni=/etc/php5/apache2/php.ini

./install/docker-compose.Dockerfile
22:       lsb-release curl php5 libpq-dev libdbd-sqlite3-perl libspreadsheet-writeexcel-perl postgresql-client \

./src/decider/agent/DeciderAgent.php
42:  const RULES_ALL = 0xf; // self::RULES_NOMOS_IN_MONK | self::RULES_NOMOS_MONK_NINKA | ... -> feature not available in php5.3

./src/pkgagent/agent_tests/testdata/control
7:Depends: fossology-agents, apache2, libapache2-mod-php5

./src/testing/jenkins/Fossology_Package_Install.xml
58:  apt-get -y install git php5 phpunit;

./src/testing/jenkins/Fossology_Source_Install.xml
58:  apt-get -y install git php5 phpunit php5-json;
59:  echo "suhosin.executor.include.whitelist = phar" >> /etc/php5/cli/php.ini

./src/testing/jenkins/Fossology_Migration.xml
55:  apt-get -y install git php5 phpunit;

./src/testing/install/test4migrationinstall/testdata.php
901:        copyFiles($debPath . 'cli-php.ini', '/etc/php5/cli/php.ini');
904:        echo "Failure: Could not copy php.ini to /etc/php5/cli/php.ini\n";
909:        copyFiles($debPath . 'apache2-php.ini', '/etc/php5/apache2/php.ini');
912:        echo "Failure: Could not copy php.ini to /etc/php5/apache2/php.ini\n";
929:        copyFiles($debPath . 'cli-php.ini', '/etc/php5/cli/php.ini');
932:        echo "Failure: Could not copy php.ini to /etc/php5/cli/php.ini\n";
937:        copyFiles($debPath . 'apache2-php.ini', '/etc/php5/apache2/php.ini');
940:        echo "Failure: Could not copy php.ini to /etc/php5/apache2/php.ini\n";
959:        copyFiles($debPath . 'cli-php.ini', '/etc/php5/cli/php.ini');
962:        echo "Failure: Could not copy php.ini to /etc/php5/cli/php.ini\n";
967:        copyFiles($debPath . 'apache2-php.ini', '/etc/php5/apache2/php.ini');
970:        echo "Failure: Could not copy php.ini to /etc/php5/apache2/php.ini\n";

./src/testing/install/pkgConfig.php
928:        copyFiles($debPath . 'cli-php.ini', '/etc/php5/cli/php.ini');
931:        echo "Failure: Could not copy php.ini to /etc/php5/cli/php.ini\n";
936:        copyFiles($debPath . 'apache2-php.ini', '/etc/php5/apache2/php.ini');
939:        echo "Failure: Could not copy php.ini to /etc/php5/apache2/php.ini\n";
959:        copyFiles($debPath . 'cli-php.ini', '/etc/php5/cli/php.ini');
962:        echo "Failure: Could not copy php.ini to /etc/php5/cli/php.ini\n";
967:        copyFiles($debPath . 'apache2-php.ini', '/etc/php5/apache2/php.ini');
970:        echo "Failure: Could not copy php.ini to /etc/php5/apache2/php.ini\n";
1000:        copyFiles($debPath . 'cli-php.ini', '/etc/php5/cli/php.ini');
1003:        echo "Failure: Could not copy php.ini to /etc/php5/cli/php.ini\n";
1008:        copyFiles($debPath . 'apache2-php.ini', '/etc/php5/apache2/php.ini');
1011:        echo "Failure: Could not copy php.ini to /etc/php5/apache2/php.ini\n";

./src/testing/install/test4packageinstall/testdata.php
901:        copyFiles($debPath . 'cli-php.ini', '/etc/php5/cli/php.ini');
904:        echo "Failure: Could not copy php.ini to /etc/php5/cli/php.ini\n";
909:        copyFiles($debPath . 'apache2-php.ini', '/etc/php5/apache2/php.ini');
912:        echo "Failure: Could not copy php.ini to /etc/php5/apache2/php.ini\n";
929:        copyFiles($debPath . 'cli-php.ini', '/etc/php5/cli/php.ini');
932:        echo "Failure: Could not copy php.ini to /etc/php5/cli/php.ini\n";
937:        copyFiles($debPath . 'apache2-php.ini', '/etc/php5/apache2/php.ini');
940:        echo "Failure: Could not copy php.ini to /etc/php5/apache2/php.ini\n";
959:        copyFiles($debPath . 'cli-php.ini', '/etc/php5/cli/php.ini');
962:        echo "Failure: Could not copy php.ini to /etc/php5/cli/php.ini\n";
967:        copyFiles($debPath . 'apache2-php.ini', '/etc/php5/apache2/php.ini');
970:        echo "Failure: Could not copy php.ini to /etc/php5/apache2/php.ini\n";

./src/www/ui_tests/startUpTest.php
25:    $p = popen('php5  '. dirname(__DIR__).'/ui/index.php 2>&1', 'r');

./src/www/ui/Makefile
35:#	php5 fo-render.php m

@bill-auger
Copy link
Contributor Author

bill-auger commented Aug 4, 2017

the single commit in this PR is now merged into #857 which is marked as "approved" so this one can probably be closed

@maxhbr
Copy link
Member

maxhbr commented Aug 5, 2017

now contained in #857

@maxhbr maxhbr closed this Aug 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants