# $Id: Package,v 1.14 2013/01/04 14:47:26 ksb Exp $ # pkg level makefile for %% pkg-name %% # $Msync(group): echo %% remove me if the grouo is "source", or name it %% # $Msync(target): echo msync # Find all the level2 products this package incorporates: # $Level2s: %|/##/%J ksh %j %f ##tr -s ' \t' ' ' <$1 |sed -n -e '/^ *#/d' \ ## -e '/^ rcsvg ${VGOPTS} -S $@ `verof` *$/d' \ ## -e 's!^ cd ${MSRC}\([^ ]*\) && rcsvg.*-S $@ *\([A-Za-z0-9.\\$]*\)$!\2 ${MSRC}\1!p' \ ## -e 's!^ rcsvg ${VGOPTS} -S $[{STAGE}@]* \([A-Za-z0-9.\\$]*\)!\1 '"`pwd`"'!p' # $Level2s: %j%^ $$ Also used by level3s # # Stop msrc from trying to push this, but allow msync to process it: INTO= _This _is _a _package _makefile, _it _cannot _be _pushed. MSRC=/usr/msrc TMP=/tmp VERSION=%% version number x.y %% PKG=%% pkg name like "blotto_base" %% STAGE=${TMP}/${PKG}-${VERSION} VGOPTS= # Keep msync happy at this level GEN= SOURCE= Makefile Makefile.host Makefile.meta Msrc.hxmd ITO.spec \ README INSTALL %% other files like or manstyle.man Example.html %% quit: echo "You are not in the right place to make no target, for sure" 1>&2 false all: stage # make sub_sync to check all gsathered subdirs check: echo ${.MAKEFILE_LIST} sub_sync: FRC MK=-s mk -mLevel2s Makefile |sed -e 's|$${MSRC}|${MSRC}|g' |\ xapply -f 'msync ${MSYNC_OPTS}' - msync: FRC msync -3 # level3 package builder requires this interface, do not mess with it ${TMP}: echo "Cannot find ${TMP}, which we will not build." false ${TMP}/${PKG}-${VERSION}.tgz: ${TMP} stage cd ${TMP} && tar zcf ${PKG}-${VERSION}.tgz ${PKG}-${VERSION} ${TMP}/${PKG}-${VERSION}.tbz: ${TMP} stage cd ${TMP} && tar cf - ${PKG}-${VERSION} |bzip2 -9 >${PKG}-${VERSION}.tbz # build the staged files ${STAGE}: rcsvg ${VGOPTS} -S $@ One rm -f $@/Makefile mv $@/Makefile.meta $@/Makefile %% anything else you need to fix before the archive is rendered %% %% Remember all Pkgs are source-rooted at "/usr/msrc" -- all of them %% ${STAGE}/Pkgs ${STAGE}/local: ${STAGE} mkdir $@ %% the list below is a guess, fix it as needed. %% ${STAGE}/local/lib ${STAGE}/local/bin ${STAGE}/local/sbin: ${STAGE}/local mkdir $@ %% Copy the block below for every subdir you need, at Stable release %% ${STAGE}/local/%% foo/mything %%: ${STAGE}/%% foo above me %% cd ${MSRC}/local/%% msrc dir %% && rcsvg ${VGOPTS} -S $@ %% Stable %% # Include the package source for this, so you can make a better version. ${STAGE}/Pkgs/${PKG}: ${STAGE}/Pkgs rcsvg ${VGOPTS} -S $@ `verof` clean: FRC -[ -d ${STAGE} ] && op -u $${USER:=$$LOGNAME} level2s-chown ${STAGE} rm -rf ${STAGE} stage: ${STAGE} ${STAGE}/Pkgs/${PKG} %% add all the dirs you wanted %% addlic ${STAGE} find ${STAGE} -type d -exec chmod g+w '{}' \; op -u source level2s-chown ${STAGE} source: ${SOURCE} ${SOURCE}: co -q $@ check: FRC cd ${STAGE} && ( find [!P]*/ -type f -print |xapply -f 'diff -u2 %1 /usr/msrc/local/%1' - ) 2>&1 cd ${STAGE} && ( find Pkgs -type f -print |xapply -f 'diff -u2 %1 /usr/msrc/%1' - ) 2>&1 FRC: