Mon Nov 15 17:11:58 2021 UTC ()
{,standalone-,static-}tcsh: Add build options for nls and static. Cleanup.

For tcsh and defaults for other variants, unless otherwise noted:
- Option nls enables building of NLS catalogs. Enabled by default.
- Option static enables static linking. Disabled by default.

For standalone-tcsh:
- Option static is enabled by default, except on SunOS.
- Fix building of NLS catalogs, which possibly worked at some point
  in time given the existence of the NLSDIR variable in Makefile.
- Use PLIST from tcsh, with some awk to transform the entries.
- Use DESCR from tcsh as base, with an additional local DESCR. Adjust the
  local DESCR to not say that the package is static, as that is controlled
  by an option now (and never was true for all platforms).
- Remove unnecessary DISTINFO_FILE, INSTALLATION_DIRS, and WRKSRC.

For static-tcsh:
- Option static is not available: the package is always built like tcsh
  with the static option enabled.
- Remove unnecessary DISTINFO_FILE.


(kim)
diff -r1.3 -r1.4 pkgsrc/shells/standalone-tcsh/DESCR
diff -r1.34 -r1.35 pkgsrc/shells/standalone-tcsh/Makefile
diff -r1.5 -r0 pkgsrc/shells/standalone-tcsh/PLIST
diff -r0 -r1.1 pkgsrc/shells/standalone-tcsh/plist-examples.awk
diff -r0 -r1.1 pkgsrc/shells/standalone-tcsh/plist-nls.awk
diff -r1.13 -r1.14 pkgsrc/shells/static-tcsh/Makefile
diff -r1.101 -r1.102 pkgsrc/shells/tcsh/Makefile
diff -r1.1 -r1.2 pkgsrc/shells/tcsh/Makefile.common
diff -r1.5 -r1.6 pkgsrc/shells/tcsh/PLIST
diff -r0 -r1.1 pkgsrc/shells/tcsh/options.mk

cvs diff -r1.3 -r1.4 pkgsrc/shells/standalone-tcsh/DESCR (expand / switch to unified diff)

--- pkgsrc/shells/standalone-tcsh/DESCR 2004/01/11 23:06:54 1.3
+++ pkgsrc/shells/standalone-tcsh/DESCR 2021/11/15 17:11:57 1.4
@@ -1,5 +1,2 @@ @@ -1,5 +1,2 @@
1TCSH is an extended C-shell with many useful features like 
2filename completion, history editing, etc. 
3 1
4This version installs a statically-linked version of tcsh into 2This version installs tcsh into /bin, for use as a standalone shell.
5/bin, for use as a standalone shell. 

cvs diff -r1.34 -r1.35 pkgsrc/shells/standalone-tcsh/Makefile (expand / switch to unified diff)

--- pkgsrc/shells/standalone-tcsh/Makefile 2021/11/14 22:36:12 1.34
+++ pkgsrc/shells/standalone-tcsh/Makefile 2021/11/15 17:11:57 1.35
@@ -1,48 +1,48 @@ @@ -1,48 +1,48 @@
1# $NetBSD: Makefile,v 1.34 2021/11/14 22:36:12 kim Exp $ 1# $NetBSD: Makefile,v 1.35 2021/11/15 17:11:57 kim Exp $
2# 2#
3 3
4# FIXME: This is because of PREFIX=/ below. 4# FIXME: This is because of PREFIX=/ below.
5CHECK_FILES_SUPPORTED= no 5CHECK_FILES_SUPPORTED= no
6NOT_FOR_UNPRIVILEGED= yes 6NOT_FOR_UNPRIVILEGED= yes
7 7
8PKGNAME= standalone-${DISTNAME} 8PKGNAME= standalone-${DISTNAME}
9PKGREVISION= 1 9PKGREVISION= 2
10 10
11WRKSRC= ${WRKDIR}/${DISTNAME} 
12PATCHDIR= ${.CURDIR}/../../shells/tcsh/patches 11PATCHDIR= ${.CURDIR}/../../shells/tcsh/patches
 12PKGDIR= ${.CURDIR}/../../shells/tcsh
 13DESCR_SRC= ${.CURDIR}/../../shells/tcsh/DESCR ${.CURDIR}/DESCR
