From 6e74169b0c089e73faece47dfe38457554683c53 Mon Sep 17 00:00:00 2001 From: Dejan Lesjak Date: Sun, 23 Jan 2005 19:50:40 +0000 Subject: Add rcNG startup script. [1] Font cache is not build by default, which makes related lines in default configure file wrong, which in turn causes xfs to error out on startup with default file. Tweak generation of said file in a way that would make proper configuration depending on existance of font caching code, so that this patch can be sent upstream. [2] Inspired by: Jose M Rodriguez (josemi at freebsd.jazztel.es) [1] Bits and pieces for [1] stolen from: src/etc/rc.d/xfs, apache2 and squid ports Noticed by: Gary Dunn (knowtree at aloha.com) [2] --- x11-fonts/xfs/Makefile | 7 +++++++ x11-fonts/xfs/files/patch-Imakefile | 14 ++++++++++++++ x11-fonts/xfs/files/patch-config.cpp | 13 +++++++++++++ x11-fonts/xfs/files/xfs.sh | 36 ++++++++++++++++++++++++++++++++++++ x11-fonts/xfs/pkg-plist | 1 + 5 files changed, 71 insertions(+) create mode 100644 x11-fonts/xfs/files/patch-Imakefile create mode 100644 x11-fonts/xfs/files/patch-config.cpp create mode 100644 x11-fonts/xfs/files/xfs.sh (limited to 'x11-fonts/xfs') diff --git a/x11-fonts/xfs/Makefile b/x11-fonts/xfs/Makefile index 05a37a85afd4..3d63b4ba0f20 100644 --- a/x11-fonts/xfs/Makefile +++ b/x11-fonts/xfs/Makefile @@ -7,6 +7,7 @@ PORTNAME= xorg-fontserver PORTVERSION= 6.8.1 +PORTREVISION= 1 CATEGORIES= x11-servers MASTER_SITES= ${MASTER_SITE_XORG} MASTER_SITE_SUBDIR= X11R${PORTVERSION}/tars @@ -28,7 +29,13 @@ XBUILD_DIRS= programs/xfs XINCLUDE_DIRS= lib/xtrans XMAN_DIRS= programs/xfs +post-build: + @${SED} -e 's|%%PREFIX%%|${PREFIX}|g' \ + -e 's|%%RC_SUBR%%|${RC_SUBR}|g' \ + ${FILESDIR}/xfs.sh >${WRKDIR}/xfs.sh + post-install: + @${INSTALL_SCRIPT} ${WRKDIR}/xfs.sh ${PREFIX}/etc/rc.d ${INSTALL_SCRIPT} ${WRKSRC}/programs/xfs/config \ ${PREFIX}/lib/X11/fs/config.default diff --git a/x11-fonts/xfs/files/patch-Imakefile b/x11-fonts/xfs/files/patch-Imakefile new file mode 100644 index 000000000000..64b65de2e69b --- /dev/null +++ b/x11-fonts/xfs/files/patch-Imakefile @@ -0,0 +1,14 @@ +--- programs/xfs/Imakefile.orig Tue Jan 18 22:28:55 2005 ++++ programs/xfs/Imakefile Tue Jan 18 22:30:24 2005 +@@ -37,7 +37,11 @@ + FSLIBDIR = $(LIBDIR)/fs + FSERRORS = $(LOGDIRECTORY)/xfs.log + DEFAULTFONTPATH = DefaultFSFontPath ++#if defined(BuildFontCacheLib) && BuildFontCacheLib ++SITE_CONFIG = -DDEFAULTFONTPATH=$(DEFAULTFONTPATH) -DFSERRORS=$(FSERRORS) -DFONTCACHE ++#else + SITE_CONFIG = -DDEFAULTFONTPATH=$(DEFAULTFONTPATH) -DFSERRORS=$(FSERRORS) ++#endif + + $(OSLIB): $(OSDIR) + diff --git a/x11-fonts/xfs/files/patch-config.cpp b/x11-fonts/xfs/files/patch-config.cpp new file mode 100644 index 000000000000..d44e630c972f --- /dev/null +++ b/x11-fonts/xfs/files/patch-config.cpp @@ -0,0 +1,13 @@ +--- programs/xfs/config.cpp.orig Tue Jan 18 22:31:25 2005 ++++ programs/xfs/config.cpp Tue Jan 18 22:32:13 2005 +@@ -8,8 +8,10 @@ + XCOMM in decipoints + default-point-size = 120 + default-resolutions = 75,75,100,100 ++#ifdef FONTCACHE + + XCOMM font cache control, specified in KB + cache-hi-mark = 2048 + cache-low-mark = 1433 + cache-balance = 70 ++#endif diff --git a/x11-fonts/xfs/files/xfs.sh b/x11-fonts/xfs/files/xfs.sh new file mode 100644 index 000000000000..815dfae47190 --- /dev/null +++ b/x11-fonts/xfs/files/xfs.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# +# $FreeBSD: /tmp/pcvs/ports/x11-fonts/xfs/files/Attic/xfs.sh,v 1.1 2005-01-23 19:50:40 lesi Exp $ +# + +# PROVIDE: xfs +# REQUIRE: cleartmp +# BEFORE: LOGIN +# KEYWORD: FreeBSD + +# The following variables are provided to control startup of X font server in +# rc configuration file (eg /etc/rc.conf): +# xfs_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable X font server +# xfs_config (str): Set to "%%PREFIX%%/lib/X11/fs/config" by default. +# Configuration file for X font server. +# +# Please see xfs(1), rc.conf(5) and rc(8) for further details. + +. %%RC_SUBR%% + +name="xfs" +rcvar=`set_rcvar` + +# Set defaults +[ -z "$xfs_enable" ] && xfs_enable="NO" +[ -z "$xfs_config" ] && xfs_config="%%PREFIX%%/lib/X11/fs/config" + +load_rc_config $name + +command="%%PREFIX%%/bin/${name}" +command_args="-config ${xfs_config} -daemon" +required_files="$xfs_config" +extra_commands="reload" + +run_rc_command "$1" diff --git a/x11-fonts/xfs/pkg-plist b/x11-fonts/xfs/pkg-plist index ce88bda544d2..5f0e1b513095 100644 --- a/x11-fonts/xfs/pkg-plist +++ b/x11-fonts/xfs/pkg-plist @@ -1,3 +1,4 @@ bin/xfs +etc/rc.d/xfs.sh @unexec if cmp -s %D/lib/X11/fs/config.default %D/lib/X11/fs/config; then rm -f %D/lib/X11/fs/config; fi lib/X11/fs/config.default -- cgit v1.2.3