head	1.7;
access;
symbols
	pkgsrc-2026Q3:1.7.0.100
	pkgsrc-2026Q3-base:1.7
	pkgsrc-2026Q2:1.7.0.98
	pkgsrc-2026Q2-base:1.7
	pkgsrc-2026Q1:1.7.0.96
	pkgsrc-2026Q1-base:1.7
	pkgsrc-2025Q4:1.7.0.94
	pkgsrc-2025Q4-base:1.7
	pkgsrc-2025Q3:1.7.0.92
	pkgsrc-2025Q3-base:1.7
	pkgsrc-2025Q2:1.7.0.90
	pkgsrc-2025Q2-base:1.7
	pkgsrc-2025Q1:1.7.0.88
	pkgsrc-2025Q1-base:1.7
	pkgsrc-2024Q4:1.7.0.86
	pkgsrc-2024Q4-base:1.7
	pkgsrc-2024Q3:1.7.0.84
	pkgsrc-2024Q3-base:1.7
	pkgsrc-2024Q2:1.7.0.82
	pkgsrc-2024Q2-base:1.7
	pkgsrc-2024Q1:1.7.0.80
	pkgsrc-2024Q1-base:1.7
	pkgsrc-2023Q4:1.7.0.78
	pkgsrc-2023Q4-base:1.7
	pkgsrc-2023Q3:1.7.0.76
	pkgsrc-2023Q3-base:1.7
	pkgsrc-2023Q2:1.7.0.74
	pkgsrc-2023Q2-base:1.7
	pkgsrc-2023Q1:1.7.0.72
	pkgsrc-2023Q1-base:1.7
	pkgsrc-2022Q4:1.7.0.70
	pkgsrc-2022Q4-base:1.7
	pkgsrc-2022Q3:1.7.0.68
	pkgsrc-2022Q3-base:1.7
	pkgsrc-2022Q2:1.7.0.66
	pkgsrc-2022Q2-base:1.7
	pkgsrc-2022Q1:1.7.0.64
	pkgsrc-2022Q1-base:1.7
	pkgsrc-2021Q4:1.7.0.62
	pkgsrc-2021Q4-base:1.7
	pkgsrc-2021Q3:1.7.0.60
	pkgsrc-2021Q3-base:1.7
	pkgsrc-2021Q2:1.7.0.58
	pkgsrc-2021Q2-base:1.7
	pkgsrc-2021Q1:1.7.0.56
	pkgsrc-2021Q1-base:1.7
	pkgsrc-2020Q4:1.7.0.54
	pkgsrc-2020Q4-base:1.7
	pkgsrc-2020Q3:1.7.0.52
	pkgsrc-2020Q3-base:1.7
	pkgsrc-2020Q2:1.7.0.48
	pkgsrc-2020Q2-base:1.7
	pkgsrc-2020Q1:1.7.0.28
	pkgsrc-2020Q1-base:1.7
	pkgsrc-2019Q4:1.7.0.50
	pkgsrc-2019Q4-base:1.7
	pkgsrc-2019Q3:1.7.0.46
	pkgsrc-2019Q3-base:1.7
	pkgsrc-2019Q2:1.7.0.44
	pkgsrc-2019Q2-base:1.7
	pkgsrc-2019Q1:1.7.0.42
	pkgsrc-2019Q1-base:1.7
	pkgsrc-2018Q4:1.7.0.40
	pkgsrc-2018Q4-base:1.7
	pkgsrc-2018Q3:1.7.0.38
	pkgsrc-2018Q3-base:1.7
	pkgsrc-2018Q2:1.7.0.36
	pkgsrc-2018Q2-base:1.7
	pkgsrc-2018Q1:1.7.0.34
	pkgsrc-2018Q1-base:1.7
	pkgsrc-2017Q4:1.7.0.32
	pkgsrc-2017Q4-base:1.7
	pkgsrc-2017Q3:1.7.0.30
	pkgsrc-2017Q3-base:1.7
	pkgsrc-2017Q2:1.7.0.26
	pkgsrc-2017Q2-base:1.7
	pkgsrc-2017Q1:1.7.0.24
	pkgsrc-2017Q1-base:1.7
	pkgsrc-2016Q4:1.7.0.22
	pkgsrc-2016Q4-base:1.7
	pkgsrc-2016Q3:1.7.0.20
	pkgsrc-2016Q3-base:1.7
	pkgsrc-2016Q2:1.7.0.18
	pkgsrc-2016Q2-base:1.7
	pkgsrc-2016Q1:1.7.0.16
	pkgsrc-2016Q1-base:1.7
	pkgsrc-2015Q4:1.7.0.14
	pkgsrc-2015Q4-base:1.7
	pkgsrc-2015Q3:1.7.0.12
	pkgsrc-2015Q3-base:1.7
	pkgsrc-2015Q2:1.7.0.10
	pkgsrc-2015Q2-base:1.7
	pkgsrc-2015Q1:1.7.0.8
	pkgsrc-2015Q1-base:1.7
	pkgsrc-2014Q4:1.7.0.6
	pkgsrc-2014Q4-base:1.7
	pkgsrc-2014Q3:1.7.0.4
	pkgsrc-2014Q3-base:1.7
	pkgsrc-2014Q2:1.7.0.2
	pkgsrc-2014Q2-base:1.7
	pkgsrc-2014Q1:1.6.0.32
	pkgsrc-2014Q1-base:1.6
	pkgsrc-2013Q4:1.6.0.30
	pkgsrc-2013Q4-base:1.6
	pkgsrc-2013Q3:1.6.0.28
	pkgsrc-2013Q3-base:1.6
	pkgsrc-2013Q2:1.6.0.26
	pkgsrc-2013Q2-base:1.6
	pkgsrc-2013Q1:1.6.0.24
	pkgsrc-2013Q1-base:1.6
	pkgsrc-2012Q4:1.6.0.22
	pkgsrc-2012Q4-base:1.6
	pkgsrc-2012Q3:1.6.0.20
	pkgsrc-2012Q3-base:1.6
	pkgsrc-2012Q2:1.6.0.18
	pkgsrc-2012Q2-base:1.6
	pkgsrc-2012Q1:1.6.0.16
	pkgsrc-2012Q1-base:1.6
	pkgsrc-2011Q4:1.6.0.14
	pkgsrc-2011Q4-base:1.6
	pkgsrc-2011Q3:1.6.0.12
	pkgsrc-2011Q3-base:1.6
	pkgsrc-2011Q2:1.6.0.10
	pkgsrc-2011Q2-base:1.6
	pkgsrc-2011Q1:1.6.0.8
	pkgsrc-2011Q1-base:1.6
	pkgsrc-2010Q4:1.6.0.6
	pkgsrc-2010Q4-base:1.6
	pkgsrc-2010Q3:1.6.0.4
	pkgsrc-2010Q3-base:1.6
	pkgsrc-2010Q2:1.6.0.2
	pkgsrc-2010Q2-base:1.6
	pkgsrc-2010Q1:1.5.0.26
	pkgsrc-2010Q1-base:1.5
	pkgsrc-2009Q4:1.5.0.24
	pkgsrc-2009Q4-base:1.5
	pkgsrc-2009Q3:1.5.0.22
	pkgsrc-2009Q3-base:1.5
	pkgsrc-2009Q2:1.5.0.20
	pkgsrc-2009Q2-base:1.5
	pkgsrc-2009Q1:1.5.0.18
	pkgsrc-2009Q1-base:1.5
	pkgsrc-2008Q4:1.5.0.16
	pkgsrc-2008Q4-base:1.5
	pkgsrc-2008Q3:1.5.0.14
	pkgsrc-2008Q3-base:1.5
	cube-native-xorg:1.5.0.12
	cube-native-xorg-base:1.5
	pkgsrc-2008Q2:1.5.0.10
	pkgsrc-2008Q2-base:1.5
	cwrapper:1.5.0.8
	pkgsrc-2008Q1:1.5.0.6
	pkgsrc-2008Q1-base:1.5
	pkgsrc-2007Q4:1.5.0.4
	pkgsrc-2007Q4-base:1.5
	pkgsrc-2007Q3:1.5.0.2
	pkgsrc-2007Q3-base:1.5
	pkgsrc-2007Q2:1.4.0.6
	pkgsrc-2007Q2-base:1.4
	pkgsrc-2007Q1:1.4.0.4
	pkgsrc-2007Q1-base:1.4
	jlam-pkgviews:1.4.0.2
	jlam-pkgviews-base:1.4
	pkgsrc-2006Q4:1.3.0.4
	pkgsrc-2006Q4-base:1.3
	pkgsrc-2006Q3:1.3.0.2
	pkgsrc-2006Q3-base:1.3
	pkgsrc-2006Q2:1.1.0.2
	pkgsrc-2006Q2-base:1.1;
