View | Details | Raw Unified | Return to bug 90031
Collapse All | Expand All

(-)bsd.linux-rpm.mk (+90 lines)
Line 0 Link Here
1
#-*- mode: Makefile; tab-width: 4; -*-
2
# ex:ts=4
3
#
4
# $FreeBSD$
5
#
6
7
.if !defined(_POSTMKINCLUDED) && !defined(Linux_RPM_Pre_Include)
8
9
Linux_RPM_Include_MAINTAINER=	jylefort@FreeBSD.org
10
Linux_RPM_Pre_Include=			bsd.linux-rpm.mk
11
12
RPM2CPIO?=			${LOCALBASE}/bin/rpm2cpio
13
14
EXTRACT_SUFX?=		.${LINUX_RPM_ARCH}.rpm
15
16
USE_LINUX?=			yes
17
USE_LINUX_PREFIX=	yes
18
19
NO_WRKSUBDIR=		yes
20
NO_BUILD=			yes
21
22
.  if ${ARCH} == "amd64"
23
LINUX_RPM_ARCH?=	i386	# the linuxulator does not yet support amd64 code
24
.  elif ${ARCH} == "powerpc"
25
LINUX_RPM_ARCH?=	ppc
26
.  else
27
LINUX_RPM_ARCH?=	${ARCH}
28
.  endif
29
30
.endif
31
32
.if defined(_POSTMKINCLUDED) && !defined(Linux_RPM_Post_Include)
33
34
Linux_RPM_Post_Include=	bsd.linux-rpm.mk
35
36
MASTER_SITES?=			${MASTER_SITE_FEDORA_LINUX}
37
MASTER_SITE_SUBDIR?=	3/${LINUX_RPM_ARCH}/os/Fedora/RPMS/
38
PKGNAMEPREFIX?=			linux-
39
40
EXTRACT_DEPENDS+=		${RPM2CPIO}:${PORTSDIR}/archivers/rpm
41
42
EXTRACT_CMD?=			${RPM2CPIO}
43
EXTRACT_BEFORE_ARGS?=
44
EXTRACT_AFTER_ARGS?=	| ${CPIO} -id --quiet
45
46
MD5_FILE?=				${MASTERDIR}/distinfo.${LINUX_RPM_ARCH}
47
48
.  if defined(AUTOMATIC_PLIST)
49
50
.    if ${USE_LINUX} == "8" || ${USE_LINUX:L} == "yes"
51
_LINUX_BASE_SUFFIX=		8
52
.    elif ${USE_LINUX} == "debian"
53
_LINUX_BASE_SUFFIX=		debian
54
.    else
55
# other linux_base ports do not provide a pkg-plist file
56
IGNORE=					"uses AUTOMATIC_PLIST with an unsupported USE_LINUX, \"${USE_LINUX}\". Supported values are \"yes\", \"8\" and \"debian\""
57
.    endif
58
59
PLIST?=					${WRKDIR}/.PLIST.linux-rpm
60
61
pre-install: linux-rpm-generate-plist
62
63
linux-rpm-generate-plist:
64
	@cd ${WRKSRC} && \
65
	${FIND} * ! -type d | ${SORT} > ${PLIST} && \
66
	${FIND} * -type d | ${SORT} | ${SED} -e 's|^|@dirrm |' > ${PLIST}.dirs
67
	@${GREP} '^@dirrm ' ${PORTSDIR}/emulators/linux_base-${_LINUX_BASE_SUFFIX}/pkg-plist | ${SORT} > ${PLIST}.shared-dirs
68
	@${COMM} -1 -3 ${PLIST}.shared-dirs ${PLIST}.dirs | ${SORT} -r >> ${PLIST}
69
70
.  endif
71
72
.  if !target(do-install)
73
do-install:
74
	cd ${WRKSRC} && ${FIND} * -type d -exec ${MKDIR} "${PREFIX}/{}" \;
75
	cd ${WRKSRC} && ${FIND} * ! -type d | ${CPIO} -pm -R root:wheel ${PREFIX}
76
.  endif
77
78
.  if !target(new-plist)
79
new-plist:
80
	@${RM} -rf ${WRKDIR}/.new-plist
81
	@${MKDIR} ${WRKDIR}/.new-plist
82
	@cd ${WRKDIR}/.new-plist && \
83
	for f in ${DISTFILES}; do \
84
		${RPM2CPIO} ${_DISTDIR}/$$f | ${CPIO} -id --quiet; \
85
		${FIND} * ! type d | ${SORT} > ${PLIST}.new; \
86
		${FIND} -d * -type d | ${SED} -e 's|^|@dirrm |' >> ${PLIST}.new; \
