Would it be possible to use a conventional Canon DSLR camera to do some kind of vaguely meaningful spectrum analysis with GNU Octave?
Yes. In fact, you don't need it to be a Canon DSLR, you can even do this with a web cam. The main idea is close to the real thing, you use a diffraction grating to separate the light components and a sensing element (e.g. a web cam) to "read" the colours. Spatial displacement corresponds to wavelength and there is also the dimension of the "strength" of a spectral line. In this way, you do away with the transformation between recorded colour and actual wavelength (more on this later).
For more information, please see this link and this link. If you want really fine control over your diffraction grating, you can use something like lightscribe to create a diffraction grating pattern at your exact specifications. There used to be some alternatives out there to create simple CD ISOs that when burned on a CD surface they would actually create any sort of pattern on them, you just had to supply an image, but at the moment I cannot recall any of them.
If you tried to do it without a grating pattern, you would need full knowledge of the camera data OR you would need to calibrate the camera yourself. Every sensor has a spectral response to light which you need to know in advance to convert some 45,62,186 to a wavelength. The spectral response depends on the image processing AFTER the sensor (and until the digital file) and of course the incident light.
So, to do spectroscopy directly on the captured images, you would need an LED source whose current is stabilised (to produce constant quality light), you would need to measure the "temperature" of the light produced, set the camera to manual, select an exposure setting and then use the sensor's spectral response for these particular settings to obtain the correspondence between RGB value and wavelength. Otherwise, you need to calibrate the camera yourself. This still involves the constant current light source but also light sources whose intensity and wavelength you have characterised very well (or patterns). It is doable, but not exactly straightforward.
How can I create an actual visible light spectrum?
You can use a diffraction grating as described above. You can also use one of the "old-school" transparent rulers. Their divisions are actually "etched" on the ruler so when you shine a thin strip of light on them at a very shallow angle, they act as diffraction gratings. You can actually measure the wavelength of a laser pointer very accurately in this way.
For example, let's say we use a phenolphthalein type of reagent such that, as the pH of a sample changes, the absorbance of particular colors changes accordingly and so the camera and image processing ultimately yields some values that can be calibrated to different pH values.
Why? This is already "implemented" and calibrated and standardised. Your local chemist probably stocks uranalysis kits. One of the strips in that kit measures pH. BUT! To get an accurate measurement off of the strip, you still need to make sure that you are photographing it under very well controlled light conditions (i.e. Current control light source, or flash photography but under the same conditions every time). Your image processing part could be matching the actual colour of the pH strip, to the "reference" colour chart that indicates which colour corresponds to which pH value. A very simple program for any platform (i.e. Octave, or Scilab).
Hope this helps.