locks; strict;
comment	@# @;


1.7
date	2014.06.01.16.57.27;	author wiz;	state Exp;
branches;
next	1.6;
commitid	xy4kueMkShYdcQCx;

1.6
date	2010.04.23.12.47.14;	author jmmv;	state Exp;
branches;
next	1.5;

1.5
date	2007.07.12.19.41.46;	author jlam;	state Exp;
branches;
next	1.4;

1.4
date	2007.01.02.11.47.26;	author joerg;	state Exp;
branches;
next	1.3;

1.3
date	2006.09.22.21.53.58;	author joerg;	state Exp;
branches;
next	1.2;

1.2
date	2006.07.19.22.26.26;	author jlam;	state Exp;
branches;
next	1.1;

1.1
date	2006.05.21.23.50.15;	author jlam;	state Exp;
branches;
next	;


desc
@@


1.7
log
@Update default font path reference.
@
text
@# $NetBSD: fonts,v 1.6 2010/04/23 12:47:14 jmmv Exp $
#
# Generate a +FONTS script that updates font databases for the package.
#
case "${STAGE},$1" in
UNPACK,|UNPACK,+FONTS)
	${CAT} > ./+FONTS << 'EOF'
#!@@SH@@
#
# +FONTS - font database management script
#
# Usage: ./+FONTS [metadatadir]
#
# This scripts rebuilds font databases needed by the package associated
# with <metadatadir>.
#
# Lines starting with "# FONTS: " are data read by this script that name
# the directories in which the font database will be rebuilt.
#
#	# FONTS: /usr/pkg/share/fonts/X11/TTF ttf
#	# FONTS: /usr/pkg/share/fonts/X11/Type1 type1
#	# FONTS: /usr/pkg/share/fonts/X11/misc x11
#
# For each FONTS entry, if the path is relative, that it is taken to be
# relative to ${PKG_PREFIX}.
#

