8 # LINUX_DIST - Will be used to set some dist-specific presets.
10 # LINUX_DIST_VER - Use depends upon the dist-specific presets.
11 # Valid values for "fedora": all version numbers
12 # e.g. 10 for fedora 10
13 # This is used to set MASTER_SITE_{,SRC_}SUBDIR
14 # if it isn't already set.
15 # MASTER_SITE_SRC_SUBDIR
16 # - The subdir for the src RPM's.
17 # DISTFILES - For simple cases this will be set automatically
18 # based upon the DISTNAME.
19 # SRC_DISTFILES - Variable which contains the corresponding src RPM's.
20 # If there's no corresponding src RPM, it has to be
21 # set to the empty value (SRC_DISTFILES= "").
22 # AUTOMATIC_PLIST - Generate a dynamic plist (please have a look at the
23 # porters handbook section which talks about plists.
24 # This feature is reserved for rare cases).
25 # BRANDELF_DIRS - A list of directories with executables to brand
26 # as a linux executable. The directories has to not
28 # BRANDELF_FILES - A list of files to brand as a linux executable in
29 # case BRANDELF_DIRS can't be used.
31 .if !defined(_POSTMKINCLUDED) && !defined(Linux_RPM_Pre_Include)
33 Linux_RPM_Include_MAINTAINER= emulation@FreeBSD.org
34 Linux_RPM_Pre_Include= bsd.linux-rpm.mk
36 EXTRACT_SUFX?= .${LINUX_RPM_ARCH}.rpm
45 . if ${ARCH} == "amd64"
46 LINUX_RPM_ARCH?= i386 # the linuxulator does not yet support amd64 code
47 . elif ${ARCH} == "powerpc"
50 LINUX_RPM_ARCH?= ${ARCH}
55 .if defined(_POSTMKINCLUDED) && !defined(Linux_RPM_Post_Include)
57 Linux_RPM_Post_Include= bsd.linux-rpm.mk
61 . if !defined(OVERRIDE_LINUX_NONBASE_PORTS) && \
62 ${LINUX_DIST_VER} != 10
63 IGNORE= bsd.linux-rpm.mk test failed: package building defaults to linux-f10 ports, please define OVERRIDE_LINUX_NONBASE_PORTS to build other linux infrastructure ports
66 . if defined(LINUX_DIST)
67 DIST_SUBDIR?= rpm/${LINUX_RPM_ARCH}/${LINUX_DIST}/${LINUX_DIST_VER}
69 . if ${LINUX_DIST} == "fedora"
70 # we do not want to define MASTER_SITES and MASTER_SITE_* if they are already defined
71 # ex.: MASTER_SITES=file:///...
73 MASTER_SITES= ${MASTER_SITE_FEDORA_LINUX}
74 . if ${LINUX_DIST_VER} == 10
75 MASTER_SITE_SUBDIR?= ../releases/${LINUX_DIST_VER}/Everything/${LINUX_RPM_ARCH}/os/Packages \
76 ../updates/${LINUX_DIST_VER}/${LINUX_RPM_ARCH}
77 MASTER_SITE_SRC_SUBDIR?= ../releases/${LINUX_DIST_VER}/Everything/source/SRPMS \
78 ../updates/${LINUX_DIST_VER}/SRPMS
80 MASTER_SITE_SUBDIR?= ${LINUX_DIST_VER}/${LINUX_RPM_ARCH}/os/Fedora/RPMS \
81 updates/${LINUX_DIST_VER}/${LINUX_RPM_ARCH}
82 MASTER_SITE_SRC_SUBDIR?= ${LINUX_DIST_VER}/SRPMS \
83 updates/${LINUX_DIST_VER}/SRPMS
87 IGNORE= unknown LINUX_DIST in port Makefile
90 PKGNAMEPREFIX?= linux-
92 # DISTFILES and SRC_DISTFILES assume that there is only one bindist
94 # Please, define them n the Makefile of the port in case this assumption
97 DISTFILES?= ${DISTNAME}${EXTRACT_SUFX}
98 BIN_DISTFILES:= ${DISTFILES}
99 SRC_DISTFILES?= ${DISTNAME}${SRC_SUFX}
100 EXTRACT_ONLY?= ${BIN_DISTFILES:C/:[^:]+$//}
102 . if defined(PACKAGE_BUILDING)
103 DISTFILES+= ${SRC_DISTFILES}
104 MASTER_SITE_SUBDIR+= ${MASTER_SITE_SRC_SUBDIR}
105 ALWAYS_KEEP_DISTFILES= yes
109 EXTRACT_BEFORE_ARGS?= -xf
112 DISTINFO_FILE?= ${MASTERDIR}/distinfo.${LINUX_RPM_ARCH}
117 # For ports that define PORTDOCS, be sure not to install
118 # documentation if NOPORTDOCS is defined
119 . if defined(PORTDOCS) && defined(NOPORTDOCS)
120 pre-patch: linux-rpm-clean-portdocs
122 . if !target(linux-rpm-clean-portdocs)
123 linux-rpm-clean-portdocs:
124 . for x in ${PORTDOCS}
125 @${RM} -f ${WRKDIR}/${DOCSDIR_REL}/${x}
127 @${RMDIR} ${WRKDIR}/${DOCSDIR_REL}
131 . if defined(AUTOMATIC_PLIST)
133 . if ${USE_LINUX} == "f10" || ${USE_LINUX:tl} == "yes"
134 _LINUX_BASE_SUFFIX= f10
136 # other linux_base ports do not provide a pkg-plist file
137 IGNORE= uses AUTOMATIC_PLIST with an unsupported USE_LINUX, \"${USE_LINUX}\". Supported values are \"yes\" and \"f10\"
140 PLIST?= ${WRKDIR}/.PLIST.linux-rpm
142 pre-install: linux-rpm-generate-plist
144 . if !target(linux-rpm-generate-plist)
145 linux-rpm-generate-plist:
147 ${FIND} * ! -path "stage/*" ! -type d | ${SORT} > ${PLIST} && \
148 ${FIND} * ! -path "stage*" -type d | ${SORT} | ${SED} -e 's|^|@dirrm |' > ${PLIST}.dirs
149 @${GREP} '^@dirrm' ${PORTSDIR}/emulators/linux_base-${_LINUX_BASE_SUFFIX}/pkg-plist | ${SED} 's:^@dirrmtry:@dirrm:g' | ${SORT} > ${PLIST}.shared-dirs
150 @${COMM} -1 -3 ${PLIST}.shared-dirs ${PLIST}.dirs | ${SORT} -r >> ${PLIST}
154 . if !target(do-install)
156 . if ${BRANDELF_DIRS}
157 @cd ${WRKSRC} && ${FIND} ${BRANDELF_DIRS} -type f -print0 \
158 | ${XARGS} -0 ${FILE} | ${GREP} ELF | ${CUT} -d : -f 1 \
159 | ${XARGS} ${BRANDELF} -t Linux
161 . if ${BRANDELF_FILES}
162 @cd ${WRKSRC} && ${BRANDELF} -t Linux ${BRANDELF_FILES}
164 cd ${WRKSRC} && ${FIND} * ! -path "stage*" -type d -exec ${MKDIR} "${STAGEDIR}${PREFIX}/{}" \;
165 cd ${WRKSRC} && ${FIND} * ! -path "stage/*" ! -type d | ${CPIO} -pm -R root:wheel ${STAGEDIR}${PREFIX}
168 . if !target(new-plist)
170 @${RM} -f ${PLIST}.new
172 ${FIND} * ! -path "stage/*" ! -type d | ${SORT} > ${PLIST}.new; \
173 ${FIND} -d * ! -path "stage*" -type d | ${SED} -e 's|^|@dirrm |' >> ${PLIST}.new; \