2 # create-version-itexi.py
8 ## these links are relative from /~graham/web/
9 #WEB_DOCLINK_STABLE = "../../doc/v2.12/Documentation/user/lilypond-"
10 #WEB_DOCLINK_DEVEL = "../../doc/v2.13/Documentation/"
12 # these links are relative from the v2.13 docs
13 WEB_DOCLINK_STABLE = "../../../v2.12/Documentation/user/lilypond-"
14 WEB_DOCLINK_DEVEL = "../../../v2.13/Documentation/"
21 myDir = os.path.dirname(sys.argv[0])
22 # use two abspaths to work around some windows python bug
23 topDir = os.path.join(os.path.abspath(myDir)+os.sep+'..'+os.sep+'..'+os.sep)
24 topDir = os.path.abspath( topDir )
26 # TODO: this might be useful for other scripts; can we make it available?
27 manuals = map(lambda x: os.path.splitext(x)[0],
29 glob.glob(os.path.join(topDir,'Documentation', '*.te??'))))
30 #manuals = map(lambda x: 'glossary' if x=='music-glossary' else x, manuals)
31 manuals.append('internals')
34 version_file_path = os.path.join(topDir, "VERSION")
36 version_contents = open(version_file_path).readlines()
37 for line in version_contents:
38 if (line[0:14] == 'VERSION_STABLE'):
39 VERSION_STABLE = line[15:-1]
40 if (line[0:13] == 'VERSION_DEVEL'):
41 VERSION_DEVEL = line[14:-1]
43 def make_macro(name, string):
49 def make_download(name, osA, osB, version, revision, text):
50 string = "@uref{http://download.linuxaudio.org/lilypond/binaries/"
51 string += osA + "lilypond-"
52 string += version + "-" + revision
53 string += "." + osB + ",\n"
55 string += ": LilyPond "
56 string += version + "-" + revision
58 make_macro(name, string)
60 def make_download_source(name, vstring, version):
61 string = "@uref{http://download.linuxaudio.org/lilypond/sources/"
62 string += vstring + "/"
63 string += "lilypond-" + version + ".tar.gz"
65 string += "lilypond-" + version + ".tar.gz"
67 make_macro(name, string)
69 def make_all_downloads(macroName, version):
70 make_download("download"+macroName+"LinuxNormal", "linux-x86/",
71 "linux-x86.sh", version, "1", "Linux x86")
72 make_download("download"+macroName+"LinuxBig", "linux-64/",
73 "linux-64.sh", version, "1", "Linux 64")
74 make_download("download"+macroName+"LinuxPPC", "linux-ppc/",
75 "linux-ppc.sh", version, "1", "Linux PPC")
77 make_download("download"+macroName+"FreeBSDNormal", "freebsd-x86/",
78 "freebsd-x86.sh", version, "1", "FreeBSD i386")
79 make_download("download"+macroName+"FreeBSDBig", "freebsd-x86/",
80 "freebsd-64.sh", version, "1", "FreeBSD amd64")
82 make_download("download"+macroName+"DarwinNormal", "darwin-x86/",
83 "darwin-x86.tar.bz2", version, "1", "MacOS X x86")
84 make_download("download"+macroName+"DarwinPPC", "darwin-ppc/",
85 "darwin-ppc.tar.bz2", version, "1", "MacOS X PPC")
87 make_download("download"+macroName+"Windows", "mingw/",
88 "mingw.exe", version, "1", "Windows")
90 def make_ver_link(macroname, version, url, linktext):
92 # TODO: generalize this
93 if (version[:4] == '2.13'):
94 string += WEB_DOCLINK_DEVEL
95 if (version[:4] == '2.12'):
96 string += WEB_DOCLINK_STABLE
101 make_macro(macroname, string)
103 def make_manual_links(name, version):
105 # FIXME: this is disgusting
107 mshort = 'glossary' if m=='music-glossary' else m
108 make_ver_link("manual"+name+mshort.capitalize()+'Pdf', version,
109 manual + '.pdf', manual+'.pdf')
110 make_ver_link("manual"+name+mshort.capitalize()+'Split', version,
111 manual+'/index.html', manual+' (split HTML)')
112 make_ver_link("manual"+name+mshort.capitalize()+'Big', version,
113 manual+'-big-page.html', manual + ' (big HTML)')
116 print "@c ************************ Version numbers ************"
117 make_macro("versionStable", VERSION_STABLE)
118 make_macro("versionDevel", VERSION_DEVEL)
120 print "@c ************************ Download binaries ************"
121 make_all_downloads("Stable", VERSION_STABLE)
122 make_all_downloads("Devel", VERSION_DEVEL)
124 print "@c ************************ Download source ************"
125 # FIXME: icky hard-coding! -gp
126 make_download_source("downloadStableSource", "v2.12", VERSION_STABLE)
127 make_download_source("downloadDevelSource", "v2.13", VERSION_DEVEL)
129 print "@c ************************ Manual links ************"
130 make_manual_links("Stable", VERSION_STABLE)
131 make_manual_links("Devel", VERSION_DEVEL)