aboutsummaryrefslogtreecommitdiff
path: root/emulators/linux_base-suse-9.3/Makefile
blob: 4114503d147d63b0376e6fbe965223e184b8be3b (plain) (blame)
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# New ports collection makefile for:		linux_base-suse-9.3
# Date created:					2005-07-12
# Whom:						trevor
# based on ports/emulators/linux_base by Marcel Moolenaar and others
# and on techniques from mbrolavox port by edwin and pav
#
# $FreeBSD$
#

PORTNAME=		linux_base-suse
PORTVERSION=		9.3
PORTREVISION=		2
CATEGORIES=		emulators linux
MASTER_SITES=		${MASTER_SITE_SUSE} ${MASTER_SITE_SUSE:S/$/:update/}
MASTER_SITE_SUBDIR=	i386/9.3/suse/i586 i386/update/9.3/rpm/i586/:update

MAINTAINER=	ports@FreeBSD.org
COMMENT=	Basic packages for Linux mode from SUSE 9.3/i386

EXTRACT_DEPENDS=	rpm:${PORTSDIR}/archivers/rpm

CONFLICTS=	linux_base-7* linux_base-debian* linux_base-gentoo* linux_base-rh* \
		linux_base-suse-9.1* linux_base-suse-9.2*

RPMLIST=	${.CURDIR}/files/rpmlist.conf

.if !defined(OPTIONS)
OPTIONS!=	/usr/bin/awk -F\| '{ print $$1 " \"" $$3 "\" " $$4 }' ${RPMLIST}
.endif
.if !defined(ALLOPTIONS)
ALLOPTIONS!=	/usr/bin/awk -F\| '{ print $$1 }' ${RPMLIST}
.for ii in ${ALLOPTIONS}
FILE_${ii}!=	/usr/bin/grep -w ^${ii} ${RPMLIST} | /usr/bin/awk -F\| '{ print $$2 }'
.endfor
.endif

.include <bsd.port.pre.mk>

# Equivalents to some of the RPMs that may optionally be installed by this port
# may also be installed separately by other ports.
#
# accessibility/linux-atk
.if defined(WITH_atk)
CONFLICTS+=linux-atk-1.2.*
.endif
# audio/linux-arts
.if defined(WITH_arts)
CONFLICTS+=linux-arts-1.0.*
.endif
# audio/linux-libaudiofile
.if defined(WITH_audiofile)
CONFLICTS+=linux-audiofile-0.*
.endif
# devel/linux-glib2
.if defined(WITH_glib2)
CONFLICTS+=linux-glib2-2.2.*
.endif
# devel/linux-libglade
.if defined(WITH_libglade0)
CONFLICTS+=linux-libglade-0.*
.endif
# devel/linux-sdl12
.if defined(WITH_sdl)
CONFLICTS+=linux-sdl12-1.2.*
.endif
# graphics/linux-imlib
.if defined(WITH_imlib)
CONFLICTS+=linux-imlib-1.9.*
.endif
# graphics/linux-jpeg
.if defined(WITH_jpeg)
CONFLICTS+=linux-jpeg-6*
.endif
# graphics/linux-libmng
.if defined(WITH_libmng)
CONFLICTS+=linux-libmng-1.0.*
.endif
# graphics/linux_mesa3
.if defined(WITH_xorgmesa)
CONFLICTS+=linux_mesa3-3.*
.endif
# graphics/linux-png
.if defined(WITH_libpng)
CONFLICTS+=linux-png-1.2.*
.endif
# graphics/linux-tiff
.if defined(WITH_libtiff)
CONFLICTS+=linux-tiff-3.*
.endif
# textproc/linux-expat
.if defined(WITH_expat)
CONFLICTS+=linux-expat-1.*
.endif
# textproc/linux-libxml
.if defined(WITH_libxml1)
CONFLICTS+=linux-xlibxml-1.*
.endif
# x11/linux-XFree86-libs
.if defined(WITH_xorglibs)
CONFLICTS+=linux-XFree86-libs-4.*
.endif
# x11/linux-gnomelibs
.if defined(WITH_gnomelibs)
CONFLICTS+=linux-gnomelibs-1.*
.endif
# x11-fonts/linux-fontconfig
.if defined(WITH_fontconfig)
CONFLICTS+=linux-fontconfig-2.*
.endif
# x11-toolkits/linux-openmotif
.if defined(WITH_openmotif)
CONFLICTS+=linux-openmotif-2.2.*
.endif
# x11-toolkits/linux-gtk
.if defined(WITH_gtk1)
CONFLICTS+=linux-gtk-1.*
.endif
# x11-toolkits/linux-gtk2
.if defined(WITH_gtk2)
CONFLICTS+=linux-gtk2-2.*
.endif
# x11-toolkits/linux-pango
.if defined(WITH_pango)
CONFLICTS+=linux-pango-1.*
.endif

