head	1.17;
access;
symbols
	pkgsrc-2026Q1:1.17.0.50
	pkgsrc-2026Q1-base:1.17
	pkgsrc-2025Q4:1.17.0.48
	pkgsrc-2025Q4-base:1.17
	pkgsrc-2025Q3:1.17.0.46
	pkgsrc-2025Q3-base:1.17
	pkgsrc-2025Q2:1.17.0.44
	pkgsrc-2025Q2-base:1.17
	pkgsrc-2025Q1:1.17.0.42
	pkgsrc-2025Q1-base:1.17
	pkgsrc-2024Q4:1.17.0.40
	pkgsrc-2024Q4-base:1.17
	pkgsrc-2024Q3:1.17.0.38
	pkgsrc-2024Q3-base:1.17
	pkgsrc-2024Q2:1.17.0.36
	pkgsrc-2024Q2-base:1.17
	pkgsrc-2024Q1:1.17.0.34
	pkgsrc-2024Q1-base:1.17
	pkgsrc-2023Q4:1.17.0.32
	pkgsrc-2023Q4-base:1.17
	pkgsrc-2023Q3:1.17.0.30
	pkgsrc-2023Q3-base:1.17
	pkgsrc-2023Q2:1.17.0.28
	pkgsrc-2023Q2-base:1.17
	pkgsrc-2023Q1:1.17.0.26
	pkgsrc-2023Q1-base:1.17
	pkgsrc-2022Q4:1.17.0.24
	pkgsrc-2022Q4-base:1.17
	pkgsrc-2022Q3:1.17.0.22
	pkgsrc-2022Q3-base:1.17
	pkgsrc-2022Q2:1.17.0.20
	pkgsrc-2022Q2-base:1.17
	pkgsrc-2022Q1:1.17.0.18
	pkgsrc-2022Q1-base:1.17
	pkgsrc-2021Q4:1.17.0.16
	pkgsrc-2021Q4-base:1.17
	pkgsrc-2021Q3:1.17.0.14
	pkgsrc-2021Q3-base:1.17
	pkgsrc-2021Q2:1.17.0.12
	pkgsrc-2021Q2-base:1.17
	pkgsrc-2021Q1:1.17.0.10
	pkgsrc-2021Q1-base:1.17
	pkgsrc-2020Q4:1.17.0.8
	pkgsrc-2020Q4-base:1.17
	pkgsrc-2020Q3:1.17.0.6
	pkgsrc-2020Q3-base:1.17
	pkgsrc-2020Q2:1.17.0.4
	pkgsrc-2020Q2-base:1.17
	pkgsrc-2020Q1:1.17.0.2
	pkgsrc-2020Q1-base:1.17
	pkgsrc-2019Q4:1.16.0.40
	pkgsrc-2019Q4-base:1.16
	pkgsrc-2019Q3:1.16.0.36
	pkgsrc-2019Q3-base:1.16
	pkgsrc-2019Q2:1.16.0.34
	pkgsrc-2019Q2-base:1.16
	pkgsrc-2019Q1:1.16.0.32
	pkgsrc-2019Q1-base:1.16
	pkgsrc-2018Q4:1.16.0.30
	pkgsrc-2018Q4-base:1.16
	pkgsrc-2018Q3:1.16.0.28
	pkgsrc-2018Q3-base:1.16
	pkgsrc-2018Q2:1.16.0.26
	pkgsrc-2018Q2-base:1.16
	pkgsrc-2018Q1:1.16.0.24
	pkgsrc-2018Q1-base:1.16
	pkgsrc-2017Q4:1.16.0.22
	pkgsrc-2017Q4-base:1.16
	pkgsrc-2017Q3:1.16.0.20
	pkgsrc-2017Q3-base:1.16
	pkgsrc-2017Q2:1.16.0.16
	pkgsrc-2017Q2-base:1.16
	pkgsrc-2017Q1:1.16.0.14
	pkgsrc-2017Q1-base:1.16
	pkgsrc-2016Q4:1.16.0.12
	pkgsrc-2016Q4-base:1.16
	pkgsrc-2016Q3:1.16.0.10
	pkgsrc-2016Q3-base:1.16
	pkgsrc-2016Q2:1.16.0.8
	pkgsrc-2016Q2-base:1.16
	pkgsrc-2016Q1:1.16.0.6
	pkgsrc-2016Q1-base:1.16
	pkgsrc-2015Q4:1.16.0.4
	pkgsrc-2015Q4-base:1.16
	pkgsrc-2015Q3:1.16.0.2
	pkgsrc-2015Q3-base:1.16
	pkgsrc-2015Q2:1.15.0.22
	pkgsrc-2015Q2-base:1.15
	pkgsrc-2015Q1:1.15.0.20
	pkgsrc-2015Q1-base:1.15
	pkgsrc-2014Q4:1.15.0.18
	pkgsrc-2014Q4-base:1.15
	pkgsrc-2014Q3:1.15.0.16
	pkgsrc-2014Q3-base:1.15
	pkgsrc-2014Q2:1.15.0.14
	pkgsrc-2014Q2-base:1.15
	pkgsrc-2014Q1:1.15.0.12
	pkgsrc-2014Q1-base:1.15
	pkgsrc-2013Q4:1.15.0.10
	pkgsrc-2013Q4-base:1.15
	pkgsrc-2013Q3:1.15.0.8
	pkgsrc-2013Q3-base:1.15
	pkgsrc-2013Q2:1.15.0.6
	pkgsrc-2013Q2-base:1.15
	pkgsrc-2013Q1:1.15.0.4
	pkgsrc-2013Q1-base:1.15
	pkgsrc-2012Q4:1.15.0.2
	pkgsrc-2012Q4-base:1.15
	pkgsrc-2012Q3:1.14.0.26
	pkgsrc-2012Q3-base:1.14
	pkgsrc-2012Q2:1.14.0.24
	pkgsrc-2012Q2-base:1.14
	pkgsrc-2012Q1:1.14.0.22
	pkgsrc-2012Q1-base:1.14
	pkgsrc-2011Q4:1.14.0.20
	pkgsrc-2011Q4-base:1.14
	pkgsrc-2011Q3:1.14.0.18
	pkgsrc-2011Q3-base:1.14
	pkgsrc-2011Q2:1.14.0.16
	pkgsrc-2011Q2-base:1.14
	pkgsrc-2011Q1:1.14.0.14
	pkgsrc-2011Q1-base:1.14
	pkgsrc-2010Q4:1.14.0.12
	pkgsrc-2010Q4-base:1.14
	pkgsrc-2010Q3:1.14.0.10
	pkgsrc-2010Q3-base:1.14
	pkgsrc-2010Q2:1.14.0.8
	pkgsrc-2010Q2-base:1.14
	pkgsrc-2010Q1:1.14.0.6
	pkgsrc-2010Q1-base:1.14
	pkgsrc-2009Q4:1.14.0.4
	pkgsrc-2009Q4-base:1.14
	pkgsrc-2009Q3:1.14.0.2
	pkgsrc-2009Q3-base:1.14
	pkgsrc-2009Q2:1.13.0.24
	pkgsrc-2009Q2-base:1.13
	pkgsrc-2009Q1:1.13.0.22
	pkgsrc-2009Q1-base:1.13
	pkgsrc-2008Q4:1.13.0.20
	pkgsrc-2008Q4-base:1.13
	pkgsrc-2008Q3:1.13.0.18
	pkgsrc-2008Q3-base:1.13
	cube-native-xorg:1.13.0.16
	cube-native-xorg-base:1.13
	pkgsrc-2008Q2:1.13.0.14
	pkgsrc-2008Q2-base:1.13
	cwrapper:1.13.0.12
	pkgsrc-2008Q1:1.13.0.10
	pkgsrc-2008Q1-base:1.13
	pkgsrc-2007Q4:1.13.0.8
	pkgsrc-2007Q4-base:1.13
	pkgsrc-2007Q3:1.13.0.6
	pkgsrc-2007Q3-base:1.13
	pkgsrc-2007Q2:1.13.0.4
	pkgsrc-2007Q2-base:1.13
	pkgsrc-2007Q1:1.13.0.2
	pkgsrc-2007Q1-base:1.13
	pkgsrc-2006Q4:1.11.0.4
	pkgsrc-2006Q4-base:1.11
	pkgsrc-2006Q3:1.11.0.2
	pkgsrc-2006Q3-base:1.11
	pkgsrc-2006Q2:1.10.0.4
	pkgsrc-2006Q2-base:1.10
	pkgsrc-2006Q1:1.10.0.2
	pkgsrc-2006Q1-base:1.10
	pkgsrc-2005Q4:1.9.0.2
	pkgsrc-2005Q4-base:1.9
	pkgsrc-2005Q3:1.7.0.4
	pkgsrc-2005Q3-base:1.7
	pkgsrc-2005Q2:1.7.0.2
	pkgsrc-2005Q2-base:1.7
	pkgsrc-2005Q1:1.5.0.10
	pkgsrc-2005Q1-base:1.5
	pkgsrc-2004Q4:1.5.0.8
	pkgsrc-2004Q4-base:1.5
	pkgsrc-2004Q3:1.5.0.6
	pkgsrc-2004Q3-base:1.5
	pkgsrc-2004Q2:1.5.0.4
	pkgsrc-2004Q2-base:1.5
	pkgsrc-2004Q1:1.5.0.2
	pkgsrc-2004Q1-base:1.5
	pkgsrc-2003Q4:1.3.0.2
	pkgsrc-2003Q4-base:1.3
	netbsd-1-6-1:1.1.1.1.0.4
	netbsd-1-6-1-base:1.1
	netbsd-1-6:1.1.1.1.0.6
	netbsd-1-6-RELEASE-base:1.1
	pkgviews:1.1.1.1.0.8
	pkgviews-base:1.1
	buildlink2-base:1.1.1.1
	buildlink2:1.1.1.1.0.2
	pkgsrc-base:1.1.1.1
	TNF:1.1.1;
