freebsd-ports/emulators/dynagen/Makefile
Mathieu Arnold 551be3c723 Convert Python ports to FLAVORS.
Ports using USE_PYTHON=distutils are now flavored.  They will
  automatically get flavors (py27, py34, py35, py36) depending on what
  versions they support.

  There is also a USE_PYTHON=flavors for ports that do not use distutils
  but need FLAVORS to be set.  A USE_PYTHON=noflavors can be set if
  using distutils but flavors are not wanted.

  A new USE_PYTHON=optsuffix that will add PYTHON_PKGNAMESUFFIX has been
  added to cope with Python ports that did not have the Python
  PKGNAMEPREFIX but are flavored.

  USES=python now also exports a PY_FLAVOR variable that contains the
  current python flavor.  It can be used in dependency lines when the
  port itself is not python flavored.  For example, deskutils/calibre.

  By default, all the flavors are generated.  To only generate flavors
  for the versions in PYTHON2_DEFAULT and PYTHON3_DEFAULT, define
  BUILD_DEFAULT_PYTHON_FLAVORS in your make.conf.

  In all the ports with Python dependencies, the *_DEPENDS entries MUST
  end with the flavor so that the framework knows which to build/use.
  This is done by appending '@${PY_FLAVOR}' after the origin (or
  @${FLAVOR} if in a Python module with Python flavors, as the content
  will be the same).  For example:

    RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}six>0:devel/py-six@${PY_FLAVOR}

PR:		223071
Reviewed by:	portmgr, python
Sponsored by:	Absolight
Differential Revision:	https://reviews.freebsd.org/D12464
2017-11-30 15:50:30 +00:00

72 lines
2.7 KiB
Makefile

# Created by: trasz <trasz@pin.if.uz.zgora.pl>
# $FreeBSD$
PORTNAME= dynagen
PORTVERSION= 0.11.0
PORTREVISION= 4
CATEGORIES= emulators
MASTER_SITES= SF/dyna-gen/${PORTNAME}%20source%20_%20Linux/${PORTNAME}%20${PORTVERSION}
MAINTAINER= pavelivolkov@gmail.com
COMMENT= Text-based front end for Dynamips development version
LICENSE= GPLv2
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}configobj>=4.4.0:devel/py-configobj@${FLAVOR} \
dynamips:emulators/dynamips-community
PLIST_FILES= bin/dynagen "@sample etc/dynagen.ini.sample"
PORTDOCS= *
PORTEXAMPLES= *
PORTDATA= *
USES= dos2unix python:2.7 shebangfix
SHEBANG_FILES= *.py dynagen
USE_PYTHON= distutils autoplist
ALL_TARGET= # empty
NO_ARCH= yes
.include <bsd.port.pre.mk>
post-extract:
@${CP} ${FILESDIR}/setup.py ${WRKSRC}
post-patch:
.if ${PYTHON_MAJOR_VER} >= 3
@${ECHO_MSG} "===> Converting to python${PYTHON_MAJOR_VER}"
${PYTHONBASE}/bin/2to3-${PYTHON_VER} --no-diffs --write ${WRKSRC} ${WRKSRC}/dynagen
@${ECHO_MSG} "===> end of converting"
.endif
post-install:
${INSTALL_SCRIPT} ${WRKSRC}/dynagen ${STAGEDIR}${PREFIX}/bin
${INSTALL_DATA} ${WRKSRC}/dynagen.ini ${STAGEDIR}${PREFIX}/etc/dynagen.ini.sample
@${MKDIR} ${STAGEDIR}${DATADIR}
${INSTALL_DATA} ${WRKSRC}/configspec ${STAGEDIR}${DATADIR}/configspec
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/docs/tutorial.htm ${STAGEDIR}${DOCSDIR}
@${MKDIR} ${STAGEDIR}${DOCSDIR}/tutorial_files
${INSTALL_DATA} ${WRKSRC}/docs/tutorial_files/* ${STAGEDIR}${DOCSDIR}/tutorial_files
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/sample_labs
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/sample_labs/ethernet_switch
${INSTALL_DATA} ${WRKSRC}/sample_labs/ethernet_switch/ethsw1.net ${STAGEDIR}${EXAMPLESDIR}/sample_labs/ethernet_switch
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/sample_labs/frame_relay
${INSTALL_DATA} ${WRKSRC}/sample_labs/frame_relay/frame_relay1.net ${STAGEDIR}${EXAMPLESDIR}/sample_labs/frame_relay
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/sample_labs/multiserver
${INSTALL_DATA} ${WRKSRC}/sample_labs/multiserver/multiserver.net ${STAGEDIR}${EXAMPLESDIR}/sample_labs/multiserver
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/sample_labs/pix
${INSTALL_DATA} ${WRKSRC}/sample_labs/pix/pixtest.net ${STAGEDIR}${EXAMPLESDIR}/sample_labs/pix
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/sample_labs/simple1
${INSTALL_DATA} ${WRKSRC}/sample_labs/simple1/simple1.net ${STAGEDIR}${EXAMPLESDIR}/sample_labs/simple1
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/sample_labs/simple2
${INSTALL_DATA} ${WRKSRC}/sample_labs/simple2/simple2.net ${STAGEDIR}${EXAMPLESDIR}/sample_labs/simple2
${INSTALL_DATA} ${WRKSRC}/sample_labs/all_config_options.txt ${STAGEDIR}${EXAMPLESDIR}/sample_labs
.include <bsd.port.post.mk>