87
	done
88
.  endif
89
90
.endif
(-)bsd.port.mk (-7 / +43 lines)
Lines 422-428 Link Here
422
#				  or a sound server which supports the FreeBSD native one),
422
#				  or a sound server which supports the FreeBSD native one),
423
#				  use the default or the X11 prefix if it's a leaf port
423
#				  use the default or the X11 prefix if it's a leaf port
424
#				  (e.g. a game or program).
424
#				  (e.g. a game or program).
425
#				  Implies NO_MTREE=yes.
425
#				  Implies NO_MTREE=yes, and, if INSTALLS_SHLIB is defined:
426
#				    - USE_LINUX=yes
427
#				    - appropriate invocation of the Linux ldconfig
428
# USE_LINUX_RPM	- Set to yes to pull in variables and targets useful to Linux
429
#				  RPM ports.
430
#				  Implies inclusion of bsd.linux-rpm.mk.
431
# AUTOMATIC_PLIST
432
#				- Set to yes to enable automatic packing list generation.
433
#				  Currently has no effect unless USE_LINUX_RPM is set.
434
#
426
# OVERRIDE_LINUX_BASE_PORT	- This specifies the default linux base to use, for valid values
435
# OVERRIDE_LINUX_BASE_PORT	- This specifies the default linux base to use, for valid values
427
#				  have a look at the description of USE_LINUX. This is an user-only
436
#				  have a look at the description of USE_LINUX. This is an user-only
428
#				  variable. Don't use it in any port, it's meant to be used in
437
#				  variable. Don't use it in any port, it's meant to be used in
Lines 813-818 Link Here
813
#				- If set, bsd.port.mk will automatically run ldconfig commands
822
#				- If set, bsd.port.mk will automatically run ldconfig commands
814
#				  from post-install and also add appropriate @exec/@unexec
823
#				  from post-install and also add appropriate @exec/@unexec
815
#				  directives to directories listed in LDCONFIG_DIRS.
824
#				  directives to directories listed in LDCONFIG_DIRS.
825
#				  If USE_LINUX_PREFIX is defined, the Linux version of ldconfig
826
#				  will be used instead of the native FreeBSD version (in such
827
#				  case, LDCONFIG_DIRS is ignored).
816
# LDCONFIG_DIRS	- List of directories to run ldconfig if INSTALLS_SHLIB is set.
828
# LDCONFIG_DIRS	- List of directories to run ldconfig if INSTALLS_SHLIB is set.
817
#				  Note that this is passed through sed just like the
829
#				  Note that this is passed through sed just like the
818
#				  rest of PLIST, so ${PLIST_SUB} substitutions also
830
#				  rest of PLIST, so ${PLIST_SUB} substitutions also
Lines 1209-1214 Link Here
1209
.else
1221
.else
1210
INDEXFILE?=		INDEX
1222
INDEXFILE?=		INDEX
1211
.endif
1223
.endif
1224
1225
.if defined(USE_LINUX_RPM)
1226
.include "${PORTSDIR}/Mk/bsd.linux-rpm.mk"
1227
.endif
1228
1212
.if defined(USE_BZIP2)
1229
.if defined(USE_BZIP2)
1213
EXTRACT_SUFX?=			.tar.bz2
1230
EXTRACT_SUFX?=			.tar.bz2
1214
.elif defined(USE_ZIP)
1231
.elif defined(USE_ZIP)
Lines 1248-1253 Link Here
1248
PREFIX?=		${LOCALBASE}
1265
PREFIX?=		${LOCALBASE}
1249
.endif
1266
.endif
1250
1267
1268
.if defined(USE_LINUX_PREFIX)
1269
LDCONFIG_CMD?=				${LINUXBASE}/sbin/ldconfig
1270
LDCONFIG_PLIST_EXEC_CMD?=	${LDCONFIG_CMD}
1271
LDCONFIG_PLIST_UNEXEC_CMD?=	${LDCONFIG_CMD}
1272
.else
1273
LDCONFIG_CMD?=				${LDCONFIG} -m ${LDCONFIG_RUNLIST}
1274
LDCONFIG_PLIST_EXEC_CMD?=	${LDCONFIG} -m ${LDCONFIG_PLIST}
1275
LDCONFIG_PLIST_UNEXEC_CMD?=	${LDCONFIG} -R
1276
.endif
1277
1251
PKGCOMPATDIR?=		${LOCALBASE}/lib/compat/pkg
1278
PKGCOMPATDIR?=		${LOCALBASE}/lib/compat/pkg
1252
1279
1253
.if ${OSVERSION} >= 500036
1280
.if ${OSVERSION} >= 500036
Lines 1541-1546 Link Here
1541
.	endif
1568
.	endif
1542
.endif
1569
.endif
1543
1570
1571
.if defined(USE_LINUX_PREFIX) && defined(INSTALLS_SHLIB)
1572
# we need ${LINUXBASE}/sbin/ldconfig
1573
USE_LINUX?=	yes
1574
.endif
1575
1544
.if defined(USE_LINUX)
1576
.if defined(USE_LINUX)
1545
1577
1546
# install(1) also does a brandelf on strip, so don't strip with FreeBSD tools.
1578
# install(1) also does a brandelf on strip, so don't strip with FreeBSD tools.
Lines 1763-1768 Link Here
1763
.include "${PORTSDIR}/Mk/bsd.apache.mk"
1795
.include "${PORTSDIR}/Mk/bsd.apache.mk"
1764
.endif
1796
.endif
1765
1797
1798
.if defined(USE_LINUX_RPM)
1799
.include "${PORTSDIR}/Mk/bsd.linux-rpm.mk"
1800
.endif
1801
1766
.if exists(${PORTSDIR}/../Makefile.inc)
1802
.if exists(${PORTSDIR}/../Makefile.inc)
1767
.include "${PORTSDIR}/../Makefile.inc"
1803
.include "${PORTSDIR}/../Makefile.inc"
1768
USE_SUBMAKE=	yes
1804
USE_SUBMAKE=	yes
Lines 3519-3528 Link Here
3519
.if defined(INSTALLS_SHLIB)
3555
.if defined(INSTALLS_SHLIB)
3520
.if !defined(INSTALL_AS_USER)
3556
.if !defined(INSTALL_AS_USER)
3521
	@${ECHO_MSG} "===>   Running ldconfig"