13 14
14# This package only makes sense on platforms that don't themselves ship tcsh 15# This package only makes sense on platforms that don't themselves ship tcsh
15# in /bin. Otherwise it clobbers the native copy, which really isn't what 16# in /bin. Otherwise it clobbers the native copy, which really isn't what
16# anyone wants. 17# anyone wants.
17ONLY_FOR_PLATFORM+= NetBSD-*-* OpenBSD-*-* SunOS-*-* 18ONLY_FOR_PLATFORM+= NetBSD-*-* OpenBSD-*-* SunOS-*-*
18 19
19.include "../../mk/bsd.prefs.mk" 20.include "../../mk/bsd.prefs.mk"
20 21
21.if ${OS_VARIANT} == "OmniOS" 22.if ${OS_VARIANT} == "OmniOS"
22NOT_FOR_PLATFORM+= SunOS-*-* 23NOT_FOR_PLATFORM+= SunOS-*-*
23.endif 24.endif
24 25
25.include "../../shells/tcsh/Makefile.common" 26.include "../../shells/tcsh/Makefile.common"
26.include "../../mk/bsd.pkg.mk" 27.include "../../mk/bsd.pkg.mk"
27 28
28INSTALLATION_DIRS+= usr/share/man/man1 
29 
30COMMENT:= Standalone version of the Extended C-shell 29COMMENT:= Standalone version of the Extended C-shell
31MAINTAINER= agc@NetBSD.org 30MAINTAINER= agc@NetBSD.org
32 31
33# FIXME: Packages shall only install into ${LOCALBASE} or a subdirectory. 32# FIXME: Packages shall only install into ${LOCALBASE} or a subdirectory.
34PREFIX= / 33PREFIX= /
35EGDIR= /usr/share/examples/tcsh 34PKGMANDIR= usr/share/man
 35EGDIR= usr/share/examples/tcsh
 36NLSDIR= usr/share/nls
