1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-25 04:43:33 +00:00

Use MLINKS instead of .so directive against the problem of linked pages.

Submitted by:	Yasuhiro Fukuma <yasuf@big.or.jp> in ports-jp ML #7987
This commit is contained in:
SADA Kenji 1999-10-30 15:34:27 +00:00
parent 66b96f9bda
commit 96bbf588b8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=22727
6 changed files with 136 additions and 18 deletions

View File

@ -20,6 +20,7 @@ NO_MTREE= yes
PLIST= ${WRKDIR}/PLIST PLIST= ${WRKDIR}/PLIST
USE_BZIP2= yes USE_BZIP2= yes
WRKSRC= ${WRKDIR}/man/ja_JP.ujis WRKSRC= ${WRKDIR}/man/ja_JP.ujis
SCRIPTS_ENV+= MANSECS="${MANSECS}"
MANSECS= 1 3 5 MANSECS= 1 3 5
@ -27,15 +28,6 @@ post-extract:
.for i in Makefile Makefile.inc .for i in Makefile Makefile.inc
@${CP} ${FILESDIR}/$i ${WRKSRC} @${CP} ${FILESDIR}/$i ${WRKSRC}
.endfor .endfor
.for i in ${MANSECS}
@cd ${WRKSRC}/man$i; \
ls *.$ix|${AWK} 'BEGIN{printf"MAN$i ="}{printf"\\\n\t%s",$$0}' >Makefile; \
${ECHO} >>Makefile; \
${ECHO} pages-list: >>${WRKSRC}/man$i/Makefile; \
${ECHO} " @\$${ECHO} \$${MAN$i}" >>${WRKSRC}/man$i/Makefile; \
${ECHO} >>Makefile; \
${ECHO} '.include "bsd.prog.mk"' >>Makefile
.endfor
post-build: post-build:
@${RM} -f ${PLIST} @${RM} -f ${PLIST}

View File

@ -1,3 +1,23 @@
PREFIX?= /usr/local PREFIX?= /usr/local
MANDIR= ${PREFIX}/man/ja/man MANDIR= ${PREFIX}/man/ja/man
MROFF_CMD= /usr/local/bin/groff -Tnippon -man MROFF_CMD= /usr/local/bin/groff -Tnippon -man
NOMLINKS= yes
afterinstall:
.if defined(MLINKS) && !empty(MLINKS)
@set `echo ${MLINKS} " " | sed 's/\.\([^.]\)\([^.]*\) /.\1\2 \1 /g'`; \
while : ; do \
case $$# in \
0) break;; \
[123]) echo "warn: empty MLINK: $$1 $$2 $$3"; break;; \
esac; \
name=$$1; shift; sect=$$1; shift; \
l=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}/$$name; \
name=$$1; shift; sect=$$1; shift; \
t=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}/$$name; \
${ECHO} $${t}${ZEXT} -\> $${l}${ZEXT}; \
rm -f $${t} $${t}${MCOMPRESS_EXT}; \
ln $${l}${ZEXT} $${t}${ZEXT}; \
done
.endif

47
japanese/xjman-3/scripts/configure vendored Normal file
View File

