import sys
import regex
import string
import os

fd = open ('version.h', 'r')

v_reg = regex.compile ('#define WINVN_VERSION "WinVN \([0-9]+\)\.\([0-9]+\)\.\([0-9]+\)"')

line = fd.readline()

if v_reg.match(line) == -1:
	print 'something is wrong with version.h'
	sys.exit()

fd.close()

src_name = 'winvnsrc_'+v_reg.group(1)+'_'+v_reg.group(2)+'_'+v_reg.group(3)+'.zip'

os.rename ('../dist/winvn.zip', '../dist/'+src_name)
