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]
This commit is contained in:
Dejan Lesjak 2005-01-23 19:50:40 +00:00
parent e4dd4efacd
commit 6e74169b0c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=127146
10 changed files with 142 additions and 0 deletions

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -0,0 +1,36 @@
#!/bin/sh
#
# $FreeBSD: /tmp/pcvs/ports/x11-servers/xorg-fontserver/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"

View file

@ -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