DIST_SUBDIR=		rpm/i386/suse/9.3
IS_INTERACTIVE=	yes
NO_FILTER_SHLIBS=	yes
NO_MTREE=		yes
ONLY_FOR_ARCHS=		amd64 i386
PLIST=			${WRKDIR}/plist
PREFIX=			${LINUXBASE}
RESTRICTED=		"to distribute, must offer sources:  http://www.gnu.org/licenses/gpl.txt"

.for ii in ${ALLOPTIONS}
. if defined(WITH_${ii})
MYDISTFILES+=	${FILE_${ii}}
. endif
.endfor
.if defined(MYDISTFILES)
DISTFILES=	${MYDISTFILES}
DIST_SUBDIR=	rpm/i386/suse/9.3
.else
DISTFILES=	# none
.endif

# Avoid cyclic dependency.
.undef USE_LINUX

REMOVE_DIRS=		boot dev home initrd root tmp var/tmp usr/local usr/tmp
REMOVE_FILES=		bin/df bin/su etc/exports etc/group etc/localtime \
			etc/motd etc/passwd etc/printcap etc/services \
			etc/protocols
BRAND_FILES=		bin/rpm sbin/ldconfig

.if (${ARCH} == "amd64")
LATEST_LINK:=	${LATEST_LINK:C/linux/linux32/}
FALLBACK_ELF_MIB=	kern.elf32.fallback_brand
.else
FALLBACK_ELF_MIB=	kern.fallback_elf_brand
.endif
LINUX_ELF=		3
PREVIOUS_ELF!=		/sbin/sysctl -n ${FALLBACK_ELF_MIB}

distinfo:
	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} fetch NO_CHECKSUM=yes \
		DISABLE_SIZE=yes
	@if [ -f ${MD5_FILE} ]; then ${CAT} /dev/null > ${MD5_FILE}; fi
	@(cd ${DISTDIR}; \
	for file in ${_CKSUMFILES}; do \
	${MD5} $$file >> ${MD5_FILE}; \
		if [ -z "${NO_SIZE}" ]; then \
			${ECHO_CMD} "SIZE ($$file) = "`${LS} -ALln $$file | ${AWK} '{print $$5}'` \
				>> ${MD5_FILE}; \
	fi; \
	done)

do-extract:
#
# Handle the loading of the Linux loadable kernel module if required.
	@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
	@${MKDIR} ${WRKSRC}/var/lib/rpm ${WRKSRC}/var/tmp ${WRKSRC}/lib
	@cd ${WRKSRC}/lib && ${LN} -sf libtermcap.so.2.0.8 libtermcap.so.2
	LC_ALL=C rpm --initdb --root ${WRKSRC} --dbpath /var/lib/rpm
#
# Set the ELF fallback brand to Linux, so we need not do
# anything special to run statically linked binaries.
	@/sbin/sysctl -w ${FALLBACK_ELF_MIB}=${LINUX_ELF}
#
# Install all packages, ignoring dependencies.
	@for ii in ${MYDISTFILES:S/:update//}; do \
		LC_ALL=C rpm -U --root ${WRKSRC} --dbpath /var/lib/rpm \
			--nodeps --replacepkgs --ignoreos --ignorearch \
			${DISTDIR}/${DIST_SUBDIR}/$$ii; \
	done
	@for F in ${BRAND_FILES}; do \
		${BRANDELF} -t Linux ${WRKSRC}/$$F; \
	done
	@/sbin/sysctl -w ${FALLBACK_ELF_MIB}=${PREVIOUS_ELF}
#
# Install yp.conf as a hint to NIS users and make sure there is an
# mtab in etc, albeit an empty one.  This is needed in a couple of
# cases, notably staroffice6.
#
	${INSTALL} ${COPY} -m 644 ${FILESDIR}/yp.conf ${WRKSRC}/etc
	${TOUCH} ${WRKSRC}/etc/mtab ${WRKSRC}/etc/host.conf
#
# Finish
#
	@for D in ${REMOVE_DIRS}; do \
		${RM} -rf ${WRKSRC}/$$D; \
	done
	@for F in ${REMOVE_FILES}; do \
		${RM} -f ${WRKSRC}/$$F; \
	done
	@${LN} -sf /var/tmp ${WRKSRC}/usr/tmp

do-build:
#
# Generate packing list.
	cd ${WRKSRC} && ${FIND} -s * -type f -o -type l > ${PLIST} \
		&& ${FIND} -d * -type d | ${SED} -e 's:^:@dirrm :' >> ${PLIST}

do-install:
#
# Try to hard-link the contents of the work directory to the installation
# directory.  If hard-linking is possible (installing to the same mount point),
# no disk space is consumed in the installation step.  The fallback is to copy,
# and cpio is noisy in this case.
	@cd ${WRKSRC} && ${FIND} * | ${CPIO} -dlmp ${PREFIX}
	@${FIND} ${PREFIX} -type d -exec ${CHMOD} 755 \{\} \;

post-install:
	@${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>