Thursday, December 3, 2009

Viewsource Modifications

viewsource-1.1-1.fc11.noarch.rpm

The first release of viewsource had a lot of bugs, I accidentally installed the files in the wrong directory, /usr/bin because I never really grasped the macros until recently. I realized that these files needed to be built in /var/www/html directory because they had to be accessed by the web browser. Another issue was we did not have a working version of dojo.

viewsource-1.2-1.fc11.noarch.rpm

Issues from the first release were addressed and the install directory looked like so:

%install
rm -rf %{buildroot}
install -d %{buildroot}/var/www/html/viewsource
install -p viewsource.py %{buildroot}/var/www/html/viewsource
install -p viewsource.config %{buildroot}/var/www/html/viewsource
install -p index.html %{buildroot}/var/www/html/viewsource

likewise with the files section looking like:

%files
/var/www/html/viewsource/viewsource.py
/var/www/html/viewsource/viewsource.config
/var/www/html/viewsource/index.html
/var/www/html/viewsource/viewsource.pyo
/var/www/html/viewsource/viewsource.pyc
/etc/httpd/conf.d/viewsource.conf
%defattr(-,root,root,-)
%doc LICENSE

Notice viewsource.pyo and .pcy those are just results of the compiler.
Next we needed to fix the dojo issue, so a patch was made which would add the dojo that google uses and has made available to the public. This fixed the dojo issue.

Other issues arose, now that we have the viewsource html doctument and can view it through a url we tried hitting the buttons at the bottom to see if they worked, all they did was grab python code and bring it to the screen it didnt actually run it.

Viewsource-1.3-1.fc11.noarch.rpm

We thought that we had to make a config file in httpd.conf to Addhandler cgi-script .cgi. It looked like so:

%install
rm -rf %{buildroot}
install -d %{buildroot}/var/www/html/viewsource
install -p viewsource.py %{buildroot}/var/www/html/viewsource
install -p viewsource.config %{buildroot}/var/www/html/viewsource
install -p index.html %{buildroot}/var/www/html/viewsource
install -d %{buildroot}/etc/httpd/conf.d
install -p %{SOURCE1} %{buildroot}/etc/httpd/conf.d (this is the added apache conf file)

We thought this would work but for some reason the same thing happened, we still need to work this out. To be continued.