PERFORCE change 166388 for review
Alejandro Pulver
alepulver at FreeBSD.org
Wed Jul 22 00:53:16 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=166388
Change 166388 by alepulver at alepulver_deimos on 2009/07/22 00:52:40
- Update FOSSology port to 1.1.0
- This version is working and will be committed to the ports tree.
Affected files ...
.. //depot/projects/soc2008/alepulver-portslicense/ports/GIDs#4 edit
.. //depot/projects/soc2008/alepulver-portslicense/ports/UIDs#4 edit
.. //depot/projects/soc2008/alepulver-portslicense/ports/devel/fossology/Makefile#5 edit
.. //depot/projects/soc2008/alepulver-portslicense/ports/devel/fossology/distinfo#3 edit
.. //depot/projects/soc2008/alepulver-portslicense/ports/devel/fossology/files/fossology.in#3 edit
.. //depot/projects/soc2008/alepulver-portslicense/ports/devel/fossology/files/patch-common__Makefile#2 edit
.. //depot/projects/soc2008/alepulver-portslicense/ports/devel/fossology/files/patch-common__fo-postinstall.in#2 edit
.. //depot/projects/soc2008/alepulver-portslicense/ports/devel/fossology/files/patch-db__dbcreate.in#2 edit
.. //depot/projects/soc2008/alepulver-portslicense/ports/devel/fossology/files/patch-scheduler__mkschedconf.c#2 edit
.. //depot/projects/soc2008/alepulver-portslicense/ports/devel/fossology/files/patch-scheduler__selftest.c#2 edit
.. //depot/projects/soc2008/alepulver-portslicense/ports/devel/fossology/files/pkg-message.in#4 edit
.. //depot/projects/soc2008/alepulver-portslicense/ports/devel/fossology/log.txt#3 delete
.. //depot/projects/soc2008/alepulver-portslicense/ports/devel/fossology/pkg-plist#4 edit
Differences ...
==== //depot/projects/soc2008/alepulver-portslicense/ports/GIDs#4 (text+ko) ====
==== //depot/projects/soc2008/alepulver-portslicense/ports/UIDs#4 (text+ko) ====
==== //depot/projects/soc2008/alepulver-portslicense/ports/devel/fossology/Makefile#5 (text+ko) ====
@@ -11,11 +11,13 @@
# archivers/rpm4 -> archivers/rpm2cpio
#
# TODO:
-# - Investigate scheduler problem when starting some agents.
+# - Add status command to rc.d script (run through "daemon -p ...").
+# - Make it shm_open in /var/tmp from lockfs.c rather than changing
+# current directory.
#
PORTNAME= fossology
-PORTVERSION= 1.0.0
+PORTVERSION= 1.1.0
CATEGORIES= devel
MASTER_SITES= SF
@@ -43,9 +45,10 @@
USE_PERL5= yes
USE_PGSQL= yes
IGNORE_WITH_PGSQL= 73 74 80
-USE_PHP= pgsql session posix
+USE_PHP= pgsql session posix pcre
IGNORE_WITH_PHP=4
WANT_PHP_CLI= yes
+WANT_PHP_WEB= yes
USE_RC_SUBR= fossology
REINPLACE_ARGS= -i ''
@@ -55,7 +58,7 @@
SUB_LIST= FOSS_DB="${FOSS_DB}"
PLIST_SUB= FOSS_DB="${FOSS_DB:S/${PREFIX}\///}"
-MAN1= cp2foss.1 fossjobs.1 fosslic.1
+MAN1= cp2foss.1 fo_notify.1 fossjobs.1 fosslic.1
FOSS_DB?= ${DATADIR}/repository
LIBDIR= ${PREFIX}/lib # is /usr/lib by default, and affects build
@@ -82,9 +85,20 @@
# Fix PostgreSQL user name (postgres -> pgsql)
@${REINPLACE_CMD} -e 's|su postgres|su pgsql|' \
${WRKSRC}/db/dbcreate.in
+# Fix hostname invocation
+ @${REINPLACE_CMD} -Ee 's|(hostname) --fqdn|\1|' \
+ ${WRKSRC}/cli/fo_notify.php
+# Add path to repository (might be hardcoded in other parts of FOSSology)
+ @${ECHO_CMD} "${FOSS_DB}" > ${WRKSRC}/common/defconf/RepPath.conf
+
+# XXX: this is done in rc.d script, but program could be modified as well
# Fix shm file path
- @${REINPLACE_CMD} -Ee 's|"(fossology-scheduler)"|"/var/tmp/\1"|' \
- ${WRKSRC}/scheduler/lockfs.c
+# @${REINPLACE_CMD} -Ee 's|"(fossology-scheduler)"|"/var/tmp/\1"|' \
+# ${WRKSRC}/scheduler/lockfs.c
+# Do not chdir to "/" as it does not have permission to create files there
+ @${REINPLACE_CMD} -e 's|daemon(0,|daemon(1,|' \
+ ${WRKSRC}/scheduler/scheduler.c \
+ ${WRKSRC}/scheduler/fo_watchdog.c
pre-install:
@${MKDIR} ${PREFIX}/lib/fossology/agents ${DATADIR}/php
@@ -94,6 +108,7 @@
${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README ${WRKSRC}/INSTALL* ${DOCSDIR}
.endif
+# Copy .sample (defaults) to .conf when not present
.for f in Db Depth Hosts Proxy RepPath
@cd ${PREFIX}/etc/fossology && test -f ${f}.conf || \
${CP} ${f}.conf.sample ${f}.conf
==== //depot/projects/soc2008/alepulver-portslicense/ports/devel/fossology/distinfo#3 (text+ko) ====
@@ -1,3 +1,3 @@
-MD5 (fossology-1.0.0.tar.gz) = 7d0e26d45871fac0e33a1a83c456e234
-SHA256 (fossology-1.0.0.tar.gz) = 3582c80390aa706878b2814dfb17622287b8574574609340958ddb75e6c3594a
-SIZE (fossology-1.0.0.tar.gz) = 1705341
+MD5 (fossology-1.1.0.tar.gz) = deffdd25641e6b1c053e123c5307f2db
+SHA256 (fossology-1.1.0.tar.gz) = c05e53e5fbaa3ac44c2fab79fcb5713668b675cbffa4bf1abccb49f18f9334d5
+SIZE (fossology-1.1.0.tar.gz) = 1994690
==== //depot/projects/soc2008/alepulver-portslicense/ports/devel/fossology/files/fossology.in#3 (text+ko) ====
@@ -2,7 +2,7 @@
#
# $FreeBSD$
#
-# REQUIRE: DAEMON
+# REQUIRE: DAEMON postgresql
# PROVIDE: fossology
#
@@ -10,13 +10,32 @@
name="fossology"
rcvar=`set_rcvar`
+load_rc_config "$name"
+: ${fossology_enable="NO"}
+
+SCHEDULER="%%PREFIX%%/lib/fossology/fossology-scheduler"
+WATCHDOG="%%PREFIX%%/lib/fossology/fo_watchdog"
+
+start_cmd="fossology_start"
+stop_cmd="fossology_stop"
-load_rc_config "$name"
+# FIXME: status command not implemented, but only one instance
+# is allowed so there aren't problems for now.
-: ${fossology_enable="NO"}
-: ${fossology_flags=""}
+fossology_start()
+{
+ echo "Starting fossology."
+# XXX: Enter /var/tmp because uses shm_open in current directory,
+# otherwise patch scheduler.c
+ cd /var/tmp && ${SCHEDULER} -d -R
+ cd /var/tmp && ${WATCHDOG}
+}
-command="%%PREFIX%%/lib/fossology/fossology-scheduler"
-command_args="-d"
+fossology_stop()
+{
+ echo "Stopping fossology."
+ ${WATCHDOG} -k
+ ${SCHEDULER} -k
+}
run_rc_command "$1"
==== //depot/projects/soc2008/alepulver-portslicense/ports/devel/fossology/files/patch-common__Makefile#2 (text+ko) ====
==== //depot/projects/soc2008/alepulver-portslicense/ports/devel/fossology/files/patch-common__fo-postinstall.in#2 (text+ko) ====
@@ -1,15 +1,100 @@
---- ./common/fo-postinstall.in.orig 2008-12-11 11:03:15.000000000 +0000
-+++ ./common/fo-postinstall.in 2009-07-10 01:50:46.000000000 +0000
-@@ -18,10 +18,8 @@
+--- common/fo-postinstall.in.orig 2009-07-13 21:51:17.000000000 +0000
++++ common/fo-postinstall.in 2009-07-15 00:37:37.000000000 +0000
+@@ -8,22 +8,15 @@
+ # right thing, regardless of the success of previous runs.
+
+ ## Options parsing and setup
+-# parse options
+-OPTS=`getopt -o adwseoh --long agent,database,web,web-only,scheduler,scheduler-only,everything,overwrite,help -n 'fo-postinstall' -- "$@"`
- eval set -- "$OPTS"
+-if [ $? != 0 ]; then
+- echo "ERROR: Bad option specified."
+- OPTS="--help"
+-fi
+-
+-eval set -- "$OPTS"
++# FIXME: joint options do not work (i.e. "-as" instead of "-a -s")
--# if no options or just -o then do everything
+ # if no options or just -o then do everything
-if [ "$OPTS" = " --" -o "$OPTS" = " -o --" ]; then
-- EVERYTHING=1
--fi
-+# FIXME: getopt is different in FreeBSD, port to bash builtin or native getopt
-+EVERYTHING=1
++if [ $# -eq 0 -o "$1" = "-o" ]; then
+ EVERYTHING=1
+ fi
- while true; do
+-while true; do
++while [ $# -gt 0 ]; do
case "$1" in
+ -a|--agent) AGENT=1; shift;;
+ -d|--database) DATABASE=1; shift;;
+@@ -105,15 +98,10 @@
+ echo "*** Creating user and group ***"
+
+ # check for group
+- if grep -q "^{$PROJECTGROUP}:" /etc/group; then
++ if pw groupshow {$PROJECTGROUP} 2>/dev/null 1>&2; then
+ echo "NOTE: group '{$PROJECTGROUP}' already exists, good."
+ else
+- # use addgroup if it exists since it supports --system
+- if [ -f /usr/sbin/addgroup -a ! -L /usr/sbin/addgroup ]; then
+- addgroup --system {$PROJECTGROUP}
+- else
+- groupadd {$PROJECTGROUP}
+- fi
++ pw groupadd {$PROJECTGROUP} -g 901
+ if [ "$?" != "0" ] ; then
+ echo "ERROR: Unable to create group '{$PROJECTGROUP}'"
+ exit 1
+@@ -123,25 +111,18 @@
+ fi
+
+ # check for user
+- if grep -q "^{$PROJECTUSER}:" /etc/passwd; then
++ if pw usershow {$PROJECTUSER} 2>/dev/null 1>&2; then
+ echo "NOTE: user '{$PROJECTUSER}' already exists, good."
+ USERSHELL=`grep "^{$PROJECTUSER}:" /etc/passwd |cut -d: -f 7`
+- if [ "$USERSHELL" = "/bin/false" ]; then
++ if [ "$USERSHELL" = "/usr/sbin/nologin" ]; then
+ echo "ERROR: {$PROJECTUSER} shell must be a real shell"
+ exit 1
+ fi
+ else
+ # ensure that the full parent path of the HOME exists first
+ mkdir -p $\{REPO%/*/*\}
+- # use adduser if it exists since it supports --system, but
+- # not if it's a symlink (probably to /usr/sbin/useradd)
+- if [ -f /usr/sbin/adduser -a ! -L /usr/sbin/adduser ]; then
+- adduser --gecos "{$PROJECT}" --ingroup {$PROJECTGROUP} --system \
+- --shell /bin/bash --home "$\{REPO%/*\}" {$PROJECTUSER}
+- else
+- useradd -c "{$PROJECT}" -g {$PROJECTGROUP} -m \
+- -s /bin/bash -d "$\{REPO%/*\}" {$PROJECTUSER}
+- fi
++ pw useradd {$PROJECTUSER} -u 901 -g {$PROJECTGROUP} -h - \
++ -s "/bin/bash" -d "$\{REPO%/*\}" -c "FOSSology user"
+ if [ "$?" != "0" ] ; then
+ echo "ERROR: Unable to create user '{$PROJECTUSER}'"
+ exit 1
+@@ -284,19 +265,12 @@
+ echo "*** Setting up the web interface ***"
+
+ # See if web server user exists, if so add to the group.
+- # check for www-data (Debian, etc)
+- grep -q "^www-data:" /etc/passwd
+- if [ $? == 0 ] ; then
+- echo "NOTE: Adding user www-data to group {$PROJECTGROUP}"
+- # this is smart enough to not add multiple times so it's ok to repeat
+- usermod -G {$PROJECTGROUP} -a www-data
+- fi
+- # check for apache (RHEL/CentOS, etc)
+- grep -q "^apache:" /etc/passwd
++ # check for www (FreeBSD)
++ grep -q "^www:" /etc/passwd
+ if [ $? == 0 ] ; then
+- echo "NOTE: Adding user apache to group {$PROJECTGROUP}"
++ echo "NOTE: Adding user www to group {$PROJECTGROUP}"
+ # this is smart enough to not add multiple times so it's ok to repeat
+- usermod -G {$PROJECTGROUP} -a apache
++ pw groupmod {$PROJECTGROUP} -m www
+ fi
+
+ fi # end of WEBONLY
==== //depot/projects/soc2008/alepulver-portslicense/ports/devel/fossology/files/patch-db__dbcreate.in#2 (text+ko) ====
==== //depot/projects/soc2008/alepulver-portslicense/ports/devel/fossology/files/patch-scheduler__mkschedconf.c#2 (text+ko) ====
@@ -1,15 +1,6 @@
---- ./scheduler/mkschedconf.c.orig 2008-10-07 19:22:46.000000000 +0000
-+++ ./scheduler/mkschedconf.c 2009-06-12 02:39:56.000000000 +0000
-@@ -81,7 +81,7 @@
- memset(Cmd,'\0',sizeof(Cmd));
- RepPath = RepGetRepPath();
- snprintf(Cmd,sizeof(Cmd)-1,Rcmd,"%s/engine-shell unpack '%s/ununpack -d %s/ununpack/%s -qRCQx'");
-- fprintf(Fout,Cmd,AGENTDIR,AGENTDIR,RepPath,"%{U}");
-+ fprintf(Fout,Cmd,AGENTDIR,AGENTDIR,RepPath,"%%{U}");
- fprintf(Fout,"\n");
- free(RepPath);
-
-@@ -180,7 +180,7 @@
+--- scheduler/mkschedconf.c.orig 2009-07-09 23:04:45.000000000 +0000
++++ scheduler/mkschedconf.c 2009-07-14 01:45:35.000000000 +0000
+@@ -180,14 +180,14 @@
/** fosscp **/
fprintf(Fout,"agent=fosscp_agent %s| ",CmdHost);
memset(Cmd,'\0',sizeof(Cmd));
@@ -18,3 +9,11 @@
fprintf(Fout,Cmd,AGENTDIR,BINDIR);
fprintf(Fout,"\n");
+ /** notify **/
+ fprintf(Fout,"agent=fo_notify %s| ",CmdHost);
+ memset(Cmd,'\0',sizeof(Cmd));
+- snprintf(Cmd,sizeof(Cmd)-1,Rcmd,"%s/engine-shell fo_notify '%s/fo_notify %{*}'");
++ snprintf(Cmd,sizeof(Cmd)-1,Rcmd,"%s/engine-shell fo_notify '%s/fo_notify %%{*}'");
+ fprintf(Fout,Cmd,AGENTDIR,BINDIR);
+ fprintf(Fout,"\n");
+
==== //depot/projects/soc2008/alepulver-portslicense/ports/devel/fossology/files/patch-scheduler__selftest.c#2 (text+ko) ====
==== //depot/projects/soc2008/alepulver-portslicense/ports/devel/fossology/files/pkg-message.in#4 (text+ko) ====
@@ -41,6 +41,11 @@
# %%PREFIX%%/lib/fossology/fo-postinstall
+ IMPORTANT: if you have the web server running, you must restart it
+ because the "www" user has been added to the "fossy" group. Without
+ this you will get a "Permission denied" when accessing
+ "http://localhost/repo/".
+
7. Enable at startup, add the following line to /etc/rc.conf:
fossology_enable="YES"
==== //depot/projects/soc2008/alepulver-portslicense/ports/devel/fossology/pkg-plist#4 (text+ko) ====
@@ -1,5 +1,6 @@
bin/cp2foss
bin/departition
+bin/fo_notify
bin/fossinit
bin/fossjobs
bin/fosslic
@@ -38,6 +39,7 @@
lib/fossology/dbcheck
lib/fossology/dbcreate
lib/fossology/fo-postinstall
+lib/fossology/fo_watchdog
lib/fossology/fossology-scheduler
lib/fossology/fossologyinit.sql
lib/fossology/mkschedconf
@@ -191,6 +193,8 @@
%%DATADIR%%/agents/licenses/CDDL/CDDL v1.0.meta
%%DATADIR%%/agents/licenses/CPAL/CPAL v1.0
%%DATADIR%%/agents/licenses/CPAL/CPAL v1.0.meta
+%%DATADIR%%/agents/licenses/CPL/Common Public License v0.5
+%%DATADIR%%/agents/licenses/CPL/Common Public License v0.5.meta
%%DATADIR%%/agents/licenses/CPL/Common Public License v1.0
%%DATADIR%%/agents/licenses/CPL/Common Public License v1.0.meta
%%DATADIR%%/agents/licenses/CPL/IBM/IBM_PL/IBM Public License v1.0
@@ -229,10 +233,12 @@
%%DATADIR%%/agents/licenses/Corporate/IBM/IBM JRE.meta
%%DATADIR%%/agents/licenses/Corporate/IBM/IBM reciprocal
%%DATADIR%%/agents/licenses/Corporate/IBM/IBM reciprocal.meta
-%%DATADIR%%/agents/licenses/Corporate/Intel
-%%DATADIR%%/agents/licenses/Corporate/Intel reference
-%%DATADIR%%/agents/licenses/Corporate/Intel reference.meta
-%%DATADIR%%/agents/licenses/Corporate/Intel.meta
+%%DATADIR%%/agents/licenses/Corporate/Intel/Intel
+%%DATADIR%%/agents/licenses/Corporate/Intel/Intel reference
+%%DATADIR%%/agents/licenses/Corporate/Intel/Intel reference.meta
+%%DATADIR%%/agents/licenses/Corporate/Intel/Intel-BSD
+%%DATADIR%%/agents/licenses/Corporate/Intel/Intel-BSD.meta
+%%DATADIR%%/agents/licenses/Corporate/Intel/Intel.meta
%%DATADIR%%/agents/licenses/Corporate/Logica/Logica Open Source License v1.0
%%DATADIR%%/agents/licenses/Corporate/Logica/Logica Open Source License v1.0.meta
%%DATADIR%%/agents/licenses/Corporate/Lucent/Lucent Public License v1.0
@@ -255,6 +261,8 @@
%%DATADIR%%/agents/licenses/Corporate/Microsoft/Microsoft Reciprocal License.meta
%%DATADIR%%/agents/licenses/Corporate/Microsoft/Microsoft Reference License
%%DATADIR%%/agents/licenses/Corporate/Microsoft/Microsoft Reference License.meta
+%%DATADIR%%/agents/licenses/Corporate/Microsoft/Microsoft SDK EULA
+%%DATADIR%%/agents/licenses/Corporate/Microsoft/Microsoft SDK EULA.meta
%%DATADIR%%/agents/licenses/Corporate/Microsoft/Microsoft Shared Source License
%%DATADIR%%/agents/licenses/Corporate/Microsoft/Microsoft Shared Source License.meta
%%DATADIR%%/agents/licenses/Corporate/Motorola
@@ -275,12 +283,12 @@
%%DATADIR%%/agents/licenses/Corporate/Nvidia/Nvidia Source Code.meta
%%DATADIR%%/agents/licenses/Corporate/RSA/RSA-Security
%%DATADIR%%/agents/licenses/Corporate/RSA/RSA-Security.meta
-%%DATADIR%%/agents/licenses/Corporate/SGI/Free Software License B v1.0
-%%DATADIR%%/agents/licenses/Corporate/SGI/Free Software License B v1.0.meta
-%%DATADIR%%/agents/licenses/Corporate/SGI/Free Software License B v1.1
-%%DATADIR%%/agents/licenses/Corporate/SGI/Free Software License B v1.1.meta
%%DATADIR%%/agents/licenses/Corporate/SGI/SGI CID v1.0
%%DATADIR%%/agents/licenses/Corporate/SGI/SGI CID v1.0.meta
+%%DATADIR%%/agents/licenses/Corporate/SGI/SGI FSL B v1.0
+%%DATADIR%%/agents/licenses/Corporate/SGI/SGI FSL B v1.0.meta
+%%DATADIR%%/agents/licenses/Corporate/SGI/SGI FSL B v1.1
+%%DATADIR%%/agents/licenses/Corporate/SGI/SGI FSL B v1.1.meta
%%DATADIR%%/agents/licenses/Corporate/SGI/SGI GLX v1.0
%%DATADIR%%/agents/licenses/Corporate/SGI/SGI GLX v1.0.meta
%%DATADIR%%/agents/licenses/Corporate/Skype
@@ -497,8 +505,6 @@
%%DATADIR%%/agents/licenses/GPL/v2/GPL v2 Preamble
%%DATADIR%%/agents/licenses/GPL/v2/GPL v2 Preamble.meta
%%DATADIR%%/agents/licenses/GPL/v2/GPL v2 reference
-%%DATADIR%%/agents/licenses/GPL/v2/GPL v2 reference 1
-%%DATADIR%%/agents/licenses/GPL/v2/GPL v2 reference 1.meta
%%DATADIR%%/agents/licenses/GPL/v2/GPL v2 reference 2
%%DATADIR%%/agents/licenses/GPL/v2/GPL v2 reference 2.meta
%%DATADIR%%/agents/licenses/GPL/v2/GPL v2 reference 3
@@ -516,6 +522,8 @@
%%DATADIR%%/agents/licenses/GPL/v2/GPL v2 reference 9
%%DATADIR%%/agents/licenses/GPL/v2/GPL v2 reference 9.meta
%%DATADIR%%/agents/licenses/GPL/v2/GPL v2 reference.meta
+%%DATADIR%%/agents/licenses/GPL/v2/GPL v2+ reference 1
+%%DATADIR%%/agents/licenses/GPL/v2/GPL v2+ reference 1.meta
%%DATADIR%%/agents/licenses/GPL/v2/GPL v2.meta
%%DATADIR%%/agents/licenses/GPL/v2/McKornik Jr. Public License
%%DATADIR%%/agents/licenses/GPL/v2/McKornik Jr. Public License.meta
@@ -767,6 +775,8 @@
%%DATADIR%%/agents/licenses/RedHat/Red Hat EULA.meta
%%DATADIR%%/agents/licenses/RedHat/Red Hat reference
%%DATADIR%%/agents/licenses/RedHat/Red Hat reference.meta
+%%DATADIR%%/agents/licenses/RedHat/eCos v1.1
+%%DATADIR%%/agents/licenses/RedHat/eCos v1.1.meta
%%DATADIR%%/php/pathinclude.php
%%DATADIR%%/www/common/common-active.php
%%DATADIR%%/www/common/common-agents.php
@@ -921,6 +931,7 @@
@dirrm %%DATADIR%%/agents/licenses/Corporate/Microsoft
@dirrm %%DATADIR%%/agents/licenses/Corporate/Lucent
@dirrm %%DATADIR%%/agents/licenses/Corporate/Logica
+ at dirrm %%DATADIR%%/agents/licenses/Corporate/Intel
@dirrm %%DATADIR%%/agents/licenses/Corporate/IBM
@dirrm %%DATADIR%%/agents/licenses/Corporate/Helix
@dirrm %%DATADIR%%/agents/licenses/Corporate/HP
@@ -951,6 +962,7 @@
@dirrm %%DATADIR%%/agents/licenses/AFL
@dirrm %%DATADIR%%/agents/licenses
@dirrm %%DATADIR%%/agents
- at dirrm %%DATADIR%%
+ at unexec rmdir %D/%%DATADIR%% >/dev/null || echo "If you are permanently removing FOSSology, please manually remove the repository files in \"%D/%%DATADIR%%\"." | fmt
%%PORTDOCS%%@dirrm %%DOCSDIR%%
- at dirrm %%ETCDIR%%
+ at dirrm lib/fossology/agents
+ at dirrm lib/fossology
More information about the p4-projects
mailing list