summaryrefslogtreecommitdiff
path: root/mk/emulator/pkg-rpm.mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2007-07-29 05:18:36 +0000
committerjlam <jlam@pkgsrc.org>2007-07-29 05:18:36 +0000
commit33f30156fb37245b360bbc293320402ecf1aba41 (patch)
tree45cad36d8470a568b9136017b2dd79c9efcc65bc /mk/emulator/pkg-rpm.mk
parentffe106498e5f63e2e945d5b6b2ac8807a10ae78f (diff)
downloadpkgsrc-33f30156fb37245b360bbc293320402ecf1aba41.tar.gz
* Add new emulator framework in pkgsrc/mk/emulator that handles all
binary-only packages that require binary "emulation" on the native operating system. Please see pkgsrc/mk/emulator/README for more details. * Teach the plist framework to automatically use any existing PLIST.${EMUL_PLATFORM} as part of the default PLIST_SRC definition. * Convert all of the binary-only packages in pkgsrc to use the emulator framework. Most of them have been tested to install and deinstall correctly. This involves the following cleanup actions: * Remove use of custom PLIST code and use PLIST.${EMUL_PLATFORM} more consistently. * Simplify packages by using default INSTALL and DEINSTALL scripts instead of custom INSTALL/DEINSTALL code. * Remove "SUSE_COMPAT32" and "PKG_OPTIONS.suse" from pkgsrc. Packages only need to state exactly which emulations they support, and the framework handles any i386-on-x86_64 or sparc-on-sparc64 uses. * Remove "USE_NATIVE_LINUX" from pkgsrc. The framework will automatically detect when the package is installing on Linux. Specific changes to packages include: * Bump the PKGREVISIONs for all of the suse100* and suse91* packages due to changes in the +INSTALL/+DEINSTALL scripts used in all of the packages. * Remove pkgsrc/emulators/suse_linux, which is unused by any packages. * cad/lc -- remove custom code to create the distinfo file for all supported platforms; just use "emul-fetch" and "emul-distinfo" instead. * lang/Cg-compiler -- install the shared libraries under ${EMULDIR} instead of ${PREFIX}/lib so that compiled programs will find the shared libraries. * mail/thunderbird-bin-nightly -- update to latest binary distributions for supported platforms. * multimedia/ns-flash -- update Linux version to 9.0.48 as the older version is no longer available for interactive fetch. * security/uvscan -- set LD_LIBRARY_PATH explicitly so that it's not necessary to install library symlinks into ${EMULDIR}/usr/local/lib. * www/firefox-bin-flash -- update Linux version to 9.0.48 as the older version is no longer available for interactive fetch.
Diffstat (limited to 'mk/emulator/pkg-rpm.mk')
-rw-r--r--mk/emulator/pkg-rpm.mk110
1 files changed, 110 insertions, 0 deletions
diff --git a/mk/emulator/pkg-rpm.mk b/mk/emulator/pkg-rpm.mk
new file mode 100644
index 00000000000..493badc15e5
--- /dev/null
+++ b/mk/emulator/pkg-rpm.mk
@@ -0,0 +1,110 @@
+# $NetBSD: pkg-rpm.mk,v 1.1 2007/07/29 05:19:43 jlam Exp $
+#
+# RPM package format
+#
+# Package-settable variables:
+#
+# RPM2PKG_PLIST
+# This is the path to the PLIST created by rpm2pkg(8) which will
+# list the files and directories extracted from the RPMs. If
+# this is empty, then no PLIST is created.
+#
+# Default value: ${WRKDIR}/.PLIST.rpm2pkg
+#
+# RPM2PKG_PREFIX
+# This is the directory under which the contents of the RPMs will
+# be extracted. This directory is stripped from the paths which
+# are stored in ${RPM2PKG_PLIST}.
+#
+# Default value: ${WRKDIR}
+#
+# RPM2PKG_SUBPREFIX
+# This is the subdirectory under ${RPM2PKG_PREFIX} within which
+# the RPMs are directly extracted. If this is empty, then the
+# RPMs are extracted directly into ${RPM2PKG_PREFIX}.
+#
+# Default value: empty
+#
+# RPM2PKG_STRIP
+# This is the number of path components to strip from the head
+# of paths of files and directories stored in the RPMs during
+# extraction. RPMs usually store all paths with a leading path
+# component of ``./''.
+#
+# Default value: 1
+#
+# RPM2PKG_STAGE
+# Stage at which to run the ``extract-rpm'' target.
+#
+# Default value: do-extract
+#
+# RPMFILES
+# The list of paths to RPMs to extract using rpm2pkg(8).
+#
+# Default value: all *.rpm files in DISTFILES located in ${_DISTDIR}
+#
+# RPMIGNOREPATH
+# The list of files or paths to skip during extraction of the RPMs.
+#
+# Default value: undefined
+#
+# Public targets:
+#
+# extract-rpm
+# Runs rpm2pkg(8) with the appropriate arguments based on the
+# RPM* variables set in the package Makefile to extract the
+# files listed in RPMFILES.
+#
+
+BUILD_DEPENDS+= rpm2pkg>=2.1:../../pkgtools/rpm2pkg
+EVAL_PREFIX+= _RPM2PKG_PREFIX=rpm2pkg
+RPM2PKG= ${_RPM2PKG_PREFIX}/sbin/rpm2pkg
+
+RPMFILES?= ${DISTFILES:M*.rpm:S/^/${_DISTDIR}\//}
+BUILD_DEFS+= RPMFILES
+.if defined(RPMIGNOREPATH)
+BUILD_DEFS+= RPMIGNOREPATH
+.endif
+
+RPM2PKGSTRIP?= ${RPM2PKG_STRIP}
+
+RPM2PKG_STRIP?= 1
+RPM2PKG_PREFIX?= ${WRKDIR}
+RPM2PKG_SUBPREFIX?= # empty
+RPM2PKG_PLIST?= ${WRKDIR}/.PLIST.rpm2pkg
+
+# By default, extract the RPMs during the do-extract step.
+RPM2PKG_STAGE?= do-extract
+
+RPM2PKG_ARGS_DFLT= -d ${RPM2PKG_PREFIX:Q}
+.if !empty(RPM2PKG_SUBPREFIX)
+RPM2PKG_ARGS_DFLT+= -p ${RPM2PKG_SUBPREFIX:Q}
+.endif
+.if !empty(RPM2PKG_PLIST)
+RPM2PKG_ARGS_DFLT+= -f ${RPM2PKG_PLIST:Q}
+.endif
+.if empty(RPM2PKG_STRIP:M0)
+RPM2PKG_ARGS_DFLT+= -s ${RPM2PKG_STRIP}
+.endif
+.for _ignoredir_ in ${RPMIGNOREPATH}
+RPM2PKG_ARGS_DFLT+= -i ${_ignoredir_}
+.endfor
+RPM2PKG_ARGS?= ${RPM2PKG_ARGS_DFLT}
+
+PLIST_SRC_DFLT+= ${RPM2PKG_PLIST}
+
+# We handle the extraction of the RPMs in the extract-rpm target below.
+EXTRACT_ONLY?= # empty
+
+# Usually, packages we install via RPMs also install shared libraries.
+_EMUL_RUN_LDCONFIG= yes
+
+.PHONY: extract-rpm
+extract-rpm:
+ @${STEP_MSG} "Extracting RPM files"
+.if !empty(RPM2PKG_PLIST)
+ ${RUN} ${RM} -f ${RPM2PKG_PLIST}
+.endif
+ ${RUN} ${RPM2PKG} ${RPM2PKG_ARGS} ${RPMFILES}
+
+${RPM2PKG_STAGE}: extract-rpm