ECHO="@@ECHO@@"
FIND="@@FIND@@"
GREP="@@GREP@@"
MKFONTDIR="@@MKFONTDIR@@"
PWD_CMD="@@PWD_CMD@@"
RM="@@RM@@"
RMDIR="@@RMDIR@@"
SED="@@SED@@"
SORT="@@SORT@@"
TEST="@@TEST@@"
TRUE="@@TRUE@@"
TTF_INDEX_CMD="@@TTF_INDEX_CMD@@"
TYPE1_INDEX_CMD="@@TYPE1_INDEX_CMD@@"
TYPE1_POSTINDEX_CMD="@@TYPE1_POSTINDEX_CMD@@"
X11_ENCODINGSDIR="@@X11_ENCODINGSDIR@@"

SELF=$0

CURDIR=`${PWD_CMD}`
PKG_METADATA_DIR="${1-${CURDIR}}"
: ${PKGNAME=${PKG_METADATA_DIR##*/}}
: ${PKG_PREFIX=@@PREFIX@@}

case "${PKG_UPDATE_FONTS_DB:-@@PKG_UPDATE_FONTS_DB@@}" in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
	_PKG_UPDATE_FONTS_DB=yes
	;;
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
	_PKG_UPDATE_FONTS_DB=no
	;;
esac

case "${FONTS_VERBOSE:-@@FONTS_VERBOSE@@}" in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
	echo="${ECHO}"
	;;
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
	echo=":"
	;;
esac

${SED} -n "/^\# FONTS: /{s/^\# FONTS: //;p;}" ${SELF} | ${SORT} -u |
while read dir font_type; do
	case ${_PKG_UPDATE_FONTS_DB} in
	no)	continue ;;
	esac
	case $dir in
	"")	continue ;;
	[!/]*)	dir="${PKG_PREFIX}/$dir" ;;
	esac
	${TEST} -d "$dir" || continue
	( $echo "${PKGNAME}: updating font database in $dir ($font_type)"
	  cd $dir
	  update_args=
	  post_update_cmd=
	  case $font_type in
	  [tT][tT][fF])		update_cmd="${TTF_INDEX_CMD}" ;;
	  [tT][yY][pP][eE]1)	update_cmd="${TYPE1_INDEX_CMD}"
				post_update_cmd="${TYPE1_POSTINDEX_CMD}" ;;
	  [xX]11)		update_cmd="${MKFONTDIR}"
				[ ! -z "${X11_ENCODINGSDIR}" ] && update_args="-e ${X11_ENCODINGSDIR}" ;;
	  esac
	  ${TEST} -f "$update_cmd" || update_cmd="${TRUE}"
	  $update_cmd $update_args >/dev/null
	  $post_update_cmd
	  #
	  # Remove fonts databases if there are no fonts in the directory.
	  # We filter out the encodings.dir, fonts.{dirs,scale}, and
	  # Fontmap database files from the directory listing.  Also remove
	  # the directory if it turns out to be empty.
	  #
	  if ${FIND} . -type f | ${GREP} -v "/encodings.dir" | ${GREP} -v "/fonts\.scale" | \
	     ${GREP} -v "/fonts\.dir" | ${GREP} -v "/Fontmap" >/dev/null
	  then
	      : # Directory not empty; do nothing.
	  else
	      ${RM} -f fonts.dir fonts.scale Fontmap* encodings.dir
	      ${RMDIR} -p $dir 2>/dev/null
	  fi
	)
