summaryrefslogtreecommitdiff
path: root/japanese
diff options
context:
space:
mode:
authorSADA Kenji <sada@FreeBSD.org>1999-10-30 15:34:27 +0000
committerSADA Kenji <sada@FreeBSD.org>1999-10-30 15:34:27 +0000
commit96bbf588b8f91c5eeaab71e431151f397ce1d056 (patch)
treeabadcc5513d1a594998ed38246ae4d21f53d069b /japanese
parentAdd another MASTER_SITE so the distfile is actually fetchable. (diff)
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
Notes
Notes: svn path=/head/; revision=22727
Diffstat (limited to 'japanese')
-rw-r--r--japanese/xjman-3/Makefile10
-rw-r--r--japanese/xjman-3/files/Makefile.inc20
-rw-r--r--japanese/xjman-3/scripts/configure47
-rw-r--r--japanese/xjman/Makefile10
-rw-r--r--japanese/xjman/files/Makefile.inc20
-rw-r--r--japanese/xjman/scripts/configure47
6 files changed, 136 insertions, 18 deletions
diff --git a/japanese/xjman-3/Makefile b/japanese/xjman-3/Makefile
index 71d5728a4dc3..85a79fca7202 100644
--- a/japanese/xjman-3/Makefile
+++ b/japanese/xjman-3/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-3/files/Makefile.inc b/japanese/xjman-3/files/Makefile.inc
index 89a79548f32a..25a10387c555 100644
--- a/japanese/xjman-3/files/Makefile.inc
+++ b/japanese/xjman-3/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-3/scripts/configure b/japanese/xjman-3/scripts/configure
new file mode 100644
index 000000000000..eb66aa645232
--- /dev/null
+++ b/japanese/xjman-3/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);
+}
diff --git a/japanese/xjman/Makefile b/japanese/xjman/Makefile
index 71d5728a4dc3..85a79fca7202 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 89a79548f32a..25a10387c555 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 000000000000..eb66aa645232
--- /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);
+}