summaryrefslogtreecommitdiff
path: root/emulators/linux-locale/Makefile
blob: 19aadbeb5940c4628afbc095a2fd4ed485cfe555 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# $NetBSD: Makefile,v 1.19 2004/01/27 00:53:11 heinz Exp $

DISTNAME=	locales-2.1-1mdk
PKGNAME=	linux-locale-2.1.1
CATEGORIES=	emulators
MASTER_SITES=	http://www.linuxi18n.org/locales/
EXTRACT_SUFX=	.noarch.rpm
DISTFILES=	${DISTNAME}${EXTRACT_SUFX}

MAINTAINER=	sakamoto@NetBSD.org
HOMEPAGE=	http://www.linuxi18n.org/locales/
COMMENT=	Locales for Linux

BUILD_DEPENDS+=	rpm-[0-9]*:../../misc/rpm

.include "../../mk/bsd.prefs.mk"
.if !defined(LINUX_LOCALES)
LINUX_LOCALES= \
	af ar bg br ca cs cy da de el en eo es et eu fi fo fr ga gl \
	he hr hu hy id is it ja ka kl ko lo lt lv nl no oc pl pt ro \
	ru sk sl sr sv th tr uk vi wa zh
#	fa gd gv iu kw ml ms pd
.endif

.for locale in ${LINUX_LOCALES}
DISTFILES+=	locales-${locale}-2.1-1mdk${EXTRACT_SUFX}
.endfor

DIST_SUBDIR=	linux-locale

ONLY_FOR_PLATFORM=NetBSD-*-i386
DEPENDS=	suse_base>=6.3:../../emulators/${SUSE_DIR_PREFIX}_base

EXTRACT_ONLY=	# empty
NO_CONFIGURE=	yes
NO_BUILD=	yes

EMULSUBDIR=	emul/linux
EMULDIR=	${PREFIX}/${EMULSUBDIR}
PLIST_SRC=	${WRKDIR}/PLIST_DYNAMIC
EXCLUDELIST=	${WRKDIR}/EXCLUDE
CPIOLIST=	${WRKDIR}/CPIOLIST
CHECK_SHLIBS=	no

do-install:
	@${RM} -f ${CPIOLIST}
	@(cd ${EMULDIR}; \
		${FIND} usr/share/locale -name "*" -print > ${EXCLUDELIST})
.for f in ${DISTFILES}
	@rpm2cpio ${DISTDIR}/${DIST_SUBDIR}/${f} | \
		cpio -t -v -f -E ${EXCLUDELIST} >> ${CPIOLIST}
	@(cd ${EMULDIR}; rpm2cpio ${DISTDIR}/${DIST_SUBDIR}/${f} | \
		cpio -i -d -f -E ${EXCLUDELIST})
.endfor

post-install:
	@${CAT} ${CPIOLIST}|${GREP} "^d"|${SED} -e "s|.* \(usr\/.*\)|@exec ${MKDIR} ${EMULDIR}/\1|"|sort >> ${PLIST_SRC}
	@${CAT} ${CPIOLIST}|${GREP} "^-"|${SED} -e "s|.* \(usr\/.*\)|${EMULSUBDIR}/\1|"|sort >> ${PLIST_SRC}
	@${CAT} ${CPIOLIST}|${GREP} "^l"|${SED} -e "s|.* \(usr\/.*\) -> \(.*\)|@exec ln -s \2 %D/${EMULSUBDIR}/\1|"|sort >> ${PLIST_SRC}
	@${CAT} ${CPIOLIST}|${GREP} "^l"|${SED} -e "s|.* \(usr\/.*\) -> .*|@unexec rm -f %D/${EMULSUBDIR}/\1|"|sort >> ${PLIST_SRC}
	@${CAT} ${CPIOLIST}|${GREP} "^d"|${SED} -e "s|.* \(usr\/.*\)|@dirrm ${EMULSUBDIR}/\1|"|sort -r >> ${PLIST_SRC}

.include "../../emulators/suse_linux/Makefile.application"
.include "../../mk/bsd.pkg.mk"