done

EOF
	${SED} -n "/^\# FONTS: /p" ${SELF} >> ./+FONTS
	${CHMOD} +x ./+FONTS
	;;
esac

@


1.6
log
@pkgsrc now deletes empty directories automatically.  Fix the fonts
deinstallation script to follow this convention and purge empty directories
when there are no fonts left (and after their database has been removed).
@
text
@d1 1
a1 1
# $NetBSD: fonts,v 1.5 2007/07/12 19:41:46 jlam Exp $
d20 3
a22 3
#	# FONTS: /usr/pkg/lib/X11/fonts/TTF ttf
#	# FONTS: /usr/pkg/lib/X11/fonts/Type1 type1
#	# FONTS: /usr/pkg/lib/X11/fonts/misc x11
@


1.5
log
@* Add a user-settable variable to tune the default verbosity of the
  +INSTALL and +DEINSTALL scripts:

  PKGINSTALL_VERBOSE
	A list of scriptlets that will be verbose and output a message
	noting the actions taken.

	* "all" is a special value that implies all of the other items
	* "fonts" for +FONTS
	* "info-files" for +INFO_FILES

	Default value: "all" for PKG_DEVELOPERs, empty otherwise.

* Be "one-liner brief" when doing the default actions.  For example,
  the info files output now looks like:

	gmake-3.81: registering info file /usr/pkg/info/make.info

  We retain the current verbosity for the CHECK-* actions.
