diff --git a/games/linux-x-plane/Makefile b/games/linux-x-plane/Makefile index 78b45fa026ba..1869a3ddf2b2 100644 --- a/games/linux-x-plane/Makefile +++ b/games/linux-x-plane/Makefile @@ -6,11 +6,9 @@ # PORTNAME= linux-x-plane -PORTVERSION= 8.16 +PORTVERSION= 8.20 CATEGORIES= games linux -MASTER_SITES= http://66.111.223.52/ \ - ftp://ftp.x-plane.com/Web_Links/ -DISTNAME= XLIN${XPVERSION}b +MASTER_SITES= # empty MAINTAINER= jylefort@FreeBSD.org COMMENT= A commercial flight simulator @@ -19,28 +17,27 @@ RUN_DEPENDS= ${LINUXBASE}/lib/libgcc/libgcc_s.so.1:${PORTSDIR}/lang/linux-libgcc ${LINUXBASE}/usr/lib/libopenal.so.0:${PORTSDIR}/audio/linux-openal \ ${LINUXBASE}/usr/X11R6/lib/libGLU.so.1.3:${PORTSDIR}/graphics/linux_dri -WRKSRC= ${WRKDIR}/X-System-${XPVERSION}-lin1 +IGNOREFILES= ${DISTFILES} # user-created distribution +NO_WRKSUBDIR= yes USE_X_PREFIX= yes USE_BZIP2= yes USE_LINUX= yes NO_BUILD= yes RESTRICTED= "Redistribution prohibited" -NO_PACKAGE= "Package will be 353 MB, set FORCE_PACKAGE if you really want to build it" +NO_PACKAGE= "Package will be 348 MB, set FORCE_PACKAGE if you really want to build it" ONLY_FOR_ARCHS= i386 amd64 -XPVERSION= ${PORTVERSION:S|.||g} - XDIR= ${PREFIX}/lib/x-plane XDIR_REL= ${XDIR:S,^${PREFIX}/,,} PROGRAMS= Airfoil-Maker Briefer Plane-Maker World-Maker X-Plane -PLIST= ${WRKDIR}/pkg-plist +PLIST= ${WRKDIR}/.plist PLIST_FILES= ${PROGRAMS:S|^|bin/|} libexec/x-plane-wrapper PLIST_DIRS= ${XDIR_REL} SUB_FILES= x-plane-wrapper -SUB_LIST= XDIR="${XDIR}" PORTVERSION="${PORTVERSION}" XPVERSION="${XPVERSION}" +SUB_LIST= XDIR="${XDIR}" PORTVERSION="${PORTVERSION}" PROGRAMS="${PROGRAMS}" DESKTOP_ENTRIES="X-Plane Airfoil Maker" \ "Edit X-Plane airfoils" \ @@ -89,6 +86,51 @@ RUN_DEPENDS+= ${LINUXBASE}/usr/X11R6/lib/libGL.so.1:${PORTSDIR}/graphics/linux_d RUN_DEPENDS+= ${LINUXBASE}/lib/libGL.so.1:${PORTSDIR}/graphics/linux_glx .endif +do-fetch: + @if ! [ -e ${DISTDIR}/${DISTFILES} ]; then \ + ${ECHO_CMD} "" ; \ + ${ECHO_CMD} "The X-Plane distribution must be manually fetched with the X-Plane installer." ; \ + ${ECHO_CMD} "To fetch the X-Plane distribution and create a tarball (for personal use only;" ; \ + ${ECHO_CMD} "redistribution prohibited by license), do the following:" ; \ + ${ECHO_CMD} "" ; \ + ${ECHO_CMD} " - install the games/linux-x-plane-net-installer port" ; \ + ${ECHO_CMD} " - as a normal user, run X-Plane-Net-Install, select a destination directory" ; \ + ${ECHO_CMD} " with enough free space (you need about 550 MB), and install X-Plane" ; \ + ${ECHO_CMD} " - as root, create the distribution tarball:" ; \ + ${ECHO_CMD} "" ; \ + ${ECHO_CMD} " cd ${MASTERDIR}" ; \ + ${ECHO_CMD} " make dist XDISTDIR=/path/where/xplane/was/installed" ; \ + ${ECHO_CMD} "" ; \ + ${ECHO_CMD} "You can then remove XDISTDIR and install this port normally." ; \ + ${ECHO_CMD} "" ; \ + ${FALSE} ; \ + fi + +dist: +.if defined(XDISTDIR) +. if exists(${XDISTDIR}/X-Plane-athlon-xp) \ + || exists(${XDISTDIR}/X-Plane-i586) \ + || exists(${XDISTDIR}/X-Plane-pentium-3) + @${ECHO_MSG} "===> Packaging ${XDISTDIR} into ${DISTDIR}/${DISTFILES}" + @cd ${XDISTDIR} && ${TAR} -ycf ${DISTDIR}/${DISTFILES} * +. else + @${ECHO_CMD} "" + @${ECHO_CMD} "${XDISTDIR} does not appear to contain the X-Plane ${PORTVERSION} distribution." + @${ECHO_CMD} "" + @${FALSE} +. endif +.else + @${ECHO_CMD} "" + @${ECHO_CMD} "XDISTDIR not defined." + @${ECHO_CMD} "" + @${ECHO_CMD} "You must point XDISTDIR to the path where you have installed the X-Plane" + @${ECHO_CMD} "distribution with the installer, for instance:" + @${ECHO_CMD} "" + @${ECHO_CMD} " make dist XDISTDIR=/tmp/X-Plane" + @${ECHO_CMD} "" + @${FALSE} +.endif + post-patch: @${FIND} ${WRKSRC} -type d -empty -exec ${TOUCH} "{}/.keep_me" \; @${MKDIR} ${WRKSRC}/.programs/Resources @@ -98,6 +140,8 @@ post-patch: .endfor pre-install: + @${MKDIR} ${WRKDIR}/.wrapper + @${MV} -f ${WRKDIR}/x-plane-wrapper ${WRKDIR}/.wrapper @${RM} -f ${PLIST} @${RM} -f ${PLIST}.dirs .for d in "" .programs @@ -108,7 +152,7 @@ pre-install: @${SORT} -ru ${PLIST}.dirs | ${SED} -e 's|^|@dirrm ${XDIR_REL}/|' >> ${PLIST} do-install: - ${INSTALL_SCRIPT} ${WRKDIR}/x-plane-wrapper ${PREFIX}/libexec + ${INSTALL_SCRIPT} ${WRKDIR}/.wrapper/x-plane-wrapper ${PREFIX}/libexec .for p in ${PROGRAMS} ${LN} -sf ${PREFIX}/libexec/x-plane-wrapper ${PREFIX}/bin/${p} .endfor @@ -117,6 +161,5 @@ do-install: .endfor cd ${WRKSRC} && ${FIND} * -type f -exec ${INSTALL_DATA} "{}" "${XDIR}/{}" \; cd ${WRKSRC}/.programs && ${FIND} * -type f -exec ${INSTALL_PROGRAM} "{}" "${XDIR}/{}" \; - @${CAT} ${PKGMESSAGE} .include diff --git a/games/linux-x-plane/distinfo b/games/linux-x-plane/distinfo index 3b4e6fd33c92..e69de29bb2d1 100644 --- a/games/linux-x-plane/distinfo +++ b/games/linux-x-plane/distinfo @@ -1,3 +0,0 @@ -MD5 (XLIN816b.tar.bz2) = 7c0640cecc45ddfae06bb3a6a3f2cbc4 -SHA256 (XLIN816b.tar.bz2) = 3ac778024a1a91ffd040bad0595697416cc58cb547a0db08e0ec14e20bb24f98 -SIZE (XLIN816b.tar.bz2) = 371099632 diff --git a/games/linux-x-plane/files/x-plane-wrapper.in b/games/linux-x-plane/files/x-plane-wrapper.in index d357045f5dd6..9112e3a05cec 100644 --- a/games/linux-x-plane/files/x-plane-wrapper.in +++ b/games/linux-x-plane/files/x-plane-wrapper.in @@ -3,37 +3,55 @@ xdir="%%XDIR%%" userdir="$HOME/.x-plane" portversion="%%PORTVERSION%%" -xpversion="%%XPVERSION%%" +programs="%%PROGRAMS%%" +targets="athlon-xp i586 pentium-3" # The executables need to be run from the data directory, and need to # write files in it. We therefore mirror the data directory hierarchy # in $userdir, and create symlinks to the data files. if [ "x`cat $userdir/version 2>/dev/null`" != "x$portversion" ]; then + if [ -e $userdir ]; then + cd $userdir || exit 1 + + echo "Removing dangling symlinks from $userdir" + find * -type l ! -exec stat -L {} \; -delete >/dev/null 2>&1 + + echo "Removing obsolete configuration from $userdir" + rm -f Resources/Preferences/* + rm -f $userdir/cpu + + echo "Removing empty directories from $userdir" + find -d * -type d -empty -delete + fi + echo "Updating hierarchy in $userdir" cd $xdir || exit 1 + find * -type d -exec mkdir -p "$userdir/{}" \; || exit 1 find * -type f ! -name '*.prf' -exec ln -sf "$xdir/{}" "$userdir/{}" \; || exit 1 - cd $xdir/Resources/Preferences || exit 1 - for f in *; do - if ! [ -e "$userdir/Resources/Preferences/$f" ]; then - install -m 644 "$f" $userdir/Resources/Preferences || exit 1 - fi + + for p in $programs; do + for t in $targets; do + if [ -e $p-$t ]; then + rm -f $userdir/$p-$t + cp -p $p-$t $userdir || exit 1 + fi + done done + echo "$portversion" > $userdir/version || exit 1 fi -if ! [ -e $userdir/cpu ]; then - echo "i586" > $userdir/cpu || exit 1 -fi - -cpu=`cat $userdir/cpu 2>/dev/null` -if [ "x$cpu" != "xathlon-xp" ] && [ "x$cpu" != "xi586" ] && [ "x$cpu" != "xpentium-3" ]; then - echo "Unknown CPU \"$cpu\" in $userdir/cpu, defaulting to i586" - cpu=i586 -fi - program=`basename $0` cd $userdir || exit 1 -exec ./$program-$xpversion-lin1-$cpu "$@" + +for t in $targets; do + if [ -e $program-$t ]; then + exec ./$program-$t "$@" + fi +done + +echo "$program not found. Check your X-Plane installation." >&2 +exit 1 diff --git a/games/linux-x-plane/pkg-message b/games/linux-x-plane/pkg-message deleted file mode 100644 index f6c2eb66ceba..000000000000 --- a/games/linux-x-plane/pkg-message +++ /dev/null @@ -1,13 +0,0 @@ -=============================================================================== -X-Plane binaries compiled for the following processors are available: - - athlon-xp - i586 - pentium-3 - -By default, the wrapper script uses the i586 binaries. To select another -target, set it in ~/.x-plane/cpu, for instance: - - $ mkdir ~/.x-plane - $ echo athlon-xp > ~/.x-plane/cpu -===============================================================================