Index: Mk/bsd.ruby.mk =================================================================== --- Mk/bsd.ruby.mk (revision 318622) +++ Mk/bsd.ruby.mk (working copy) @@ -504,6 +504,8 @@ . endif . endif +.include "${PORTSDIR}/Mk/bsd.rubygem-versions.mk" + .endif # USE_RUBYGEMS # Index: Mk/bsd.rubygem-versions.mk =================================================================== --- Mk/bsd.rubygem-versions.mk (revision 0) +++ Mk/bsd.rubygem-versions.mk (working copy) @@ -0,0 +1,60 @@ +# Define some helper files and make variables where we'll store gem +# version lists +GEM_VERSIONS_FILE= ${FILESDIR}/gem-versions +GEM_LATEST_VERSION_FILE=${FILESDIR}/gem-latest-version + +GEM_VERSIONS!= if [ -e ${GEM_VERSIONS_FILE} ]; then \ + ${CAT} ${GEM_VERSIONS_FILE}; fi +GEM_LATEST_VERSION!= if [ -e ${GEM_LATEST_VERSION_FILE} ]; then \ + ${CAT} ${GEM_LATEST_VERSION_FILE}; fi + +# Define a PKGNAMESUFFIX so we have unique package names for each version +# of a gem that is installed +PKGNAMESUFFIX= ${PORTVERSION:S/.//g} + +# Build *_DEPENDS based on dependencies specific to the version being +# installed +EXTRACT_DEPENDS+= ${EXTRACT_DEPENDS_${PKGNAMESUFFIX}} +PATCH_DEPENDS+= ${PATCH_DEPENDS_${PKGNAMESUFFIX}} +FETCH_DEPENDS+= ${FETCH_DEPENDS_${PKGNAMESUFFIX}} +BUILD_DEPENDS+= ${BUILD_DEPENDS_${PKGNAMESUFFIX}} +RUN_DEPENDS+= ${RUN_DEPENDS_${PKGNAMESUFFIX}} +LIB_DEPENDS+= ${LIB_DEPENDS_${PKGNAMESUFFIX}} + +# This target generates a distinfo file containing entries for all versions +# of the gem listed on rubygems.org +makesum-all: + @${MAKE} DISTFILES="${GEM_VERSIONS:C/^/${PORTNAME}-/:C/\$/.gem/}" \ + makesum + +# This target generates helper files containing entries for all versions +# of the gem listed on rubygems.org +gem-versions: + @${FETCH_CMD} -q -o - \ + https://rubygems.org/api/v1/versions/${PORTNAME}.yaml | \ + ${AWK} '/number:/ { print $$2 }' | \ + ${SORT} -u > ${GEM_VERSIONS_FILE}; \ + ${TAIL} -1 ${GEM_VERSIONS_FILE} > ${GEM_LATEST_VERSION_FILE} + +# Turn this off because gem dependencies will be handled during the +# depends phase, not at the fetch phase. +fetch-specials: + @${DO_NADA} + +# Create some shorthand targets for use with *_DEPENDS and other places +.for V in ${GEM_VERSIONS} +install-${V}: + @${MAKE} PORTVERSION=${V} install + +deinstall-${V}: + @${MAKE} PORTVERSION=${V} deinstall + +reinstall-${V}: + @${MAKE} PORTVERSION=${V} reinstall + +clean-${V}: + @${MAKE} PORTVERSION=${V} clean + +package-${V}: + @${MAKE} PORTVERSION=${V} package +.endfor Property changes on: Mk/bsd.rubygem-versions.mk ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property