@
text
@d1 1
a1 1
# $NetBSD: fonts,v 1.4 2007/01/02 11:47:26 joerg Exp $
d34 1
d96 2
a97 1
	  # Fontmap database files from the directory listing.
d99 8
a106 1
	  ${FIND} . -type f | ${GREP} -v "/encodings.dir" | ${GREP} -v "/fonts\.scale" | ${GREP} -v "/fonts\.dir" | ${GREP} -v "/Fontmap" >/dev/null || ${RM} -f fonts.dir fonts.scale Fontmap* encodings.dir > /dev/null
@


1.4
log
@Add fonts magic for TrueType and Type1 fonts.
XXX Do we want to prefer mkfontscale on other installations as well?
@
text
@d1 1
a1 1
# $NetBSD: fonts,v 1.3 2006/09/22 21:53:58 joerg Exp $
d59 9
d69 1
a69 1
{ while read dir font_type; do
d78 1
a78 9
	case "$printed_header" in
	yes)	;;
	*)	printed_header=yes
		${ECHO} "==========================================================================="
		${ECHO} "Updating font databases in the following directories:"
		${ECHO} ""
		;;
	esac
	( ${ECHO} "	$dir ($font_type)"
a99 5
case "$printed_header" in
yes)	${ECHO} ""
	${ECHO} "==========================================================================="
	;;
esac; }
@


1.3
log
@- Compute CHEKCK_FILES filter on the entries requested and keep it
  as tight as possible. Files we don't handle shouldn't be skipped.
- fonts.alias is not created automatically, so don't remove it.
- create fonts.encoding with mkfontdir using -e X11_ENCODINGSDIR.
  On platforms not following the X11R6 loayout this might need to
  be overriden.
- Fix type1inst calls.
- Modify packages which installed fonts.alias before to actually
  include it in the PLIST and bump the revisions accordingly.
- Modify xorg-fonts* packages to use FONTS_DIRS.* to build indices
  at run time.

Discussed with wiz and jlam.
@
text
@d1 1
a1 1
# $NetBSD: fonts,v 1.2 2006/07/19 22:26:26 jlam Exp $
d38 3
a40 2
TTMKFDIR="@@TTMKFDIR@@"
TYPE1INST="@@TYPE1INST@@"
d82 3
a84 3
	  [tT][tT][fF])		update_cmd="${TTMKFDIR}" ;;
	  [tT][yY][pP][eE]1)	update_cmd="${TYPE1INST}"
				post_update_cmd="${RM} type1inst.log" ;;
@


1.2
log
@Be more conservative and avoid possible shell implementation differences
by not using `...` inside ${...#...}.
@
text
@d1 1
a1 1
# $NetBSD: fonts,v 1.1 2006/05/21 23:50:15 jlam Exp $
d40 1
d78 2
d82 4
a85 2
	  [tT][yY][pP][eE]1)	update_cmd="${TYPE1INST}; ${RM} type1inst.log" ;;
	  [xX]11)		update_cmd="${MKFONTDIR}" ;;
d88 2
a89 1
	  $update_cmd >/dev/null
d92 1
a92 1
	  # We filter out the encodings.dir, fonts.{alias,dirs,scale}, and
d95 1
a95 1
	  ${FIND} . -type f | ${GREP} -v "/encodings.dir" | ${GREP} -v "/fonts\." | ${GREP} -v "/Fontmap" >/dev/null || ${RM} -f fonts.* Fontmap*
@


1.1
log
@Move mk/install to mk/pkginstall to better reflect the contents (the
pkginstall framework).
@
text
@d1 1
a1 1
# $NetBSD: fonts,v 1.11 2006/03/19 23:58:14 jlam Exp $
d42 3
a44 1
PKG_METADATA_DIR="${1-`${PWD_CMD}`}"
@