@ -0,0 +1,47 @@
exec /usr/bin/perl -Sx "$0" ${1+"$@"}
#! perl
$WRKSRC = $ENV{'WRKSRC'};
@MANSECS = split(/\s+/, $ENV{'MANSECS'});
for $sec (@MANSECS) {
print "===> Creating Makefile in man${sec}\n";
chdir "$WRKSRC/man$sec";
@manpages = ();
@mlinks = ();
for $manpage (<*.${sec}x>) {
open(F, $manpage) || die "cannot open $manpage: $!\n";
$_ = <F>;
chop;
close(F);
if (/^\.so /) {
($real = $') =~ s!^man./!!;
push(@mlinks, "$real\t$manpage");
}
else {
push(@manpages, $manpage);
}
}
open(MAKEFILE, '>Makefile');
if (@manpages) {
print MAKEFILE join("\t\\\n\t", "MAN${sec} =", sort @manpages);
print MAKEFILE "\n\n";
}
if (@mlinks) {
print MAKEFILE join("\t\\\n\t", "MLINKS =", sort @mlinks);
print MAKEFILE "\n\n";
}
print MAKEFILE <<EOF;
pages-list:
@\${ECHO} \${MAN${sec}} \${MLINKS}
.include <bsd.prog.mk>
EOF
close(MAKEFILE);
}

View File

@ -20,6 +20,7 @@ NO_MTREE= yes
PLIST= ${WRKDIR}/PLIST PLIST= ${WRKDIR}/PLIST
USE_BZIP2= yes USE_BZIP2= yes
WRKSRC= ${WRKDIR}/man/ja_JP.ujis WRKSRC= ${WRKDIR}/man/ja_JP.ujis
SCRIPTS_ENV+= MANSECS="${MANSECS}"
MANSECS= 1 3 5 MANSECS= 1 3 5
@ -27,15 +28,6 @@ post-extract:
.for i in Makefile Makefile.inc .for i in Makefile Makefile.inc
@${CP} ${FILESDIR}/$i ${WRKSRC} @${CP} ${FILESDIR}/$i ${WRKSRC}
.endfor .endfor
.for i in ${MANSECS}
@cd ${WRKSRC}/man$i; \
ls *.$ix|${AWK} 'BEGIN{printf"MAN$i ="}{printf"\\\n\t%s",$$0}' >Makefile; \
${ECHO} >>Makefile; \
${ECHO} pages-list: >>${WRKSRC}/man$i/Makefile; \
${ECHO} " @\$${ECHO} \$${MAN$i}" >>${WRKSRC}/man$i/Makefile; \
${ECHO} >>Makefile; \
${ECHO} '.include "bsd.prog.mk"' >>Makefile
.endfor
post-build: post-build:
@${RM} -f ${PLIST} @${RM} -f ${PLIST}

View File

@ -1,3 +1,23 @@
PREFIX?= /usr/local PREFIX?= /usr/local
MANDIR= ${PREFIX}/man/ja/man MANDIR= ${PREFIX}/man/ja/man
MROFF_CMD= /usr/local/bin/groff -Tnippon -man MROFF_CMD= /usr/local/bin/groff -Tnippon -man
NOMLINKS= yes
afterinstall:
.if defined(MLINKS) && !empty(MLINKS)
@set `echo ${MLINKS} " " | sed 's/\.\([^.]\)\([^.]*\) /.\1\2 \1 /g'`; \
while : ; do \
case $$# in \
0) break;; \
[123]) echo "warn: empty MLINK: $$1 $$2 $$3"; break;; \
esac; \
name=$$1; shift; sect=$$1; shift; \
l=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}/$$name; \
name=$$1; shift; sect=$$1; shift; \
t=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}/$$name; \
${ECHO} $${t}${ZEXT} -\> $${l}${ZEXT}; \
rm -f $${t} $${t}${MCOMPRESS_EXT}; \
ln $${l}${ZEXT} $${t}${ZEXT}; \
done
.endif

47
japanese/xjman/scripts/configure vendored Normal file
View File

@ -0,0 +1,47 @@
exec /usr/bin/perl -Sx "$0" ${1+"$@"}
#! perl
$WRKSRC = $ENV{'WRKSRC'};
@MANSECS = split(/\s+/, $ENV{'MANSECS'});
for $sec (@MANSECS) {
print "===> Creating Makefile in man${sec}\n";
chdir "$WRKSRC/man$sec";
@manpages = ();
@mlinks = ();
for $manpage (<*.${sec}x>) {
open(F, $manpage) || die "cannot open $manpage: $!\n";
$_ = <F>;
chop;
close(F);
if (/^\.so /) {
($real = $') =~ s!^man./!!;
push(@mlinks, "$real\t$manpage");
}
else {
push(@manpages, $manpage);
}
}
open(MAKEFILE, '>Makefile');
if (@manpages) {
print MAKEFILE join("\t\\\n\t", "MAN${sec} =", sort @manpages);
print MAKEFILE "\n\n";
}
if (@mlinks) {
print MAKEFILE join("\t\\\n\t", "MLINKS =", sort @mlinks);
print MAKEFILE "\n\n";
}
print MAKEFILE <<EOF;
pages-list:
@\${ECHO} \${MAN${sec}} \${MLINKS}
.include <bsd.prog.mk>
EOF
close(MAKEFILE);
}