locks; strict;
comment	@# @;


1.17
date	2020.01.26.17.32.28;	author rillig;	state Exp;
branches;
next	1.16;
commitid	4fBBvoSLJaGd0eUB;

1.16
date	2015.07.04.16.18.43;	author joerg;	state Exp;
branches;
next	1.15;
commitid	EoZkjndZ4qhBbZry;

1.15
date	2012.10.29.05.07.12;	author asau;	state Exp;
branches;
next	1.14;

1.14
date	2009.10.07.14.59.35;	author joerg;	state Exp;
branches;
next	1.13;

1.13
date	2007.03.24.19.21.34;	author joerg;	state Exp;
branches;
next	1.12;

1.12
date	2007.01.15.18.23.21;	author joerg;	state Exp;
branches;
next	1.11;

1.11
date	2006.09.03.00.56.30;	author wiz;	state Exp;
branches;
next	1.10;

1.10
date	2006.02.05.23.11.47;	author joerg;	state Exp;
branches;
next	1.9;

1.9
date	2005.12.05.20.51.20;	author rillig;	state Exp;
branches;
next	1.8;

1.8
date	2005.10.23.22.03.21;	author rillig;	state Exp;
branches;
next	1.7;

1.7
date	2005.06.01.18.03.32;	author jlam;	state Exp;
branches;
next	1.6;

