2 # create-version-itexi.py
8 #print "create-version-itexi.py"
13 myDir = os.path.dirname(sys.argv[0])
14 # use two abspaths to work around some windows python bug
15 topDir = os.path.join(os.path.abspath(myDir)+os.sep+'..'+os.sep+'..'+os.sep)
16 topDir = os.path.abspath( topDir )
18 # TODO: this might be useful for other scripts; can we make it available?
19 manuals = map(lambda x: os.path.splitext(x)[0],
21 glob.glob(os.path.join(topDir,'Documentation', '*.te??'))))
22 manuals = map(lambda x: 'glossary' if x=='music-glossary' else x, manuals)
23 manuals.append('internals')
26 version_file_path = os.path.join(topDir, "VERSION")
28 version_contents = open(version_file_path).readlines()
29 for line in version_contents:
30 if (line[0:14] == 'VERSION_STABLE'):
31 VERSION_STABLE = line[15:-1]
32 if (line[0:13] == 'VERSION_DEVEL'):
33 VERSION_DEVEL = line[14:-1]
35 def make_macro(name, string):
41 def make_download(name, osA, osB, version, revision, text):
42 string = "@uref{http://download.linuxaudio.org/lilypond/binaries/"
43 string += osA + "lilypond-"
44 string += version + "-" + revision
45 string += "." + osB + ",\n"
47 string += ": LilyPond "
48 string += version + "-" + revision
50 make_macro(name, string)
52 def make_download_source(name, vstring, version):
53 string = "@uref{http://download.linuxaudio.org/lilypond/sources/"
54 string += vstring + "/"
55 string += "lilypond-" + version + ".tar.gz"
57 string += "lilypond-" + version + ".tar.gz"
59 make_macro(name, string)
61 def make_all_downloads(macroName, version):
62 make_download("download"+macroName+"LinuxNormal", "linux-x86/",
63 "linux-x86.sh", version, "1", "Linux x86")
64 make_download("download"+macroName+"LinuxBig", "linux-64/",
65 "linux-64.sh", version, "1", "Linux 64")
66 make_download("download"+macroName+"LinuxPPC", "linux-ppc/",
67 "linux-ppc.sh", version, "1", "Linux PPC")
69 make_download("download"+macroName+"FreeBSDNormal", "freebsd-x86/",
70 "freebsd-x86.sh", version, "1", "FreeBSD i386")
71 make_download("download"+macroName+"FreeBSDBig", "freebsd-x86/",
72 "freebsd-64.sh", version, "1", "FreeBSD amd64")
74 make_download("download"+macroName+"DarwinNormal", "darwin-x86/",
75 "darwin-x86.tar.bz2", version, "1", "MacOS X x86")
76 make_download("download"+macroName+"DarwinPPC", "darwin-ppc/",
77 "darwin-ppc.tar.bz2", version, "1", "MacOS X PPC")
79 make_download("download"+macroName+"Windows", "mingw/",
80 "mingw.exe", version, "1", "Windows")
82 def make_ver_link(macroname, version, url, linktext):
84 # TODO: generalize this
85 if (version[:4] == '2.13'):
86 string += '../../v2.13/'
87 if (version[:4] == '2.12'):
88 string += '../../v2.12/'
93 make_macro(macroname, string)
95 def make_manual_links(name, version):
96 for manual in manuals:
97 make_ver_link("manual"+name+manual.capitalize()+'Pdf', version,
98 manual + '.pdf', manual+'.pdf')
99 make_ver_link("manual"+name+manual.capitalize()+'Split', version,
100 manual + ' (split HTML)', manual+'/')
101 make_ver_link("manual"+name+manual.capitalize()+'Big', version,
102 manual + ' (big HTML)', manual+'-one-big-page.html')
105 print "@c ************************ Version numbers ************"
106 make_macro("versionStable", VERSION_STABLE)
107 make_macro("versionDevel", VERSION_DEVEL)
109 print "@c ************************ Download binaries ************"
110 make_all_downloads("Stable", VERSION_STABLE)
111 make_all_downloads("Devel", VERSION_DEVEL)
113 print "@c ************************ Download source ************"
114 # FIXME: icky hard-coding! -gp
115 make_download_source("downloadStableSource", "v2.12", VERSION_STABLE)
116 make_download_source("downloadDevelSource", "v2.13", VERSION_DEVEL)
118 print "@c ************************ Manual links ************"
119 make_manual_links("Stable", VERSION_STABLE)
120 make_manual_links("Devel", VERSION_DEVEL)