36NOT_FOR_BULK_PLATFORM= *-*-* 37NOT_FOR_BULK_PLATFORM= *-*-*
37 38
38NLSDIR= usr/share/nls 
39CONFIGURE_ARGS+= --prefix=${PREFIX:Q} 39CONFIGURE_ARGS+= --prefix=${PREFIX:Q}
40CONFIGURE_ARGS+= --bindir=/bin 40CONFIGURE_ARGS+= --bindir=${PREFIX:S/\/$//:Q}/bin
41CONFIGURE_ARGS+= --mandir=/usr/share/man 41CONFIGURE_ARGS+= --localedir=${PREFIX:S/\/$//:Q}/${NLSDIR}
42CONFIGURE_ARGS+= --disable-nls-catalogs 42CONFIGURE_ARGS+= --mandir=${PREFIX:S/\/$//:Q}/${PKGMANDIR}
43 43
44DISTINFO_FILE= ${.CURDIR}/../../shells/tcsh/distinfo 44PLIST_AWK+= -f ${.CURDIR}/plist-examples.awk
 45PLIST_AWK_ENV+= EGDIR=${EGDIR}
45 46
46.if ${OPSYS} != "SunOS" 47PLIST_AWK+= -f ${.CURDIR}/plist-nls.awk
47LDFLAGS+= -static 48PLIST_AWK_ENV+= NLSDIR=${NLSDIR}
48.endif 

File Deleted: pkgsrc/shells/standalone-tcsh/Attic/PLIST

File Added: pkgsrc/shells/standalone-tcsh/plist-examples.awk
# $NetBSD: plist-examples.awk,v 1.1 2021/11/15 17:11:57 kim Exp $
BEGIN { EGDIR = getenv_or_die("EGDIR") }
{ sub(/^share\/examples\/tcsh\//, EGDIR "/") }

File Added: pkgsrc/shells/standalone-tcsh/plist-nls.awk
# $NetBSD: plist-nls.awk,v 1.1 2021/11/15 17:11:57 kim Exp $
BEGIN { NLSDIR = getenv_or_die("NLSDIR") }
{ sub(/^share\/locale\//, NLSDIR "/") }

cvs diff -r1.13 -r1.14 pkgsrc/shells/static-tcsh/Makefile (expand / switch to unified diff)

--- pkgsrc/shells/static-tcsh/Makefile 2021/11/14 22:15:13 1.13
+++ pkgsrc/shells/static-tcsh/Makefile 2021/11/15 17:11:58 1.14
@@ -1,25 +1,19 @@ @@ -1,25 +1,19 @@
1# $NetBSD: Makefile,v 1.13 2021/11/14 22:15:13 kim Exp $ 1# $NetBSD: Makefile,v 1.14 2021/11/15 17:11:58 kim Exp $
2# 2#
3 3
 4PKGNAME= static-${DISTNAME}
 5PKGREVISION= 2
 6
4.include "../../shells/tcsh/Makefile.common" 7.include "../../shells/tcsh/Makefile.common"
5 8
6MAINTAINER= agc@NetBSD.org 9MAINTAINER= agc@NetBSD.org
7 10
8DISTINFO_FILE= ${.CURDIR}/../../shells/tcsh/distinfo 
9PATCHDIR= ${.CURDIR}/../../shells/tcsh/patches 11PATCHDIR= ${.CURDIR}/../../shells/tcsh/patches
10PKGDIR= ${.CURDIR}/../../shells/tcsh 12PKGDIR= ${.CURDIR}/../../shells/tcsh
11DESCR_SRC= ${.CURDIR}/../../shells/tcsh/DESCR ${.CURDIR}/DESCR 13DESCR_SRC= ${.CURDIR}/../../shells/tcsh/DESCR ${.CURDIR}/DESCR
12 14
13CONFLICTS= tcsh-[0-9]* 15CONFLICTS= tcsh-[0-9]*
14 16
15PKGNAME= static-${DISTNAME} 17COMMENT= Statically-linked version of the Extended C-shell
16PKGREVISION= 1 
17 
18# SunOS 5.10 stopped shipping static libraries. 
19NOT_FOR_PLATFORM+= SunOS-5.1[0-9]-* 
20 
21COMMENT:= Statically-linked version of the ${COMMENT} 
22 
23LDFLAGS+= -static 
24 18
25.include "../../mk/bsd.pkg.mk" 19.include "../../mk/bsd.pkg.mk"

cvs diff -r1.101 -r1.102 pkgsrc/shells/tcsh/Makefile (expand / switch to unified diff)

--- pkgsrc/shells/tcsh/Makefile 2021/11/14 22:15:13 1.101
+++ pkgsrc/shells/tcsh/Makefile 2021/11/15 17:11:58 1.102
@@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
1# $NetBSD: Makefile,v 1.101 2021/11/14 22:15:13 kim Exp $ 1# $NetBSD: Makefile,v 1.102 2021/11/15 17:11:58 kim Exp $
2 2
3.include "../../shells/tcsh/Makefile.common" 3.include "../../shells/tcsh/Makefile.common"
4 4
5PKGREVISION=1 5PKGREVISION= 2
6 6
7.include "../../mk/bsd.pkg.mk" 7.include "../../mk/bsd.pkg.mk"

cvs diff -r1.1 -r1.2 pkgsrc/shells/tcsh/Makefile.common (expand / switch to unified diff)

--- pkgsrc/shells/tcsh/Makefile.common 2021/11/11 22:47:55 1.1
+++ pkgsrc/shells/tcsh/Makefile.common 2021/11/15 17:11:58 1.2
@@ -1,47 +1,50 @@ @@ -1,47 +1,50 @@
1# $NetBSD: Makefile.common,v 1.1 2021/11/11 22:47:55 kim Exp $ 1# $NetBSD: Makefile.common,v 1.2 2021/11/15 17:11:58 kim Exp $
2# 2#
3# used by shells/standalone-tcsh/Makefile 3# used by shells/standalone-tcsh/Makefile
4# used by shells/static-tcsh/Makefile 4# used by shells/static-tcsh/Makefile
5# used by shells/tcsh/Makefile 5# used by shells/tcsh/Makefile
6 6
7DISTNAME= tcsh-6.23.00 7DISTNAME= tcsh-6.23.00
8CATEGORIES= shells 8CATEGORIES= shells
9MASTER_SITES= ftp://ftp.astron.com/pub/tcsh/ 9MASTER_SITES= ftp://ftp.astron.com/pub/tcsh/
10MASTER_SITES+= http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/ 10MASTER_SITES+= http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/
11 11
12MAINTAINER= pkgsrc-users@NetBSD.org 12MAINTAINER= pkgsrc-users@NetBSD.org
13HOMEPAGE= https://www.tcsh.org/ 13HOMEPAGE= https://www.tcsh.org/
14COMMENT= Extended C-shell with many useful features 14COMMENT= Extended C-shell with many useful features
15LICENSE= original-bsd 15LICENSE= original-bsd
16 16
17CONFLICTS= static-tcsh-[0-9]* 17CONFLICTS= static-tcsh-[0-9]*
18 18
19GNU_CONFIGURE= yes 19GNU_CONFIGURE= yes
20USE_TOOLS+= autoconf:test perl:test 20USE_TOOLS+= autoconf:test perl:test
21 21
22EGDIR= ${PREFIX}/share/examples/tcsh 22EGDIR= share/examples/tcsh
23 23
24.include "../../mk/bsd.prefs.mk" 24.include "../../mk/bsd.prefs.mk"
 25.include "options.mk"
25 26
26.if ${OPSYS} == "SunOS" 27.if ${OPSYS} == "SunOS"
27LOWER_OPSYS_VERSUFFIX= ${OS_VERSION:S/5./2./} 28LOWER_OPSYS_VERSUFFIX= ${OS_VERSION:S/5./2./}
28.endif 29.endif
29 30
30.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) 31.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
31# XXX Should use CONFIGURE_ENV, but the configure script disregards 32# XXX Should use CONFIGURE_ENV, but the configure script disregards
32# $CC_FOR_GETHOST in the environment and sets it to cc. 33# $CC_FOR_GETHOST in the environment and sets it to cc.
33MAKE_FLAGS+= CC_FOR_GETHOST=${NATIVE_CC:Q} 34MAKE_FLAGS+= CC_FOR_GETHOST=${NATIVE_CC:Q}
34.endif 35.endif
35 36
36TEST_TARGET= check 37TEST_TARGET= check
37 38
38PKG_SHELL= bin/tcsh 39PKG_SHELL= bin/tcsh
39 40
40INSTALLATION_DIRS= bin ${PKGMANDIR}/man1 
41 
42post-install: 41post-install:
43 ${INSTALL_DATA_DIR} ${DESTDIR}${EGDIR} 42 ${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX:S/\/$//:Q}/${EGDIR}
44 ${INSTALL_DATA} ${WRKSRC}/complete.tcsh ${DESTDIR}${EGDIR} 43 ${INSTALL_DATA} \
45 ${INSTALL_DATA} ${WRKSRC}/csh-mode.el ${DESTDIR}${EGDIR} 44 ${WRKSRC}/complete.tcsh \
 45 ${DESTDIR}${PREFIX:S/\/$//:Q}/${EGDIR}
 46 ${INSTALL_DATA} \
 47 ${WRKSRC}/csh-mode.el \
 48 ${DESTDIR}${PREFIX:S/\/$//:Q}/${EGDIR}
46 49
47.include "../../mk/termcap.buildlink3.mk" 50.include "../../mk/termcap.buildlink3.mk"

cvs diff -r1.5 -r1.6 pkgsrc/shells/tcsh/PLIST (expand / switch to unified diff)

--- pkgsrc/shells/tcsh/PLIST 2015/05/22 08:03:43 1.5
+++ pkgsrc/shells/tcsh/PLIST 2021/11/15 17:11:58 1.6
@@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
1@comment $NetBSD: PLIST,v 1.5 2015/05/22 08:03:43 kim Exp $ 1@comment $NetBSD: PLIST,v 1.6 2021/11/15 17:11:58 kim Exp $
2bin/tcsh 2bin/tcsh
3man/man1/tcsh.1 3man/man1/tcsh.1
4share/examples/tcsh/complete.tcsh 4share/examples/tcsh/complete.tcsh
5share/examples/tcsh/csh-mode.el 5share/examples/tcsh/csh-mode.el
6share/locale/C/LC_MESSAGES/tcsh.cat 6${PLIST.nls}share/locale/C/LC_MESSAGES/tcsh.cat
7share/locale/de/LC_MESSAGES/tcsh.cat 7${PLIST.nls}share/locale/de/LC_MESSAGES/tcsh.cat
8share/locale/es/LC_MESSAGES/tcsh.cat 8${PLIST.nls}share/locale/es/LC_MESSAGES/tcsh.cat
9share/locale/et/LC_MESSAGES/tcsh.cat 9${PLIST.nls}share/locale/et/LC_MESSAGES/tcsh.cat
10share/locale/fi/LC_MESSAGES/tcsh.cat 10${PLIST.nls}share/locale/fi/LC_MESSAGES/tcsh.cat
11share/locale/fr/LC_MESSAGES/tcsh.cat 11${PLIST.nls}share/locale/fr/LC_MESSAGES/tcsh.cat
12share/locale/gr/LC_MESSAGES/tcsh.cat 12${PLIST.nls}share/locale/gr/LC_MESSAGES/tcsh.cat
13share/locale/it/LC_MESSAGES/tcsh.cat 13${PLIST.nls}share/locale/it/LC_MESSAGES/tcsh.cat
14share/locale/ja/LC_MESSAGES/tcsh.cat 14${PLIST.nls}share/locale/ja/LC_MESSAGES/tcsh.cat
15share/locale/pl/LC_MESSAGES/tcsh.cat 15${PLIST.nls}share/locale/pl/LC_MESSAGES/tcsh.cat
16share/locale/ru/LC_MESSAGES/tcsh.cat 16${PLIST.nls}share/locale/ru/LC_MESSAGES/tcsh.cat
17share/locale/ru_UA/LC_MESSAGES/tcsh.cat 17${PLIST.nls}share/locale/ru_UA/LC_MESSAGES/tcsh.cat

File Added: pkgsrc/shells/tcsh/options.mk
# $NetBSD: options.mk,v 1.1 2021/11/15 17:11:58 kim Exp $

PKG_OPTIONS_VAR?=	PKG_OPTIONS.tcsh

PKG_SUPPORTED_OPTIONS=	nls
PKG_SUGGESTED_OPTIONS=	nls
.if empty(PKGNAME:Mstatic-tcsh-[0-9]*)
PKG_SUPPORTED_OPTIONS+=	static
. if !empty(PKGNAME:Mstandalone-tcsh-[0-9]*) && ${OPSYS} != "SunOS"
PKG_SUGGESTED_OPTIONS+=	static
. endif
.endif

PLIST_VARS+=		nls

.include "../../mk/bsd.options.mk"

.if !empty(PKG_OPTIONS:Mnls)
PLIST.nls=		yes
.else
CONFIGURE_ARGS+=	--disable-nls-catalogs
.endif

.if !empty(PKG_OPTIONS:Mstatic) || !empty(PKGNAME:Mstatic-tcsh-[0-9]*)
LDFLAGS+=		-static

# SunOS 5.10 stopped shipping static libraries.
NOT_FOR_PLATFORM+=	SunOS-5.1[0-9]-*
.endif

PRINT_PLIST_AWK+=	{if ($$0 ~ /\.cat$$/) {$$0 = "$${PLIST.nls}" $$0;}}