aboutsummaryrefslogtreecommitdiffstats
path: root/www/c-icap/files
diff options
context:
space:
mode:
authormm <mm@FreeBSD.org>2012-08-15 08:09:41 +0800
committermm <mm@FreeBSD.org>2012-08-15 08:09:41 +0800
commitc6a0677144d1a01df5ba8e29d33ca335a509eae9 (patch)
tree6706e5b9ed6ef076bf52f8b826ded9ac2228dd9f /www/c-icap/files
parent202737c9e9bccc8e536e3a70841078bd639800b3 (diff)
downloadfreebsd-ports-gnome-c6a0677144d1a01df5ba8e29d33ca335a509eae9.tar.gz
freebsd-ports-gnome-c6a0677144d1a01df5ba8e29d33ca335a509eae9.tar.zst
freebsd-ports-gnome-c6a0677144d1a01df5ba8e29d33ca335a509eae9.zip
Update c-icap to 0.2.1
PR: ports/170121 Approved by: maintainer (timeout)
Diffstat (limited to 'www/c-icap/files')
-rw-r--r--www/c-icap/files/c-icap.in (renamed from www/c-icap/files/c_icap.in)17
-rw-r--r--www/c-icap/files/patch-Makefile.in17
-rw-r--r--www/c-icap/files/patch-c-icap.conf.in13
-rw-r--r--www/c-icap/files/patch-configure32
-rw-r--r--www/c-icap/files/patch-configure.in32
-rw-r--r--www/c-icap/files/pkg-deinstall.in23
-rw-r--r--www/c-icap/files/pkg-install.in44
7 files changed, 37 insertions, 141 deletions
diff --git a/www/c-icap/files/c_icap.in b/www/c-icap/files/c-icap.in
index 0628f4f0cc4a..45091b901100 100644
--- a/www/c-icap/files/c_icap.in
+++ b/www/c-icap/files/c-icap.in
@@ -18,18 +18,27 @@
. /etc/rc.subr
-name="c_icap"
+name=c_icap
rcvar=c_icap_enable
command="%%PREFIX%%/bin/c-icap"
-pidfile="%%RUN_DIR%%/c-icap.pid"
-required_dirs="%%TMP_DIR%%"
-required_files="%%PREFIX%%/etc/c-icap.conf"
stop_postcmd="rm -f $pidfile"
# read settings, set default values
load_rc_config "$name"
: ${c_icap_enable="NO"}
+: ${c_icap_conf="%%PREFIX%%/etc/c-icap.conf"}
+: ${c_icap_pidfile="%%RUN_DIR%%/c-icap.pid"}
+: ${c_icap_user="%%CICAP_USER%%"}
+
+pidfile="${c_icap_pidfile}"
+required_files="${c_icap_conf}"
+command_args="-f ${c_icap_conf}"
+stop_postcmd=stop_postcmd
+
+stop_postcmd() {
+ rm -f %%RUN_DIR%%/c-icap.ctl
+}
run_rc_command "$1"
diff --git a/www/c-icap/files/patch-Makefile.in b/www/c-icap/files/patch-Makefile.in
deleted file mode 100644
index 620a51f63bce..000000000000
--- a/www/c-icap/files/patch-Makefile.in
+++ /dev/null
@@ -1,17 +0,0 @@
---- Makefile.in.bak 2008-07-07 00:31:50.000000000 +0400
-+++ Makefile.in 2009-01-15 23:15:56.000000000 +0300
-@@ -1302,14 +1302,6 @@
- $(mkinstalldirs) $(DESTDIR)$(CONFIGDIR);
- $(INSTALL) c-icap.conf $(DESTDIR)$(CONFIGDIR)/c-icap.conf.default
- $(INSTALL) c-icap.magic $(DESTDIR)$(CONFIGDIR)/c-icap.magic.default
-- if test ! -f $(DESTDIR)$(CONFIGDIR)/c-icap.conf; then $(INSTALL) c-icap.conf $(DESTDIR)$(CONFIGDIR)/c-icap.conf; fi
-- if test ! -f $(DESTDIR)$(CONFIGDIR)/c-icap.magic; then $(INSTALL) c-icap.magic $(DESTDIR)$(CONFIGDIR)/c-icap.magic; fi
-- $(mkinstalldirs) $(DESTDIR)$(LOGDIR);
-- $(mkinstalldirs) $(DESTDIR)$(SOCKDIR);
-- chgrp nobody $(DESTDIR)$(LOGDIR)
-- chmod 775 $(DESTDIR)$(LOGDIR)
-- chgrp nobody $(DESTDIR)$(SOCKDIR)
-- chmod 775 $(DESTDIR)$(SOCKDIR)
- # Tell versions [3.59,3.63) of GNU make to not export all variables.
- # Otherwise a system limit (for SysV at least) may be exceeded.
- .NOEXPORT:
diff --git a/www/c-icap/files/patch-c-icap.conf.in b/www/c-icap/files/patch-c-icap.conf.in
deleted file mode 100644
index b8b137345d2b..000000000000
--- a/www/c-icap/files/patch-c-icap.conf.in
+++ /dev/null
@@ -1,13 +0,0 @@
---- c-icap.conf.in.bak Wed Mar 29 08:24:29 2006
-+++ c-icap.conf.in Wed Mar 29 08:25:58 2006
-@@ -28,8 +28,8 @@
- TmpDir /var/tmp
- MaxMemObject 131072
-
--ServerLog @prefix@/var/log/server.log
--AccessLog @prefix@/var/log/access.log
-+ServerLog /var/log/c_icap/server.log
-+AccessLog /var/log/c_icap/access.log
- #DebugLevel 3
-
- ModulesDir @prefix@/lib/c_icap
diff --git a/www/c-icap/files/patch-configure b/www/c-icap/files/patch-configure
deleted file mode 100644
index 3232def2b30a..000000000000
--- a/www/c-icap/files/patch-configure
+++ /dev/null
@@ -1,32 +0,0 @@
---- configure.orig Mon Jul 7 00:22:15 2008
-+++ configure Tue Nov 18 21:51:12 2008
-@@ -20258,7 +20258,7 @@
- THREADS_LDADD="-lpthread"
- THREADS_LDFLAGS=""
- ;;
-- freebsd5*)
-+ freebsd[45]*)
- ## If I understand how all those threading models works correctly
- ## in FreeBSD I will make an option in configure script
- ## --with-freebsd-threads={c_r,pthreads,linuxthreads,thr}
-@@ -20273,7 +20273,7 @@
-
- ## FreeBSD Standard threads
- CFLAGS="-pthread -D_THREAD_SAFE $CFLAGS"
-- THREADS_LDADD="-XCClinker -lc_r"
-+ THREADS_LDADD="-lc_r"
- THREADS_LDFLAGS=""
- ## FreeBSD has pthreads rwlocks from version 3 (I think)
- # AC_DEFINE(HAVE_PTHREADS_RWLOCK,1,[Define HAVE_PTHREADS_RWLOCK if pthreads library supports rwlocks])
-@@ -20284,9 +20284,9 @@
-
- ;;
-
-- freebsd6*)
-+ freebsd*)
- CFLAGS="-D_THREAD_SAFE $CFLAGS"
-- THREADS_LDADD="-XCClinker -lthr"
-+ THREADS_LDADD="-lthr"
- THREADS_LDFLAGS=""
- ;;
-
diff --git a/www/c-icap/files/patch-configure.in b/www/c-icap/files/patch-configure.in
deleted file mode 100644
index 3f25906179f2..000000000000
--- a/www/c-icap/files/patch-configure.in
+++ /dev/null
@@ -1,32 +0,0 @@
---- configure.in.orig Mon Jul 7 00:21:51 2008
-+++ configure.in Tue Nov 18 21:50:26 2008
-@@ -52,7 +52,7 @@
- THREADS_LDADD="-lpthread"
- THREADS_LDFLAGS=""
- ;;
-- freebsd5*)
-+ freebsd[[45]]*)
- ## If I understand how all those threading models works correctly
- ## in FreeBSD I will make an option in configure script
- ## --with-freebsd-threads={c_r,pthreads,linuxthreads,thr}
-@@ -67,7 +67,7 @@
-
- ## FreeBSD Standard threads
- CFLAGS="-pthread -D_THREAD_SAFE $CFLAGS"
-- THREADS_LDADD="-XCClinker -lc_r"
-+ THREADS_LDADD="-lc_r"
- THREADS_LDFLAGS=""
- ## FreeBSD has pthreads rwlocks from version 3 (I think)
- # AC_DEFINE(HAVE_PTHREADS_RWLOCK,1,[Define HAVE_PTHREADS_RWLOCK if pthreads library supports rwlocks])
-@@ -78,9 +78,9 @@
-
- ;;
-
-- freebsd6*)
-+ freebsd*)
- CFLAGS="-D_THREAD_SAFE $CFLAGS"
-- THREADS_LDADD="-XCClinker -lthr"
-+ THREADS_LDADD="-lthr"
- THREADS_LDFLAGS=""
- ;;
-
diff --git a/www/c-icap/files/pkg-deinstall.in b/www/c-icap/files/pkg-deinstall.in
index aabf042f9622..5a1224b02312 100644
--- a/www/c-icap/files/pkg-deinstall.in
+++ b/www/c-icap/files/pkg-deinstall.in
@@ -1,16 +1,29 @@
#!/bin/sh
# $FreeBSD$
+LOG_DIR=$DEST_DIR%%LOG_DIR%%
+RUN_DIR=$DEST_DIR%%RUN_DIR%%
+
if [ "$2" != "POST-DEINSTALL" ]; then
exit 0
fi
-CICAP_USER=cicap
+if [ -d "$LOG_DIR" ]; then
+ rmdir $LOG_DIR > /dev/null 2> /dev/null
+fi
+
+if [ -d "$RUN_DIR" ]; then
+ rmdir $RUN_DIR > /dev/null 2> /dev/null
+fi
-if pw usershow "$CICAP_USER" 2>/dev/null 1>&2; then
- echo "==============================================================================="
- echo "To delete $CICAP_USER user permanently, use 'pw userdel \"$CICAP_USER\"'"
- echo "==============================================================================="
+if [ -d "$LOG_DIR" -o -d "$RUN_DIR" ]; then
+ echo "You may want to delete the following directories:"
+ if [ -d "$LOG_DIR" ]; then
+ echo "$LOG_DIR"
+ fi
+ if [ -d "$RUN_DIR" ]; then
+ echo "$RUN_DIR"
+ fi
fi
exit 0
diff --git a/www/c-icap/files/pkg-install.in b/www/c-icap/files/pkg-install.in
index 8e73d8deb510..95a6851a776a 100644
--- a/www/c-icap/files/pkg-install.in
+++ b/www/c-icap/files/pkg-install.in
@@ -3,54 +3,22 @@
DEST_DIR=${PKG_DESTDIR:-}
-CICAP_USER=cicap
-CICAP_GROUP=cicap
+_USER=%%CICAP_USER%%
+_GROUP=%%CICAP_GROUP%%
LOG_DIR=$DEST_DIR%%LOG_DIR%%
-TMP_DIR=$DEST_DIR%%TMP_DIR%%
RUN_DIR=$DEST_DIR%%RUN_DIR%%
-if [ "$2" = "PRE-INSTALL" ]; then
- if ! pw groupshow "$CICAP_GROUP" 2>/dev/null 1>&2; then
- if pw groupadd $CICAP_GROUP; then
- echo "=> Added group \"$CICAP_GROUP\"."
- else
- echo "=> Adding group \"$CICAP_GROUP\" failed..."
- exit 1
- fi
- fi
-
- if ! pw usershow "$CICAP_USER" 2>/dev/null 1>&2; then
- if pw useradd $CICAP_USER -g $CICAP_GROUP -h - \
- -s "/sbin/nologin" -d "/nonexistent" \
- -c "c-icap daemon"; \
- then
- echo "=> Added user \"$CICAP_USER\"."
- else
- echo "=> Adding user \"$CICAP_USER\" failed..."
- exit 1
- fi
- fi
-elif [ "$2" = "POST-INSTALL" ]; then
- if [ ! -d "$LOG_DIR" ]; then
+if [ "$2" = "POST-INSTALL" ]; then
+ if [ ! -d "$LOG_DIR" ]; then
mkdir -p "$LOG_DIR" || exit 1
- chown -R "$CICAP_USER:$CICAP_GROUP" "$LOG_DIR" || exit 1
- fi
-
- if [ ! -d "$TMP_DIR" ]; then
- mkdir -p "$TMP_DIR" || exit 1
- chown "$CICAP_USER:$CICAP_GROUP" "$TMP_DIR" || exit 1
fi
if [ ! -d "$RUN_DIR" ]; then
mkdir -p "$RUN_DIR" || exit 1
- chown "$CICAP_USER:$CICAP_GROUP" "$RUN_DIR" || exit 1
- fi
-
- if [ ! -d "$RUN_DIR/c-icap" ]; then
- mkdir -p "$RUN_DIR/c-icap" || exit 1
- chown "$CICAP_USER:$CICAP_GROUP" "$RUN_DIR/c-icap" || exit 1
fi
+ chown -R "$_USER:$_GROUP" "$LOG_DIR" "$RUN_DIR" || exit 1
+ chmod 0750 "$LOG_DIR" "$RUN_DIR" || exit 1
fi
exit 0