summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authoradrianp <adrianp@pkgsrc.org>2005-10-23 17:45:39 +0000
committeradrianp <adrianp@pkgsrc.org>2005-10-23 17:45:39 +0000
commitf279a1edea3ce940a0203d1670d2273df8777618 (patch)
tree5ea6b2bc218058804a7005d59e6b2832a8c904f9 /security
parentf1f54f685343896f087023e6c031b30ca48d9789 (diff)
downloadpkgsrc-f279a1edea3ce940a0203d1670d2273df8777618.tar.gz
Install the index file for the www server
Don't run as root Bump to nb3
Diffstat (limited to 'security')
-rw-r--r--security/pks/Makefile74
-rw-r--r--security/pks/files/pksd.sh14
2 files changed, 60 insertions, 28 deletions
diff --git a/security/pks/Makefile b/security/pks/Makefile
index c91a4065940..f4029c8d602 100644
--- a/security/pks/Makefile
+++ b/security/pks/Makefile
@@ -1,25 +1,48 @@
-# $NetBSD: Makefile,v 1.18 2005/04/11 21:47:17 tv Exp $
-
-DISTNAME= pks-0.9.4
-PKGREVISION= 2
-CATEGORIES= security www
-MASTER_SITES+= http://www.mit.edu/people/marc/pks/ \
- ftp://ftp.neonramp.com/pub/pksd/
-
-PATCH_SITES= http://www.mit.edu/people/marc/pks/ \
- ftp://ftp.neonramp.com/pub/pksd/
-PATCHFILES= pks094-patch2 \
- pks094-patch3
+# $NetBSD: Makefile,v 1.19 2005/10/23 17:45:39 adrianp Exp $
+
+DISTNAME= pks-0.9.4
+PKGREVISION= 3
+CATEGORIES= security www
+MASTER_SITES+= http://www.mit.edu/people/marc/pks/ \
+ ftp://ftp.neonramp.com/pub/pksd/
+
+PATCH_SITES= http://www.mit.edu/people/marc/pks/ \
+ ftp://ftp.neonramp.com/pub/pksd/
+PATCHFILES= pks094-patch2 \
+ pks094-patch3
PATCH_DIST_STRIP= -p1
-MAINTAINER= burgess@neonramp.com
-HOMEPAGE= http://www.mit.edu/people/marc/pks/
-COMMENT= PGP Public Key Server
+MAINTAINER= burgess@neonramp.com
+HOMEPAGE= http://www.mit.edu/people/marc/pks/
+COMMENT= PGP Public Key Server
+
+USE_PKGINSTALL= YES
+GNU_CONFIGURE= YES
+
+PKS_USER= pks
+PKS_GROUP= pks
+PKS_SERVER?= localhost
+PKS_HOME= ${VARBASE}/pks
+
+PKG_USERS= ${PKS_USER}:${PKS_GROUP}::PGP\ Key\ Server:${PKS_HOME}
+
+BDB_ACCEPTED= db2
+
+BUILD_DEFS+= PKS_SERVER
+
+EGDIR= ${PREFIX}/share/examples
+CONF_FILES= ${EGDIR}/pksd.conf ${PKG_SYSCONFDIR}/pksd.conf
+RCD_SCRIPTS= pksd
+
+FILES_SUBST+= PKS_USER=${PKS_USER}
+FILES_SUBST+= PKS_GROUP=${PKS_GROUP}
+
+OWN_DIRS_PERMS+= ${PKS_HOME} ${PKS_USER} ${PKS_GROUP} 0770
+OWN_DIRS_PERMS+= ${PKS_HOME}/db ${PKS_USER} ${PKS_GROUP} 0770
+OWN_DIRS_PERMS+= ${PKS_HOME}/incoming ${PKS_USER} ${PKS_GROUP} 0770
-USE_PKGINSTALL= YES
-GNU_CONFIGURE= YES
CONFIGURE_ARGS+= --datadir=${PREFIX}/share/pks
-CONFIGURE_ARGS+= --localstatedir=${VARBASE}/pks
+CONFIGURE_ARGS+= --localstatedir=${PKS_HOME}
#
# pksd doesn't actually look for its config file anywhere; it must be
# specified directly on the command-line. Setting sysconfdir here just
@@ -27,10 +50,17 @@ CONFIGURE_ARGS+= --localstatedir=${VARBASE}/pks
#
CONFIGURE_ARGS+= --sysconfdir=${EGDIR}
-EGDIR= ${PREFIX}/share/examples
-CONF_FILES= ${EGDIR}/pksd.conf ${PKG_SYSCONFDIR}/pksd.conf
-RCD_SCRIPTS= pksd
-OWN_DIRS= /var/pks /var/pks/db /var/pks/incoming
+SUBST_CLASSES= paths
+SUBST_MESSAGE.paths= "Fixing hardcoded paths."
+SUBST_STAGE.paths= post-patch
+SUBST_FILES.paths= pks-commands.html
+SUBST_SED.paths= -e "s|localhost|${PKS_SERVER}|g"
.include "../../databases/db/buildlink3.mk"
+
+post-install:
+ ${INSTALL_DATA} ${WRKSRC}/pks-commands.html ${PKS_HOME}/db/index.html
+ @${CHOWN} ${PKS_USER} ${PKS_HOME}/db/index.html
+ @${CHGRP} ${PKS_GROUP} ${PKS_HOME}/db/index.html
+
.include "../../mk/bsd.pkg.mk"
diff --git a/security/pks/files/pksd.sh b/security/pks/files/pksd.sh
index 21d9334d45f..ca5f6901732 100644
--- a/security/pks/files/pksd.sh
+++ b/security/pks/files/pksd.sh
@@ -1,6 +1,6 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: pksd.sh,v 1.7 2002/09/20 02:02:00 grant Exp $
+# $NetBSD: pksd.sh,v 1.8 2005/10/23 17:45:39 adrianp Exp $
#
# PROVIDE: pksd
# REQUIRE: DAEMON
@@ -21,17 +21,19 @@ client_command="@PREFIX@/bin/pksclient"
conf_file="@PKG_SYSCONFDIR@/${name}.conf"
required_files="${conf_file}"
extra_commands="dbinit"
+pksd_user="@PKS_USER@"
+pksd_group="@PKS_GROUP@"
pksd_dbinit()
{
(
- umask 022
+ umask 007
if [ -r ${conf_file} ]
then
dbdir=`@AWK@ '/db_dir/ { print $2 }' < ${conf_file}`
if [ ! -f ${dbdir}/keydb000 -a -x ${client_command} ]
then
- ${client_command} ${dbdir} create
+ @SU@ -m ${pksd_user} -c "${client_command} ${dbdir} create"
fi
fi
)
@@ -43,9 +45,9 @@ pksd_start()
then
@ECHO@ "Starting ${name} (local)."
@ECHO@ "${command} ${conf_file}"
- ${command} ${conf_file} &
+ @SU@ -m ${pksd_user} -c "${command} ${conf_file} &"
sleep 5
- ${run_command} ${conf_file}
+ @SU@ -m ${pksd_user} -c "${run_command} ${conf_file}"
fi
}
@@ -57,7 +59,7 @@ pksd_stop()
if [ -S ${socket} ]
then
@ECHO@ "Stopping ${name} (local)."
- ${ctl_command} ${socket} shutdown
+ @SU@ -m ${pksd_user} -c "${ctl_command} ${socket} shutdown"
fi
fi
}