aboutsummaryrefslogtreecommitdiff
path: root/devel/fossology
diff options
context:
space:
mode:
authorAlejandro Pulver <alepulver@FreeBSD.org>2009-07-30 15:47:03 +0000
committerAlejandro Pulver <alepulver@FreeBSD.org>2009-07-30 15:47:03 +0000
commit909e46d0c161839c718abaf36473e5adf0793dc3 (patch)
treeaa1622046a1d94bdd9654417c6b98a0a2af221c3 /devel/fossology
parent7715840c0789d1284d4b540915326c0d85b85b65 (diff)
downloadports-909e46d0c161839c718abaf36473e5adf0793dc3.tar.gz
ports-909e46d0c161839c718abaf36473e5adf0793dc3.zip
- Bump PORTREVISION.
- Should run fine in 8.x now (shm_open path now starts with a slash). - Avoid harmless rmdir error message when uninstalling. - Now runs from / instead of /var/tmp (as developers wanted).
Notes
Notes: svn path=/head/; revision=238680
Diffstat (limited to 'devel/fossology')
-rw-r--r--devel/fossology/Makefile14
-rw-r--r--devel/fossology/files/fossology.in6
-rw-r--r--devel/fossology/files/patch-scheduler__lockfs.c64
-rw-r--r--devel/fossology/pkg-plist2
4 files changed, 69 insertions, 17 deletions
diff --git a/devel/fossology/Makefile b/devel/fossology/Makefile
index 0fb0c1fbc353..e79204a5df4e 100644
--- a/devel/fossology/Makefile
+++ b/devel/fossology/Makefile
@@ -11,14 +11,13 @@
# archivers/rpm4 -> archivers/rpm2cpio
#
# TODO:
-# - 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.
+# - Add status command to rc.d script (run through "daemon -p ...")
# - Add crontab entry for postgres db optimizations?
#
PORTNAME= fossology
PORTVERSION= 1.1.0
+PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= SF
@@ -97,15 +96,6 @@ post-patch:
${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
-# 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
# Do not install init.d script (we use our own)
@${REINPLACE_CMD} -Ee 's|^(install: all) install-init|\1|' \
${WRKSRC}/scheduler/Makefile
diff --git a/devel/fossology/files/fossology.in b/devel/fossology/files/fossology.in
index c9565b27196a..5428bc97ff8b 100644
--- a/devel/fossology/files/fossology.in
+++ b/devel/fossology/files/fossology.in
@@ -25,10 +25,8 @@ stop_cmd="fossology_stop"
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}
+ ${SCHEDULER} -d -R
+ ${WATCHDOG}
}
fossology_stop()
diff --git a/devel/fossology/files/patch-scheduler__lockfs.c b/devel/fossology/files/patch-scheduler__lockfs.c
new file mode 100644
index 000000000000..84f89442d1c8
--- /dev/null
+++ b/devel/fossology/files/patch-scheduler__lockfs.c
@@ -0,0 +1,64 @@
+--- scheduler/lockfs.c.orig 2009-07-08 23:45:57.000000000 -0300
++++ scheduler/lockfs.c 2009-07-30 12:15:25.000000000 -0300
+@@ -32,6 +32,8 @@
+ #include "scheduler.h"
+ #include "logging.h"
+
++#define LOCK_PREFIX "/var/tmp"
++
+ /********************************************
+ LockGetPID() returns PID of process that
+ owns a lock (or zero if there is no lock).
+@@ -43,8 +45,11 @@
+ int Handle;
+ int rc;
+ char S[10];
++ char _lockfile[FILENAME_MAX];
++
++ snprintf(_lockfile, sizeof(_lockfile), "%s/%s", LOCK_PREFIX, ProcessName);
+
+- Handle = shm_open(ProcessName,O_RDONLY,0444);
++ Handle = shm_open(_lockfile,O_RDONLY,0444);
+ if (Handle < 0)
+ {
+ /* don't report error if lock file does not exist. That may be normal. */
+@@ -59,7 +64,7 @@
+ if (Pid < 2)
+ {
+ /* bogus pid can't be less than 2 digits, remove lockfile */
+- if (shm_unlink(ProcessName) == -1)
++ if (shm_unlink(_lockfile) == -1)
+ LogPrint("*** failed to remove invalid lock file for %s (see LockGetPID). %s\n", ProcessName, strerror(errno));
+ return(0);
+ }
+@@ -99,7 +104,11 @@
+ ********************************************/
+ int UnlockName (char *ProcessName)
+ {
+- return(shm_unlink(ProcessName));
++ char _lockfile[FILENAME_MAX];
++
++ snprintf(_lockfile, sizeof(_lockfile), "%s/%s", LOCK_PREFIX, ProcessName);
++
++ return(shm_unlink(_lockfile));
+ } /* UnlockName() */
+
+ /********************************************
+@@ -114,13 +123,16 @@
+ int rv;
+ pid_t Pid = 0;
+ char S[10];
++ char _lockfile[FILENAME_MAX];
++
++ snprintf(_lockfile, sizeof(_lockfile), "%s/%s", LOCK_PREFIX, ProcessName);
+
+ /* return if there is already a lock */
+ Pid = LockGetPID(ProcessName);
+ if (Pid) return (Pid);
+
+ /* No lock, so create the lock file */
+- Handle = shm_open(ProcessName,O_RDWR|O_CREAT|O_EXCL,0744);
++ Handle = shm_open(_lockfile,O_RDWR|O_CREAT|O_EXCL,0744);
+ if (-1 == Handle)
+ {
+ /* create failed */
diff --git a/devel/fossology/pkg-plist b/devel/fossology/pkg-plist
index e7ac5f5eab15..2097a33b886c 100644
--- a/devel/fossology/pkg-plist
+++ b/devel/fossology/pkg-plist
@@ -962,7 +962,7 @@ lib/libfossrepo.a
@dirrm %%DATADIR%%/agents/licenses/AFL
@dirrm %%DATADIR%%/agents/licenses
@dirrm %%DATADIR%%/agents
-@unexec rmdir %D/%%DATADIR%% >/dev/null || echo "If you are permanently removing FOSSology, please manually remove the repository files in \"%D/%%DATADIR%%\"." | fmt
+@unexec rmdir %D/%%DATADIR%% >/dev/null 2>&1 || echo "If you are permanently removing FOSSology, please manually remove the repository files in \"%D/%%DATADIR%%\"." | fmt
%%PORTDOCS%%@dirrm %%DOCSDIR%%
@dirrm lib/fossology/agents
@dirrm lib/fossology