3557
	@${ECHO_MSG} "===>   Running ldconfig"
3522
	${LDCONFIG} -m ${LDCONFIG_RUNLIST}
3558
	${LDCONFIG_CMD}
3523
.else
3559
.else
3524
	@${ECHO_MSG} "===>   Running ldconfig (errors are ignored)"
3560
	@${ECHO_MSG} "===>   Running ldconfig (errors are ignored)"
3525
	-${LDCONFIG} -m ${LDCONFIG_RUNLIST}
3561
	-${LDCONFIG_CMD}
3526
.endif
3562
.endif
3527
.else
3563
.else
3528
	@${DO_NADA}
3564
	@${DO_NADA}
Lines 4862-4872 Link Here
4862
	@${ECHO_CMD} ${dir} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} | ${SED} -e 's,^,@dirrm ,' >> ${TMPPLIST}
4898
	@${ECHO_CMD} ${dir} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} | ${SED} -e 's,^,@dirrm ,' >> ${TMPPLIST}
4863
.endfor
4899
.endfor
4864
.if defined(INSTALLS_SHLIB) && !defined(INSTALL_AS_USER)
4900
.if defined(INSTALLS_SHLIB) && !defined(INSTALL_AS_USER)
4865
	@${ECHO_CMD} "@exec ${LDCONFIG} -m ${LDCONFIG_PLIST}" >> ${TMPPLIST}
4901
	@${ECHO_CMD} "@exec ${LDCONFIG_PLIST_EXEC_CMD}" >> ${TMPPLIST}
4866
	@${ECHO_CMD} "@unexec ${LDCONFIG} -R" >> ${TMPPLIST}
4902
	@${ECHO_CMD} "@unexec ${LDCONFIG_PLIST_UNEXEC_CMD}" >> ${TMPPLIST}
4867
.elif defined(INSTALLS_SHLIB)
4903
.elif defined(INSTALLS_SHLIB)
4868
	@${ECHO_CMD} "@exec ${LDCONFIG} -m ${LDCONFIG_PLIST} || ${TRUE}" >> ${TMPPLIST}
4904
	@${ECHO_CMD} "@exec ${LDCONFIG_PLIST_EXEC_CMD} || ${TRUE}" >> ${TMPPLIST}
4869
	@${ECHO_CMD} "@unexec ${LDCONFIG} -R || ${TRUE}" >> ${TMPPLIST}
4905
	@${ECHO_CMD} "@unexec ${LDCONFIG_PLIST_UNEXEC_CMD} || ${TRUE}" >> ${TMPPLIST}
4870
.endif
4906
.endif
4871
.if !defined(NO_FILTER_SHLIBS)
4907
.if !defined(NO_FILTER_SHLIBS)
4872
.if (${PORTOBJFORMAT} == "aout")
4908
.if (${PORTOBJFORMAT} == "aout")

Return to bug 90031