summaryrefslogtreecommitdiffstats
path: root/japanese/xjman
diff options
context:
space:
mode:
authorsada <sada@FreeBSD.org>1999-10-30 15:34:27 +0000
committersada <sada@FreeBSD.org>1999-10-30 15:34:27 +0000
commit2331451a57d3ec995556e73217895010060497a8 (patch)
tree079bea0183e54be5aa6804edeb7378b612b5daa0 /japanese/xjman
parentfaa50b4b17bd6d5426a22498b55fe6e563530776 (diff)
downloadFreeBSD-ports-2331451a57d3ec995556e73217895010060497a8.zip
FreeBSD-ports-2331451a57d3ec995556e73217895010060497a8.tar.gz
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
Diffstat (limited to 'japanese/xjman')
-rw-r--r--japanese/xjman/Makefile10
-rw-r--r--japanese/xjman/files/Makefile.inc20
-rw-r--r--japanese/xjman/scripts/configure47
3 files changed, 68 insertions, 9 deletions
diff --git a/japanese/xjman/Makefile b/japanese/xjman/Makefile
index 71d5728..85a79fc 100644
--- a/japanese/xjman/Makefile
+++ b/japanese/xjman/Makefile
@@ -20,6 +20,7 @@ NO_MTREE= yes
PLIST= ${WRKDIR}/PLIST
USE_BZIP2= yes
WRKSRC= ${WRKDIR}/man/ja_JP.ujis
+SCRIPTS_ENV+= MANSECS="${MANSECS}"
MANSECS= 1 3 5
@@ -27,15 +28,6 @@ post-extract:
.for i in Makefile Makefile.inc
@${CP} ${FILESDIR}/$i ${WRKSRC}
.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:
@${RM} -f ${PLIST}
diff --git a/japanese/xjman/files/Makefile.inc b/japanese/xjman/files/Makefile.inc
index 89a7954..25a1038 100644
--- a/japanese/xjman/files/Makefile.inc
+++ b/japanese/xjman/files/Makefile.inc
@@ -1,3 +1,23 @@
PREFIX?= /usr/local
MANDIR= ${PREFIX}/man/ja/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
diff --git a/japanese/xjman/scripts/configure b/japanese/xjman/scripts/configure
new file mode 100644
index 0000000..eb66aa6
--- /dev/null
+++ b/japanese/xjman/scripts/configure
@@ -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);
+}
OpenPOWER on IntegriCloud