1#!/usr/bin/env python 2# makerpms.py 3# Copy files all over the place build RPMs and copy to top level directory 4# Contributed file - not tested before releases made. 5 6import os 7import shutil 8srcRoot = "../../" 9rpmRoot = "/usr/src/redhat/SOURCES/" 10rpmBin = "/usr/src/redhat/RPMS/i386/" 11rpmSource = "/usr/src/redhat/SRPMS/" 12 13verFileName = srcRoot + "scintilla/version.txt" 14vers = open(verFileName) 15#139 16vFull = vers.read().strip() 17vers.close() 18 19#1.39 20vPoint = vFull[0] + "." + vFull[1:] 21 22#1, 3, 9, 0 23vComma = vFull[0] + ", " + vFull[1] + ", " + vFull[2] + ", 0" 24 25print("[ %s | %s | %s ]" % (vFull, vPoint, vComma)) 26 27tgzV = "scite" + vFull + ".tgz" 28tgzFileName = srcRoot + "scite.tgz" 29tgzVFileName = srcRoot + tgzV 30 31print("[ %s | %s ]" % (tgzFileName, tgzVFileName)) 32 33if not os.access(tgzFileName, os.F_OK): 34 print("Base file '" + tgzFileName + "' does not exist.") 35else: 36 shutil.copyfile(tgzFileName, tgzVFileName) 37 os.unlink(tgzFileName) 38 39 rpmVFileName = rpmRoot + tgzV 40 41 shutil.copyfile(tgzVFileName, rpmVFileName) 42 43 # Run the rpm build command 44 os.system("rpm -ba scite.spec") 45 46 rpmB = "scite-" + vPoint + "-1.i386.rpm" 47 shutil.copyfile(rpmBin + rpmB, srcRoot + rpmB) 48 rpmS = "scite-" + vPoint + "-1.src.rpm" 49 shutil.copyfile(rpmSource + rpmS, srcRoot + rpmS) 50 51