def createRecipe(num, requires=[], fail=False, content='', 
                 packageSpecs=[],
                 subPackages = [], version='1.0', localflags=[], flags=[],
                 header='', fileContents='', tag=None, binary=False):
    reqList = []
    for req in requires:
        reqList.append("'test%d:runtime'" % req)
    subs = {}
    subs['requires'] = ', '.join(reqList)
    subs['version'] = version
    subs['num'] = num
    subs['content'] = content
    subs['fileContents'] = fileContents
    subs['header'] = header
    subs['binary'] = binary
    subpkgStrs = []
    flagStrs = []
    flavorStrs = []
    if localflags and not isinstance(localflags, (tuple, list)):
        localflags = [localflags]

    for flag in localflags:
        flagStr = 'Flags.%s = True' % flag
        flavorStr = 'if Flags.%s: pass' % flag
        flagStrs.append(flagStr)
        flavorStrs.append(flavorStr)

    if tag:
        subs['tagspec'] = "r.TagSpec('%s', '/usr/bin/test1')" % tag
    else:
        subs['tagspec'] = ''