1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-26 05:02:18 +00:00

- Add a configuration file for fontconfig[*]

- Use @dirrmtry
- Call fc-cache after the installation/deinstallation

Submitted by:	Yamashiro Jun[*]
PR:		ports/92489[*]
This commit is contained in:
Hiroki Sato 2006-02-05 17:20:45 +00:00
parent c8cbf70c1b
commit ec1d1dda3b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=155268
6 changed files with 98 additions and 4 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= sazanami-ttf
PORTVERSION= 20040629
PORTREVISION= 1
CATEGORIES= japanese x11-fonts
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_JP}
MASTER_SITE_SUBDIR= efont/10087
@ -52,6 +53,9 @@ do-install:
${LN} -s -f \
${PREFIX}/${FONTSDIR}/sazanami-mincho.ttf \
${LOCALBASE}/${LOCALFONTSDIR}/TrueType/sazanami-mincho.ttf
${MKDIR} ${PREFIX}/etc/fonts/conf.d
${INSTALL_DATA} ${FILESDIR}/3.sazanami-ttf.conf \
${PREFIX}/etc/fonts/conf.d
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
.for F in ${DOC_FILES:Mdoc/*}
@ -62,6 +66,9 @@ do-install:
${INSTALL_DATA} ${WRKSRC}/${F} ${DOCSDIR}
.endfor
.endif
post-install:
${X11BASE}/bin/fc-cache -f -v ${PREFIX}/${FONTSDIR}
${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.include <bsd.port.mk>

View File

@ -0,0 +1,36 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- $FreeBSD$ -->
<fontconfig>
<alias>
<family>serif</family>
<prefer>
<family>Sazanami Mincho</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Sazanami Gothic</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Sazanami Gothic</family>
<family>Sazanami Mincho</family>
</prefer>
</alias>
<match target="font">
<test name="family">
<string>Sazanami Mincho</string>
<string>Sazanami Gothic</string>
</test>
<edit name="hintstyle">
<const>hintslight</const>
</edit>
<edit name="autohint">
<bool>false</bool>
</edit>
</match>
</fontconfig>

View File

@ -1,4 +1,5 @@
@comment $FreeBSD$
etc/fonts/conf.d/3.sazanami-ttf.conf
%%FONTSDIR%%/fonts.alias.sazanami
%%FONTSDIR%%/fonts.dir.sazanami
%%FONTSDIR%%/sazanami-mincho.ttf
@ -17,10 +18,13 @@
%%PORTDOCS%%@dirrm %%DOCSDIR%%/ayu
%%PORTDOCS%%@dirrm %%DOCSDIR%%/kappa
%%PORTDOCS%%@dirrm %%DOCSDIR%%
@exec %%X11BASE%%/bin/fc-cache -f -v %D/%%FONTSDIR%% || true
@exec mkdir -p %%LOCALFONTSDIR%%/TrueType
@exec ln -s -f %D/%%FONTSDIR%%/sazanami-mincho.ttf %%LOCALFONTSDIR%%/TrueType/sazanami-mincho.ttf
@exec ln -s -f %D/%%FONTSDIR%%/sazanami-gothic.ttf %%LOCALFONTSDIR%%/TrueType/sazanami-gothic.ttf
@unexec rm -f %%LOCALFONTSDIR%%/TrueType/sazanami-mincho.ttf
@unexec rm -f %%LOCALFONTSDIR%%/TrueType/sazanami-gothic.ttf
@unexec rmdir %%LOCALFONTSDIR%%/TrueType 2> /dev/null || true
@unexec rmdir %%LOCALFONTSDIR%% 2> /dev/null || true
@dirrmtry %%LOCALFONTSDIR%%/TrueType
@dirrmtry %%LOCALFONTSDIR%%
@unexec %%X11BASE%%/bin/fc-cache -f -v %D/%%FONTSDIR%% || true
@unexec if [ -s %D/%%FONTSDIR%%/fonts.cache-1 ]; then rm -f %D/%%FONTSDIR%%/fonts.cache-1; fi

View File

@ -7,6 +7,7 @@
PORTNAME= sazanami-ttf
PORTVERSION= 20040629
PORTREVISION= 1
CATEGORIES= japanese x11-fonts
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_JP}
MASTER_SITE_SUBDIR= efont/10087
@ -52,6 +53,9 @@ do-install:
${LN} -s -f \
${PREFIX}/${FONTSDIR}/sazanami-mincho.ttf \
${LOCALBASE}/${LOCALFONTSDIR}/TrueType/sazanami-mincho.ttf
${MKDIR} ${PREFIX}/etc/fonts/conf.d
${INSTALL_DATA} ${FILESDIR}/3.sazanami-ttf.conf \
${PREFIX}/etc/fonts/conf.d
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
.for F in ${DOC_FILES:Mdoc/*}
@ -62,6 +66,9 @@ do-install:
${INSTALL_DATA} ${WRKSRC}/${F} ${DOCSDIR}
.endfor
.endif
post-install:
${X11BASE}/bin/fc-cache -f -v ${PREFIX}/${FONTSDIR}
${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.include <bsd.port.mk>

View File

@ -0,0 +1,36 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- $FreeBSD$ -->
<fontconfig>
<alias>
<family>serif</family>
<prefer>
<family>Sazanami Mincho</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Sazanami Gothic</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Sazanami Gothic</family>
<family>Sazanami Mincho</family>
</prefer>
</alias>
<match target="font">
<test name="family">
<string>Sazanami Mincho</string>
<string>Sazanami Gothic</string>
</test>
<edit name="hintstyle">
<const>hintslight</const>
</edit>
<edit name="autohint">
<bool>false</bool>
</edit>
</match>
</fontconfig>

View File

@ -1,4 +1,5 @@
@comment $FreeBSD$
etc/fonts/conf.d/3.sazanami-ttf.conf
%%FONTSDIR%%/fonts.alias.sazanami
%%FONTSDIR%%/fonts.dir.sazanami
%%FONTSDIR%%/sazanami-mincho.ttf
@ -17,10 +18,13 @@
%%PORTDOCS%%@dirrm %%DOCSDIR%%/ayu
%%PORTDOCS%%@dirrm %%DOCSDIR%%/kappa
%%PORTDOCS%%@dirrm %%DOCSDIR%%
@exec %%X11BASE%%/bin/fc-cache -f -v %D/%%FONTSDIR%% || true
@exec mkdir -p %%LOCALFONTSDIR%%/TrueType
@exec ln -s -f %D/%%FONTSDIR%%/sazanami-mincho.ttf %%LOCALFONTSDIR%%/TrueType/sazanami-mincho.ttf
@exec ln -s -f %D/%%FONTSDIR%%/sazanami-gothic.ttf %%LOCALFONTSDIR%%/TrueType/sazanami-gothic.ttf
@unexec rm -f %%LOCALFONTSDIR%%/TrueType/sazanami-mincho.ttf
@unexec rm -f %%LOCALFONTSDIR%%/TrueType/sazanami-gothic.ttf
@unexec rmdir %%LOCALFONTSDIR%%/TrueType 2> /dev/null || true
@unexec rmdir %%LOCALFONTSDIR%% 2> /dev/null || true
@dirrmtry %%LOCALFONTSDIR%%/TrueType
@dirrmtry %%LOCALFONTSDIR%%
@unexec %%X11BASE%%/bin/fc-cache -f -v %D/%%FONTSDIR%% || true
@unexec if [ -s %D/%%FONTSDIR%%/fonts.cache-1 ]; then rm -f %D/%%FONTSDIR%%/fonts.cache-1; fi