summaryrefslogtreecommitdiff
path: root/emulators/suse100_linux/Makefile.common
blob: bde7eaeb487dc4ee899c229631759f95a15a761a (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# $NetBSD: Makefile.common,v 1.15 2007/05/04 23:46:56 xtraeme Exp $

.include "../../emulators/suse100_linux/vars.mk"
.include "../../emulators/suse100_linux/compat32.mk"
.include "../../emulators/suse100_linux/arch.mk"

ONLY_FOR_PLATFORM+=	NetBSD-[2-9]*-i386 NetBSD-3.99*-x86_64 \
			NetBSD-[2-9]*-powerpc \
			NetBSD-[4-9]*-x86_64 FreeBSD-*-i386 \
			DragonFly-*-i386

_SUSE_FTP_SUBDIR=	distribution/SL-${SUSE_VERSION}-OSS/inst-source/suse/${SUSE_ARCH}/
_SUSE_FTP_SUBDIR_UPD=	suse/${SUSE_ARCH_DIR}/update/${SUSE_VERSION}/rpm/${SUSE_ARCH}/

MASTER_SITE_SUSE100?= \
	ftp://suse.inode.at/opensuse/${_SUSE_FTP_SUBDIR} \
	http://suse.inode.at/opensuse/${_SUSE_FTP_SUBDIR} \
	ftp://suse.inode.at/pub/update/${SUSE_VERSION}/rpm/${SUSE_ARCH}/ \
	http://suse.inode.at/pub/update/${SUSE_VERSION}/rpm/${SUSE_ARCH}/ \
	ftp://ftp.gwdg.de/pub/opensuse/${_SUSE_FTP_SUBDIR} \
	ftp://ftp.gwdg.de/pub/linux/suse/ftp.suse.com/${_SUSE_FTP_SUBDIR_UPD} \
	ftp://gd.tuwien.ac.at/linux/opensuse/${_SUSE_FTP_SUBDIR} \
	http://gd.tuwien.ac.at/linux/suse.com/${_SUSE_FTP_SUBDIR_UPD} \
	ftp://gd.tuwien.ac.at/linux/suse.com/${_SUSE_FTP_SUBDIR_UPD} \
	ftp://mirror.karneval.cz/pub/opensuse/${_SUSE_FTP_SUBDIR:S,distribution/,,} \
	ftp://ftp.suse.com/pub/${_SUSE_FTP_SUBDIR_UPD}

.ifndef SUSE_COMPAT32
DIST_SUBDIR?=		suse${SUSE_VERSION:S/.//}/${SUSE_ARCH}
.endif

WRKSRC?=		${WRKDIR}
MANCOMPRESSED?=		yes

# Don't check any script interpreter, as long as nobody complains.
CHECK_INTERPRETER_SKIP=	*

OPSYS_EMULSUBDIR=	linux${SUSE_COMPAT32_SUFFIX}
EMULSUBDIR=		emul/linux${SUSE_COMPAT32_SUFFIX}
EMULDIR=		${PREFIX}/${EMULSUBDIR}

# Set location of OPSYS-specific emulation directory
.if ${OPSYS} == "NetBSD"
.  ifndef SUSE_COMPAT32
OPSYS_EMULDIR=		/${EMULSUBDIR}
.  else
OPSYS_EMULDIR=		${EMULSUBDIR}
.  endif
.elif (${OPSYS} == "FreeBSD") || (${OPSYS} == "DragonFly")
OPSYS_EMULDIR=		/compat/${EMULSUBDIR:T}
.else
OPSYS_EMULDIR=		/${EMULSUBDIR}
.endif
FILES_SUBST+=		OPSYS_EMULDIR=${OPSYS_EMULDIR:Q} \
			OPSYS_EMULSUBDIR=${OPSYS_EMULSUBDIR:Q}

.ifdef SUSE_COMPAT32
PLIST_SUBST+=		${FILES_SUBST}
.endif

RPM2PKG=		${PREFIX}/sbin/rpm2pkg
BUILD_DEPENDS+=		rpm2pkg>=2.1:../../pkgtools/rpm2pkg

BUILD_DEFS+=		RPMFILES
.if defined(RPMIGNOREPATH)
BUILD_DEFS+=		RPMIGNOREPATH
.endif

# The SuSE Linux packages have circular dependencies.
LDD?=			${TRUE}

.ifndef SUSE_COMPAT32
RPM2PKGSTRIP?=		1
RPM2PKGARGS?=		-d ${PREFIX} -f ${PLIST_SRC} -p ${EMULSUBDIR}
.  if empty(RPM2PKGSTRIP:M0)
RPM2PKGARGS+=		-s ${RPM2PKGSTRIP}
.  endif
.  for TEMP in ${RPMIGNOREPATH}
RPM2PKGARGS+=		-i ${TEMP}
.  endfor
.  for TEMP in ${RPMFILES}
RPM2PKGARGS+=		${DISTDIR}/${DIST_SUBDIR}/${TEMP}
.  endfor
.endif

# regenerate distinfo for all platforms supported by the suse100_* packages
suse100-distinfo:
	( ${ECHO} '$$'NetBSD'$$';			\
	${ECHO} '';					\
	MACHINE_ARCH=i386 ${MAKE} distinfo 1>&2;	\
		${GREP} rpm distinfo;			\
	MACHINE_ARCH=powerpc ${MAKE} distinfo 1>&2;	\
		${GREP} rpm distinfo;			\
	MACHINE_ARCH=x86_64 ${MAKE} distinfo 1>&2;	\
		${GREP} rpm distinfo;			\
	) > distinfo.new
	${MV} -f distinfo.new distinfo

.ifdef SUSE_COMPAT32_SUFFIX
LOCAL_ARCH=	i386
.else
LOCAL_ARCH=	${MACHINE_ARCH}
.endif

.if empty(${.CURDIR:Msuse100_base}) && !defined(SUSE_COMPAT32)
.  if !target(do-install)
do-install:
	@if [ -f ${PKGDIR}/PLIST ]; then \
	  ${CP} ${PKGDIR}/PLIST ${PLIST_SRC}; \
	else \
	  ${RM} -f ${PLIST_SRC}; \
	  ${CP} ${PKGSRCDIR}/emulators/suse_linux/PLIST_dynamic ${PLIST_SRC} ; \
	fi
	@if [ -f ${PKGDIR}/PLIST_rpmfix.${LOCAL_ARCH} ]; then \
	    ${SED} -e 's,^/,${EMULSUBDIR}/,' \
	    	${PKGDIR}/PLIST_rpmfix.${LOCAL_ARCH} >> ${PLIST_SRC}; \
	fi
	${RPM2PKG} ${RPM2PKGARGS}
	@if ${GREP} -q 'lib.*\.so' ${PLIST_SRC}; then \
	  ${ECHO_MSG} "===> [Automatic Linux shared object handling]"; \
	  ${EMULDIR}/sbin/ldconfig -r ${EMULDIR}; \
	  ${MV} -f ${PLIST_SRC} ${PLIST_SRC}.old; \
	  ${GREP} -v '^@dirrm' ${PLIST_SRC}.old >${PLIST_SRC} || ${TRUE}; \
	  ${ECHO} "@exec %D/${EMULSUBDIR}/sbin/ldconfig -r %D/${EMULSUBDIR}" >>${PLIST_SRC}; \
	  ${ECHO} "@unexec %D/${EMULSUBDIR}/sbin/ldconfig -r %D/${EMULSUBDIR} 2>/dev/null" >>${PLIST_SRC}; \
	  ${GREP} '^@dirrm' ${PLIST_SRC}.old >>${PLIST_SRC} || ${TRUE}; \
	  ${RM} -f ${PLIST_SRC}.old; \
	fi
.  endif
.endif