1.6
date	2005.03.24.21.13.04;	author wiz;	state Exp;
branches;
next	1.5;

1.5
date	2004.01.27.00.53.10;	author heinz;	state Exp;
branches;
next	1.4;

1.4
date	2004.01.20.12.28.28;	author agc;	state Exp;
branches;
next	1.3;

1.3
date	2003.07.17.22.56.58;	author grant;	state Exp;
branches;
next	1.2;

1.2
date	2003.03.29.12.43.13;	author jmmv;	state Exp;
branches;
next	1.1;

1.1
date	2002.05.31.13.01.36;	author seb;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2002.05.31.13.01.36;	author seb;	state Exp;
branches
	1.1.1.1.2.1;
next	;

1.1.1.1.2.1
date	2002.05.31.13.01.36;	author jlam;	state dead;
branches;
next	1.1.1.1.2.2;

1.1.1.1.2.2
date	2002.06.23.19.07.14;	author jlam;	state Exp;
branches;
next	;


desc
@@


1.17
log
@all: migrate homepages from http to https

pkglint -r --network --only "migrate"

As a side-effect of migrating the homepages, pkglint also fixed a few
indentations in unrelated lines. These and the new homepages have been
checked manually.
@
text
@# $NetBSD: Makefile,v 1.16 2015/07/04 16:18:43 joerg Exp $

