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" || ${ARCH} == "i386"
46 . if ${USE_LINUX} == "c6"
47 # Do not build CentOS 6.5 ports if overridden by f10
48 . if defined(OVERRIDE_LINUX_BASE_PORT) && ${OVERRIDE_LINUX_NONBASE_PORTS} == "f10"
49 IGNORE= This port requires CentOS 6.5. Please remove OVERRIDE_LINUX_NONBASE_PORTS=f10 in /etc/make.conf.
51 LINUX_RPM_ARCH?= i686 # ?= because of nasty c5 qt ports
52 . elif ${USE_LINUX} == "f10" || ${USE_LINUX} == "yes" # temporary default, move or clause to line 46
53 # Do not build Fedora 10 ports unless specifically overridden.
54 #. if ! defined(OVERRIDE_LINUX_NONBASE_PORTS) || ${OVERRIDE_LINUX_NONBASE_PORTS} != "f10"
55 #IGNORE= This port requires Fedora 10, yet Fedora 10 is heavily outdated and contains many vulnerable ports. If you really need it, add OVERRIDE_LINUX_NONBASE_PORTS=f10 in /etc/make.conf.
57 LINUX_RPM_ARCH?= i386 # the linuxulator does not yet support amd64 code
59 LINUX_RPM_ARCH?= ${ARCH}
62 . elif ${ARCH} == "powerpc"
67 .if defined(_POSTMKINCLUDED) && !defined(Linux_RPM_Post_Include)
69 Linux_RPM_Post_Include= bsd.linux-rpm.mk
71 .if ${USE_LINUX} == "f10" || ${USE_LINUX} == "yes" # temporary default, remove or clause soon
80 . if defined(LINUX_DIST)
81 DIST_SUBDIR?= rpm/${LINUX_RPM_ARCH}/${LINUX_DIST}/${LINUX_DIST_VER}
83 . if ${LINUX_DIST} == "fedora"
84 # we do not want to define MASTER_SITES and MASTER_SITE_* if they are already defined
85 # ex.: MASTER_SITES=file:///...
87 MASTER_SITES= ${MASTER_SITE_FEDORA_LINUX}
88 . if ${LINUX_DIST_VER} == 10
89 MASTER_SITE_SUBDIR?= ../releases/${LINUX_DIST_VER}/Everything/${LINUX_RPM_ARCH}/os/Packages \
90 ../updates/${LINUX_DIST_VER}/${LINUX_RPM_ARCH}
91 MASTER_SITE_SRC_SUBDIR?= ../releases/${LINUX_DIST_VER}/Everything/source/SRPMS \
92 ../updates/${LINUX_DIST_VER}/SRPMS
94 MASTER_SITE_SUBDIR?= ${LINUX_DIST_VER}/${LINUX_RPM_ARCH}/os/Fedora/RPMS \
95 updates/${LINUX_DIST_VER}/${LINUX_RPM_ARCH}
96 MASTER_SITE_SRC_SUBDIR?= ${LINUX_DIST_VER}/SRPMS \
97 updates/${LINUX_DIST_VER}/SRPMS
100 . elif ${LINUX_DIST} == "centos"
101 MASTER_SITES_SUBDIR= /centos/6/os/i386/Packages/
102 . if ${LINUX_DIST_VER} == "5" #needed for Qt...
104 MASTER_SITES_SUBDIR= /centos/5/os/i386/Packages/
107 . ifndef MASTER_SITES
108 MASTER_SITES= ${MASTER_SITE_CENTOS_LINUX}
109 . if ${LINUX_DIST_VER} == "6.5"
110 . if ! defined(PACKAGE_BUILDING)
111 MASTER_SITES= http://mirror.centos.org/centos/6/os/i386/Packages/
112 MASTER_SITES_SUBDIR= /centos/6/os/i386/Packages/
114 MASTER_SITES?= http://vault.centos.org/%SUBDIR%/
115 MASTER_SITES_SUBDIR= /6.5/os/Source/SPackages/
119 MASTER_SITES= http://vault.centos.org/${LINUX_DIST_VER}/os/i386/Packages/
127 #.if ${USE_LINUX:L} == "yes" #redundant with bsd.port.mk fu
130 PKGNAMEPREFIX?= linux-${USE_LINUX}-
132 # DISTFILES and SRC_DISTFILES assume that there is only one bindist
134 # Please, define them in the Makefile of the port in case this assumption
137 DISTVERSION= ${PORTVERSION}-${RPMVERSION}
138 DISTNAME?= ${PORTNAME}-${DISTVERSION}
139 DISTFILES?= ${DISTNAME}${EXTRACT_SUFX}
140 BIN_DISTFILES:= ${DISTFILES}
141 SRC_DISTFILES?= ${DISTNAME}${SRC_SUFX}
142 EXTRACT_ONLY?= ${BIN_DISTFILES:C/:[^:]+$//}
144 . if defined(PACKAGE_BUILDING)
145 DISTFILES+= ${SRC_DISTFILES}
146 MASTER_SITE_SUBDIR+= ${MASTER_SITE_SRC_SUBDIR}
147 ALWAYS_KEEP_DISTFILES= yes
151 EXTRACT_BEFORE_ARGS?= -xf
154 DISTINFO_FILE?= ${MASTERDIR}/distinfo.${LINUX_RPM_ARCH}
159 # For ports that define PORTDOCS, be sure not to install
160 # documentation if NOPORTDOCS is defined
161 . if defined(PORTDOCS) && defined(NOPORTDOCS)
162 pre-patch: linux-rpm-clean-portdocs
164 . if !target(linux-rpm-clean-portdocs)
165 linux-rpm-clean-portdocs:
166 . for x in ${PORTDOCS}
167 @${RM} -f ${WRKDIR}/${DOCSDIR_REL}/${x}
169 @${RMDIR} ${WRKDIR}/${DOCSDIR_REL}
173 . if defined(AUTOMATIC_PLIST)
175 . if ${USE_LINUX} == "f10" || ${USE_LINUX} == "yes"
176 _LINUX_BASE_SUFFIX= f10
177 . elif ${USE_LINUX} == "c6"
179 _LINUX_BASE_SUFFIX= c6
181 # other linux_base ports do not provide a pkg-plist file
182 IGNORE= uses AUTOMATIC_PLIST with an unsupported USE_LINUX, \"${USE_LINUX}\". Supported values are \"yes\", \"f10\" and \"c6\"
185 PLIST?= ${WRKDIR}/.PLIST.linux-rpm
187 pre-install: linux-rpm-generate-plist
189 . if !target(linux-rpm-generate-plist)
190 linux-rpm-generate-plist:
192 ${FIND} * ! -path "stage/*" ! -type d | ${SORT} > ${PLIST}
196 . if !target(do-install)
198 . if ${BRANDELF_DIRS}
199 @cd ${WRKSRC} && ${FIND} ${BRANDELF_DIRS} -type f -print0 \
200 | ${XARGS} -0 ${FILE} | ${GREP} ELF | ${CUT} -d : -f 1 \
201 | ${XARGS} ${BRANDELF} -t Linux
203 . if ${BRANDELF_FILES}
204 @cd ${WRKSRC} && ${BRANDELF} -t Linux ${BRANDELF_FILES}
206 cd ${WRKSRC} && ${FIND} * ! -path "stage*" -type d -exec ${MKDIR} "${STAGEDIR}${PREFIX}/{}" \;
207 cd ${WRKSRC} && ${FIND} * ! -path "stage/*" ! -type d | ${CPIO} -pm -R root:wheel ${STAGEDIR}${PREFIX}