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