DISTNAME=	xjman-0.5
PKGREVISION=	2
CATEGORIES=	japanese x11
MASTER_SITES=	http://xjman.dsl.gr.jp/
EXTRACT_SUFX=	.tar.bz2

MAINTAINER=	pkgsrc-users@@NetBSD.org
HOMEPAGE=	https://xjman.dsl.gr.jp/
COMMENT=	Japanized X manual from "The X Japanese Documentation Project"

DEPENDS+=	ja-man-[0-9]*:../../misc/ja-man

WRKSRC=		${WRKDIR}/man/ja_JP.eucJP
PLIST_SRC=	${WRKDIR}/PLIST
XJMANDIR=	man/ja_JP.EUC
MAKE_ENV+=	XJMANDIR=${XJMANDIR:Q}

USE_BSD_MAKEFILE=	yes

NO_CONFIGURE=	yes

MANCOMPRESSED_IF_MANZ=	yes

.include "../../mk/bsd.prefs.mk"

post-extract:
.for f in Makefile Makefile.inc
	@@${CP} ${FILESDIR}/${f} ${WRKSRC}
.endfor

pre-build:
.for dir in man1 man3 man5
	@@(cd ${WRKSRC}/${dir};					\
	  for file in *; do					\
		f=`${ECHO} $$file|${SED} -e 's|x$$||'`;		\
		mlink=`head -1 $$file|${GREP} '^\.so man./'|	\
			${SED} -e 's|.*man./\(.*\)x|\1|'`; 	\
		if [ "$$mlink" = "" ]; then			\
			${ECHO} "MAN+= $$f" >> Makefile;	\
			${MV} $$file $$f;			\
		else						\
			${ECHO} "MLINKS+= $$mlink $$f" >> Makefile;	\
			${SED} -e 's|x$$||' $$file > $$f;	\
			${RM} $$file;				\
		fi;						\
	  done;							\
	  ${ECHO} ".include <bsd.prog.mk>" >> Makefile;		\
	  )
.endfor

MKCATPAGES?=	yes

