diff options
author | tota <tota@FreeBSD.org> | 2011-08-15 15:03:55 +0800 |
---|---|---|
committer | tota <tota@FreeBSD.org> | 2011-08-15 15:03:55 +0800 |
commit | a544b4d1433b8fa9ccaee9ab182d5372630eb7f4 (patch) | |
tree | 4f5a129b699985ce08301fe890aabe44b974c0eb /japanese/alias-fonts | |
parent | 95783818cefc651b63cea05e93536707c6495e7f (diff) | |
download | freebsd-ports-gnome-a544b4d1433b8fa9ccaee9ab182d5372630eb7f4.tar.gz freebsd-ports-gnome-a544b4d1433b8fa9ccaee9ab182d5372630eb7f4.tar.zst freebsd-ports-gnome-a544b4d1433b8fa9ccaee9ab182d5372630eb7f4.zip |
- Use shell instead of perl for pkg-(de)install [1]
- Make portlint happy
PR: ports/157212 [1]
Submitted by: flz [1]
Diffstat (limited to 'japanese/alias-fonts')
-rw-r--r-- | japanese/alias-fonts/Makefile | 6 | ||||
-rw-r--r-- | japanese/alias-fonts/pkg-deinstall | 45 | ||||
-rw-r--r-- | japanese/alias-fonts/pkg-install | 56 |
3 files changed, 54 insertions, 53 deletions
diff --git a/japanese/alias-fonts/Makefile b/japanese/alias-fonts/Makefile index 95667cc53194..ef0f27c080a5 100644 --- a/japanese/alias-fonts/Makefile +++ b/japanese/alias-fonts/Makefile @@ -7,8 +7,9 @@ PORTNAME= alias-fonts PORTVERSION= 1.0 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= japanese x11-fonts +MASTER_SITES= # empty DISTFILES= # empty MAINTAINER= koma2@lovepeers.org @@ -27,12 +28,11 @@ BUILD_DEPENDS= bdftopcf:${PORTSDIR}/x11-fonts/bdftopcf \ mkfontscale:${PORTSDIR}/x11-fonts/mkfontscale NO_BUILD= yes -USE_PERL5= yes FONTSDIR= ${LOCALBASE}/lib/X11/fonts/local do-install: @${SETENV} PKG_PREFIX=${PREFIX} \ - ${PERL} ${PKGINSTALL} ${PKGNAME} POST-INSTALL + ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .include <bsd.port.mk> diff --git a/japanese/alias-fonts/pkg-deinstall b/japanese/alias-fonts/pkg-deinstall index 8a18e4a9cba8..3092b9f797fe 100644 --- a/japanese/alias-fonts/pkg-deinstall +++ b/japanese/alias-fonts/pkg-deinstall @@ -1,24 +1,25 @@ -#!/usr/bin/perl +#!/bin/sh # $FreeBSD$ -$prefix = $ENV{'PKG_PREFIX'}; -$dir = "$prefix/lib/X11/fonts/local"; -$to = "$dir/fonts.alias"; -$from = "$to.orig"; -rename($to, $from) || die("Can't rename: $!"); -open(IN, $from) || die("Can't open $from: $!"); -open(OUT, ">$to") || die("Can't open $to: $!"); -while (<IN>) { - chop; - if (/^\s*!/ || /^\s*$/) { - print OUT "$_\n"; - } - else { - @line = split(/\s+/, $_); - @elm = split(/-+/, $line[0]); - if ($elm[1] ne 'alias') { - print OUT "$_\n"; - } - } -} -#system("$prefix/bin/xset fp rehash"); +dir="${PKG_PREFIX}/lib/X11/fonts/local"; +to="$dir/fonts.alias"; +from="$to.orig"; + +if ! mv $to $from; then + echo "Couldn't rename $to." + exit 1 +fi + +IFS=" +" + +while read line; do + trimmed=${line# *} + case $trimmed in + !*|"") echo $line;; + -alias-*) echo $line;; + *) ;; + esac +done < $from > $to + +rm $from diff --git a/japanese/alias-fonts/pkg-install b/japanese/alias-fonts/pkg-install index 0a133141266f..b28bcfd2204c 100644 --- a/japanese/alias-fonts/pkg-install +++ b/japanese/alias-fonts/pkg-install @@ -1,29 +1,32 @@ -#!/usr/bin/perl +#!/bin/sh # $FreeBSD$ -$prefix = $ENV{'PKG_PREFIX'}; -$dir = "$prefix/lib/X11/fonts/local"; -$to = "$dir/fonts.alias"; -$from = "$to.orig"; -$option = $ARGV[1]; -exit 0 if $option ne 'POST-INSTALL'; -rename($to, $from) || die("Can't rename: $!"); -open(IN, $from) || die("Can't open $from: $!"); -open(OUT, ">$to") || die("Can't open $to: $!"); -while (<IN>) { - chop; - if (/^\s*!/ || /^\s*$/) { - print OUT "$_\n"; - } - else { - @line = split(/\s+/, $_); - @elm = split(/-+/, $line[0]); - if ($elm[1] ne 'alias') { - print OUT "$_\n"; - } - } -} -for (split(/\n/, <<"END")) +if [ $1 != "POST-INSTALL" ]; then + exit 0 +fi + +dir="${PKG_PREFIX}/lib/X11/fonts/local"; +to="$dir/fonts.alias"; +from="$to.orig"; + +if ! mv $to $from; then + echo "Couldn't rename $to." + exit 1 +fi + +IFS=" +" + +while read line; do + trimmed=${line# *} + case $trimmed in + !*|"") echo $line;; + -alias-*) echo $line;; + *) ;; + esac +done < $from > $to + +cat <<EOF >> $to -alias-fixed-medium-r-normal--24-234-75-75-c-120-iso8859-1 -sony-fixed-medium-r-normal--24-230-75-75-c-120-iso8859-1 -alias-fixed-medium-r-normal--20-190-75-75-c-200-iso8859-1 -kappa-fixed-medium-r-normal--20-190-75-75-c-100-iso8859-1 -alias-fixed-medium-i-normal--20-190-75-75-c-200-iso8859-1 -kappa-fixed-medium-i-normal--20-190-75-75-c-100-iso8859-1 @@ -138,7 +141,4 @@ for (split(/\n/, <<"END")) -alias-fixed-bold-i-normal--16-150-75-75-c-160-jisx0213.2000-1 -misc-fixed-bold-i-normal--16-150-75-75-c-160-jisx0213.2000-1 -alias-mincho-bold-r-normal--20-190-75-75-c-200-jisx0213.2000-1 -kappa-mincho-bold-r-normal--20-190-75-75-c-200-jisx0213.2000-1 -alias-mincho-bold-i-normal--20-190-75-75-c-200-jisx0213.2000-1 -kappa-mincho-bold-i-normal--20-190-75-75-c-200-jisx0213.2000-1 -END -{ - print OUT "$_\n"; -} +EOF |