aboutsummaryrefslogtreecommitdiffstats
path: root/databases
diff options
context:
space:
mode:
authorpst <pst@FreeBSD.org>1998-01-25 06:17:15 +0800
committerpst <pst@FreeBSD.org>1998-01-25 06:17:15 +0800
commitee2c46312eb213811d06e3c77635facd7d696e7c (patch)
tree8ad6dc94c9dd65c0b3d87c4b4543d49c66bc9895 /databases
parentdc2ffde0ffd9ef20d95e04439085449342817a2c (diff)
downloadfreebsd-ports-gnome-ee2c46312eb213811d06e3c77635facd7d696e7c.tar.gz
freebsd-ports-gnome-ee2c46312eb213811d06e3c77635facd7d696e7c.tar.zst
freebsd-ports-gnome-ee2c46312eb213811d06e3c77635facd7d696e7c.zip
Make gnats port to package cleanly.
PR: 5506 Submitted by: Jun Kuriyama
Diffstat (limited to 'databases')
-rw-r--r--databases/gnats/Makefile11
-rw-r--r--databases/gnats/files/patch-aa10
-rw-r--r--databases/gnats/pkg-descr5
-rw-r--r--databases/gnats/pkg-install95
-rw-r--r--databases/gnats/pkg-message2
-rw-r--r--databases/gnats/pkg-plist19
6 files changed, 134 insertions, 8 deletions
diff --git a/databases/gnats/Makefile b/databases/gnats/Makefile
index b824b967d572..e70525e7dba8 100644
--- a/databases/gnats/Makefile
+++ b/databases/gnats/Makefile
@@ -3,7 +3,7 @@
# Date created: 10 November 1995
# Whom: pst
#
-# $Id: Makefile,v 1.13 1997/06/30 07:11:02 peter Exp $
+# $Id: Makefile,v 1.14 1997/08/26 22:29:48 pst Exp $
#
DISTNAME= gnats-3.104-beta
@@ -15,7 +15,6 @@ MAINTAINER= pst@FreeBSD.org
BUILD_DEPENDS= gm4:${PORTSDIR}/devel/m4
-NO_PACKAGE= "Requires gnats UID"
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --prefix=${PREFIX} \
--with-lispdir=${PREFIX}/share/emacs/site-lisp \
@@ -38,8 +37,16 @@ post-build:
(cd ${WRKSRC}/gnats; ${MAKE} info)
(cd ${WRKSRC}/send-pr; ${MAKE} info)
+pre-install:
+ @PKG_PREFIX=${PREFIX} ${SH} ${PKGDIR}/INSTALL ${PKGNAME} PRE-INSTALL
+
post-install:
(cd ${WRKSRC}/gnats; ${MAKE} install-info)
(cd ${WRKSRC}/send-pr; ${MAKE} install-info)
+ if [ ! -f ${PREFIX}/info/dir ]; then \
+ sed -ne '1,/Menu:/p' /usr/share/info/dir > ${PREFIX}/info/dir; \
+ fi
+ install-info ${PREFIX}/info/gnats.info ${PREFIX}/info/dir
+ install-info ${PREFIX}/info/send-pr.info ${PREFIX}/info/dir
.include <bsd.port.mk>
diff --git a/databases/gnats/files/patch-aa b/databases/gnats/files/patch-aa
index ee1ec7110abc..b24f49ad4d75 100644
--- a/databases/gnats/files/patch-aa
+++ b/databases/gnats/files/patch-aa
@@ -1,8 +1,18 @@
Use the FSF m4 instead of the BSD m4, because the BSD m4 is reporting problems
processing config.c.in.
+Strip binaries at install.
--- Makefile.in Mon Aug 18 14:52:43 1997
+++ Makefile.in Tue Aug 26 14:14:44 1997
+@@ -47,7 +47,7 @@
+
+ # INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a
+ # cygwin32 host.
+-INSTALL_PROGRAM_ARGS =
++INSTALL_PROGRAM_ARGS = -s
+
+ INSTALL = $(SHELL) $$s/install-sh -c
+ INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS)
@@ -68,7 +68,7 @@
HOST_PREFIX_1 = loser-
diff --git a/databases/gnats/pkg-descr b/databases/gnats/pkg-descr
index ad6898e03e16..326bdb31b704 100644
--- a/databases/gnats/pkg-descr
+++ b/databases/gnats/pkg-descr
@@ -27,7 +27,8 @@ distribution and all its components.
*** FreeBSD note:
*** You will want to add a user entry to your /etc/passwd file for the
*** user-id that owns gnats-related databases on your server.
-*** Something of the form: "gnats:*:70:70:GNATS Owner:/usr/local/lib/gnats:"
+*** Something of the form:
+*** "gnats:*:61:61:GNATS database owner:/usr/local/share/gnats/gnats-db:"
*** should do just fine (put it in your ftpusers file!).
***
-*** Don't forget to run /usr/local/lib/gnats/mkcat as gnats.
+*** Don't forget to run /usr/local/libexec/gnats/mkcat as gnats.
diff --git a/databases/gnats/pkg-install b/databases/gnats/pkg-install
new file mode 100644
index 000000000000..eb9cac52e0b5
--- /dev/null
+++ b/databases/gnats/pkg-install
@@ -0,0 +1,95 @@
+#!/bin/sh
+# an installation script for GNATS
+
+check_pw()
+{
+ if which -s pw; then
+ :
+ else
+ cat <<EOF
+
+This system looks like a pre-2.2 version of FreeBSD. We see that it
+is missing the "pw" utility. We need this utility. Please get and
+install it, and try again. You can get the source from:
+
+ ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/usr.sbin/pw.tar.gz
+
+Otherwise, just manually create the gnats user.
+
+EOF
+ exit 1
+ fi
+}
+
+ask() {
+ local question default answer
+
+ question=$1
+ default=$2
+ if [ -z "${PACKAGE_BUILDING}" ]; then
+ read -p "${question} (y/n) [${default}]? " answer
+ fi
+ if [ x${answer} = x ]; then
+ answer=${default}
+ fi
+ echo ${answer}
+}
+
+yesno() {
+ local dflt question answer
+
+ question=$1
+ dflt=$2
+ while :; do
+ answer=$(ask "${question}" "${dflt}")
+ case "${answer}" in
+ [Yy]*) return 0;;
+ [Nn]*) return 1;;
+ esac
+ echo "Please answer yes or no."
+ done
+}
+
+case $2 in
+PRE-INSTALL)
+printenv > /tmp/pe
+ ## Hack /etc/master.passwd ##
+ # check
+ id_61=`id -u 61 2> /dev/null`
+ id_gnats=`id -u gnats 2> /dev/null`
+ if [ X"$id_gnats" != X ];then
+ exit 0
+ elif [ X"$id_61" != X ]; then
+ cat <<EOF
+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+This system already has an account whose name is not 'gnats' and UID
+number is 61.
+
+ '`id 61`'
+
+The new FreeBSD standard userid for the gnats user is 61, however you can
+actually pick and UID number if you create the 'gnats' user by hand.
+
+Please try to install this package again after you manually create a 'gnats'
+account.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+EOF
+ exit 1
+ fi
+
+ # add an account 'gnats' to this system
+ echo ""
+ echo "You need to create a user called 'gnats'"
+ if yesno "Would you like to create it automatically?" y; then
+ # We need a command 'pw(8)'
+ check_pw
+ pw useradd gnats -u 61 -g 1 -h - -d ${PKG_PREFIX}/share/gnats/gnats-db \
+ -c 'GNATS database owner' || exit
+ grep -s gnats /etc/ftpusers || echo gnats >>/etc/ftpusers
+ else
+ echo "Please create it, and try again."
+ exit 1
+ fi
+ ;;
+esac
diff --git a/databases/gnats/pkg-message b/databases/gnats/pkg-message
index cf9840d53223..de4545f8512b 100644
--- a/databases/gnats/pkg-message
+++ b/databases/gnats/pkg-message
@@ -1 +1 @@
-Don't forget to run /usr/local/lib/gnats/mkcat as gnats.
+Don't forget to run /usr/local/libexec/gnats/mkcat as gnats.
diff --git a/databases/gnats/pkg-plist b/databases/gnats/pkg-plist
index 59bd0f3b5e74..3dcc9f71072c 100644
--- a/databases/gnats/pkg-plist
+++ b/databases/gnats/pkg-plist
@@ -6,12 +6,17 @@ bin/nquery-pr
bin/query-pr
bin/send-pr
bin/sub-type
+@unexec install-info --delete %D/info/gnats.info %D/info/dir
+@unexec install-info --delete %D/info/send-pr.info %D/info/dir
info/gnats.info
info/gnats.info-1
info/gnats.info-2
info/gnats.info-3
info/gnats.info-4
info/send-pr.info
+@exec [ -f %D/info/dir ] || sed -ne '1,/Menu://' /usr/share/info/dir > %D/info/dir
+@exec install-info %D/info/gnats.info %D/info/dir
+@exec install-info %D/info/send-pr.info %D/info/dir
libexec/gnats/at-pr
libexec/gnats/file-pr
libexec/gnats/gen-index
@@ -26,6 +31,7 @@ libexec/gnats/pr-edit
libexec/gnats/pr-mail
libexec/gnats/queue-pr
libexec/gnats/rmcat
+@dirrm libexec/gnats
man/man1/edit-pr.1.gz
man/man1/gnats.1.gz
man/man1/query-pr.1.gz
@@ -37,7 +43,6 @@ man/man8/mkdist.8.gz
man/man8/queue-pr.8.gz
man/man8/rmcat.8.gz
share/emacs/site-lisp/gnats.el
-share/emacs/site-lisp/gnats.elc
share/emacs/site-lisp/send-pr.el
share/gnats/cygnus
share/gnats/dist/COPYING
@@ -55,10 +60,18 @@ share/gnats/dist/send-pr.sh
share/gnats/dist/send-pr.texi
share/gnats/dist/states.texi
share/gnats/dist/texinfo.tex
+share/gnats/dist/version.texi
share/gnats/gnats-db/gnats-adm/categories
share/gnats/gnats-db/gnats-adm/config
share/gnats/gnats-db/gnats-adm/gnatsd.conf
share/gnats/gnats-db/gnats-adm/responsible
share/gnats/gnats-db/gnats-adm/submitters
-share/gnats/gnats-db/gnats-queue
-share/gnats/gnats-db/pending
+@exec mkdir %D/share/gnats/gnats-db/gnats-queue
+@exec mkdir %D/share/gnats/gnats-db/pending
+@exec chown gnats %D/share/gnats/gnats-db %D/share/gnats/gnats-db/gnats-adm %D/share/gnats/gnats-db/pending %D/share/gnats/gnats-db/gnats-queue
+@dirrm share/gnats/gnats-db/gnats-adm
+@dirrm share/gnats/gnats-db/gnats-queue
+@dirrm share/gnats/gnats-db/pending
+@dirrm share/gnats/gnats-db
+@dirrm share/gnats/dist
+@dirrm share/gnats