post-build:
	@@${CP} ${PKGDIR}/PLIST ${PLIST_SRC}
	@@(cd ${WRKSRC};						\
	  ${FIND} man1/*.1 man3/*.3 man5/*.5 -type f -print |	\
		${SED} -e 's|^|${XJMANDIR}/|' | ${SORT} >> ${PLIST_SRC})
.if ${MKCATPAGES} != no
	@@(cd ${WRKSRC};						\
	  ${FIND} man1/*.1 man3/*.3 man5/*.5 -type f -print |	\
		${SED} -e 's|^|${XJMANDIR}/|'			\
		       -e 's|man[135]\(/.*\)\.\([135]\)$$|cat\2\1.0|' | \
		${SORT} >> ${PLIST_SRC})
.endif

INSTALLATION_DIRS=	${PKGMANDIR}/ja_JP.EUC/cat1 ${PKGMANDIR}/ja_JP.EUC/man1 \
			${PKGMANDIR}/ja_JP.EUC/cat3 ${PKGMANDIR}/ja_JP.EUC/man3 \
			${PKGMANDIR}/ja_JP.EUC/cat5 ${PKGMANDIR}/ja_JP.EUC/man5 \
			share/doc/xjman

post-install:
.for i in COPYRIGHT COPYRIGHT.XJDP
	@@${INSTALL_DATA} ${FILESDIR}/${i} ${DESTDIR}${PREFIX}/share/doc/xjman
.endfor
	@@${INSTALL_DATA} ${WRKDIR}/man/README ${DESTDIR}${PREFIX}/share/doc/xjman

.include "../../mk/bsd.pkg.mk"
@


1.16
log
@Remove USE_X11BASE and X11PREFIX.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.15 2012/10/29 05:07:12 asau Exp $
d10 1
a10 1
HOMEPAGE=	http://xjman.dsl.gr.jp/
@


1.15
log
@Drop superfluous PKG_DESTDIR_SUPPORT, "user-destdir" is default these days.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.14 2009/10/07 14:59:35 joerg Exp $
a15 1
USE_X11BASE=	yes
@


1.14
log
@DESTDIR support. Fix build on NetBSD 5.0+
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.13 2007/03/24 19:21:34 joerg Exp $
a12 2
PKG_DESTDIR_SUPPORT=	user-destdir

@


1.13
log
@Prepare for switching to NO_MTREE=yes.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.12 2007/01/15 18:23:21 joerg Exp $
d13 2
d23 2
d72 3
a74 1
			${PKGMANDIR}/ja_JP.EUC/cat3 ${PKGMANDIR}/ja_JP.EUC/man3 share/doc/xjman
d78 1
a78 1
	@@${INSTALL_DATA} ${FILESDIR}/${i} ${PREFIX}/share/doc/xjman
d80 1
a80 1
	@@${INSTALL_DATA} ${WRKDIR}/man/README ${PREFIX}/share/doc/xjman
@


1.12
log
@Don't depend on X11 for a bunch of man pags. Bump revision.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.11 2006/09/03 00:56:30 wiz Exp $
d67 3
a70 1
	@@${INSTALL_DATA_DIR} ${PREFIX}/share/doc/xjman
@


1.11
log
@Reset maintainer for people who lost their commit bit.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.10 2006/02/05 23:11:47 joerg Exp $
d4 1
a4 1
PKGREVISION=	1
a25 1
.include "../../mk/x11.buildlink3.mk"
@


1.10
log
@Recursive revision bump / recommended bump for gettext ABI change.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.9 2005/12/05 20:51:20 rillig Exp $
d9 1
a9 1
MAINTAINER=	sakamoto@@NetBSD.org
@


1.9
log
@Fixed pkglint warnings. The warnings are mostly quoting issues, for
example MAKE_ENV+=FOO=${BAR} is changed to MAKE_ENV+=FOO=${BAR:Q}. Some
other changes are outlined in

    http://mail-index.netbsd.org/tech-pkg/2005/12/02/0034.html
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.8 2005/10/23 22:03:21 rillig Exp $
d4 1
@


1.8
log
@Replaced sort with ${SORT}. Replaced $i with ${i} to fix some pkglint
warnings.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.7 2005/06/01 18:03:32 jlam Exp $
d18 1
a18 1
MAKE_ENV+=	XJMANDIR=${XJMANDIR}
@


1.7
log
@Massive cleanup of buildlink3.mk and builtin.mk files in pkgsrc.
Several changes are involved since they are all interrelated.  These
changes affect about 1000 files.

The first major change is rewriting bsd.builtin.mk as well as all of
the builtin.mk files to follow the new example in bsd.builtin.mk.
The loop to include all of the builtin.mk files needed by the package
is moved from bsd.builtin.mk and into bsd.buildlink3.mk.  bsd.builtin.mk
is now included by each of the individual builtin.mk files and provides
some common logic for all of the builtin.mk files.  Currently, this
includes the computation for whether the native or pkgsrc version of
the package is preferred.  This causes USE_BUILTIN.* to be correctly
set when one builtin.mk file includes another.

The second major change is teach the builtin.mk files to consider
files under ${LOCALBASE} to be from pkgsrc-controlled packages.  Most
of the builtin.mk files test for the presence of built-in software by
checking for the existence of certain files, e.g. <pthread.h>, and we
now assume that if that file is under ${LOCALBASE}, then it must be
from pkgsrc.  This modification is a nod toward LOCALBASE=/usr.  The
exceptions to this new check are the X11 distribution packages, which
are handled specially as noted below.

The third major change is providing builtin.mk and version.mk files
for each of the X11 distribution packages in pkgsrc.  The builtin.mk
file can detect whether the native X11 distribution is the same as
the one provided by pkgsrc, and the version.mk file computes the
version of the X11 distribution package, whether it's built-in or not.

The fourth major change is that the buildlink3.mk files for X11 packages
that install parts which are part of X11 distribution packages, e.g.
Xpm, Xcursor, etc., now use imake to query the X11 distribution for
whether the software is already provided by the X11 distribution.
This is more accurate than grepping for a symbol name in the imake
config files.  Using imake required sprinkling various builtin-imake.mk
helper files into pkgsrc directories.  These files are used as input
to imake since imake can't use stdin for that purpose.

The fifth major change is in how packages note that they use X11.
Instead of setting USE_X11, package Makefiles should now include
x11.buildlink3.mk instead.  This causes the X11 package buildlink3
and builtin logic to be executed at the correct place for buildlink3.mk
and builtin.mk files that previously set USE_X11, and fixes packages
that relied on buildlink3.mk files to implicitly note that X11 is
needed.  Package buildlink3.mk should also include x11.buildlink3.mk
when linking against the package libraries requires also linking
against the X11 libraries.  Where it was obvious, redundant inclusions
of x11.buildlink3.mk have been removed.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.6 2005/03/24 21:13:04 wiz Exp $
d58 1
a58 1
		${SED} -e 's|^|${XJMANDIR}/|' | sort >> ${PLIST_SRC})
d64 1
a64 1
		sort >> ${PLIST_SRC})
d70 1
a70 1
	@@${INSTALL_DATA} ${FILESDIR}/$i ${PREFIX}/share/doc/xjman
@


1.6
log
@Remove FreeBSD RCS Ids. pkgsrc has diverged too much for syncing to be
useful.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.5 2004/01/27 00:53:10 heinz Exp $
d25 1
@


1.5
log
@Use $FIND with "-print". Noted by Georg Schwarz in PR pkg/24248
@
text
@d1 1
a1 2
# $NetBSD: Makefile,v 1.4 2004/01/20 12:28:28 agc Exp $
# FreeBSD Id: ports/japanese/xjman/Makefile,v 1.10 1999/10/30 15:34:24 sada Exp
@


1.4
log
@Move WRKSRC definition away from the first paragraph in a Makefile.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.3 2003/07/17 22:56:58 grant Exp $
d57 1
a57 1
	  ${FIND} man1/*.1 man3/*.3 man5/*.5 -type f |		\
d61 1
a61 1
	  ${FIND} man1/*.1 man3/*.3 man5/*.5 -type f |		\
@


1.3
log
@s/netbsd.org/NetBSD.org/
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.2 2003/03/29 12:43:13 jmmv Exp $
a4 1
WRKSRC=		${WRKDIR}/man/ja_JP.eucJP
d15 1
@


1.2
log
@Place WRKSRC where it belongs, to make pkglint happy; ok'ed by wiz.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.1 2002/05/31 13:01:36 seb Exp $
d10 1
a10 1
MAINTAINER=	sakamoto@@netbsd.org
@


1.1
log
@Initial revision
@
text
@d1 1
a1 1
# $NetBSD$
d5 1
a17 1
WRKSRC=		${WRKDIR}/man/ja_JP.eucJP
@


1.1.1.1
log
@Reimport of package xjman from japanese/xjman into x11/xjman.
This is part of the japanese category retirement.
Pathnames to japanese/ adjusted.
@
text
@@


1.1.1.1.2.1
log
@file Makefile was added on branch buildlink2 on 2002-06-23 19:07:14 +0000
@
text
@d1 74
@


1.1.1.1.2.2
log
@Merge from pkgsrc-current to buildlink2 branch.
@
text
@a0 74
# $NetBSD: Makefile,v 1.1.1.1.2.1 2002/06/23 19:07:14 jlam Exp $
# FreeBSD Id: ports/japanese/xjman/Makefile,v 1.10 1999/10/30 15:34:24 sada Exp

DISTNAME=	xjman-0.5
CATEGORIES=	japanese x11
MASTER_SITES=	http://xjman.dsl.gr.jp/
EXTRACT_SUFX=	.tar.bz2

MAINTAINER=	sakamoto@@netbsd.org
HOMEPAGE=	http://xjman.dsl.gr.jp/
COMMENT=	Japanized X manual from "The X Japanese Documentation Project"

DEPENDS+=	ja-man-[0-9]*:../../misc/ja-man

USE_X11BASE=	yes
PLIST_SRC=	${WRKDIR}/PLIST
WRKSRC=		${WRKDIR}/man/ja_JP.eucJP
XJMANDIR=	man/ja_JP.EUC
MAKE_ENV+=	XJMANDIR=${XJMANDIR}

NO_CONFIGURE=	yes

MANCOMPRESSED_IF_MANZ=	yes

.include "../../mk/bsd.prefs.mk"

post-extract:
.for f in Makefile Makefile.inc
	@@${CP} ${FILESDIR}/${f} ${WRKSRC}
.endfor

pre-build:
.for dir in man1 man3 man5
	@@(cd ${WRKSRC}/${dir};					\
	  for file in *; do					\
		f=`${ECHO} $$file|${SED} -e 's|x$$||'`;		\
		mlink=`head -1 $$file|${GREP} '^\.so man./'|	\
			${SED} -e 's|.*man./\(.*\)x|\1|'`; 	\
		if [ "$$mlink" = "" ]; then			\
			${ECHO} "MAN+= $$f" >> Makefile;	\
			${MV} $$file $$f;			\
		else						\
			${ECHO} "MLINKS+= $$mlink $$f" >> Makefile;	\
			${SED} -e 's|x$$||' $$file > $$f;	\
			${RM} $$file;				\
		fi;						\
	  done;							\
	  ${ECHO} ".include <bsd.prog.mk>" >> Makefile;		\
	  )
.endfor

MKCATPAGES?=	yes

post-build:
	@@${CP} ${PKGDIR}/PLIST ${PLIST_SRC}
	@@(cd ${WRKSRC};						\
	  ${FIND} man1/*.1 man3/*.3 man5/*.5 -type f |		\
		${SED} -e 's|^|${XJMANDIR}/|' | sort >> ${PLIST_SRC})
.if ${MKCATPAGES} != no
	@@(cd ${WRKSRC};						\
	  ${FIND} man1/*.1 man3/*.3 man5/*.5 -type f |		\
		${SED} -e 's|^|${XJMANDIR}/|'			\
		       -e 's|man[135]\(/.*\)\.\([135]\)$$|cat\2\1.0|' | \
		sort >> ${PLIST_SRC})
.endif

post-install:
	@@${INSTALL_DATA_DIR} ${PREFIX}/share/doc/xjman
.for i in COPYRIGHT COPYRIGHT.XJDP
	@@${INSTALL_DATA} ${FILESDIR}/$i ${PREFIX}/share/doc/xjman
.endfor
	@@${INSTALL_DATA} ${WRKDIR}/man/README ${PREFIX}/share/doc/xjman

.include "../../mk/bsd.pkg.mk"
@
