diff --git a/.cvsignore b/.cvsignore index 7d614581..92455dba 100644 --- a/.cvsignore +++ b/.cvsignore @@ -8,4 +8,3 @@ dist linkchecker-*.tar.gz MANIFEST VERSION -config.py diff --git a/MANIFEST.in b/MANIFEST.in index 9150c118..0918c89f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,6 @@ include MANIFEST.in include INSTALL LICENSE TODO -include *.tmpl linkcheckerrc +include linkcheckerrc include lc.cgi lc.fcgi lc.sz_fcgi include Makefile include create.sql @@ -11,7 +11,6 @@ include debian/control include debian/dirs include debian/docs include DNS/README -include linkcheck/*.tmpl -include test/viewprof.py test/profiletest.py.tmpl test/*.html +include test/viewprof.py test/profiletest.py test/*.html recursive-include locale *.mo *.po recursive-include lconline * diff --git a/setup.py b/setup.py index 58fa273a..e8883d91 100755 --- a/setup.py +++ b/setup.py @@ -23,7 +23,8 @@ from distutils.command.install import install from distutils.command.config import config import os -config_file = "config.py" +# put the config file in the test dir to prevent installation +config_file = "test/config.py" class LCInstall(install): def run(self): @@ -64,22 +65,17 @@ class LCConfig(config): headers=None, include_dirs=None, other_libraries=[]): self._check_compiler() - return self.try_link("int main (vlid) { }", + return self.try_link("int main (void) { }", headers, include_dirs, [library]+other_libraries, library_dirs) def run (self): - if 'bdist_wininst' in self.distribution.commands and os.name!='nt': - self.announce("bdist_wininst command found on non-Windows " - "platform. Disabling SSL compilation") - have_ssl = 0 - else: - have_ssl = self.check_lib("ssl", - library_dirs = self.ssl_library_dirs, - include_dirs = self.ssl_include_dirs, - other_libraries = ["crypto"], - headers = ["ssl.h"]) + have_ssl = self.check_lib("ssl", + library_dirs = self.ssl_library_dirs, + include_dirs = self.ssl_include_dirs, + other_libraries = ["crypto"], + headers = ["ssl.h"]) f = open(config_file,'w') f.write("have_ssl = %d\n" % (have_ssl)) f.write("ssl_library_dirs = %s\n" % `self.ssl_library_dirs`) @@ -91,30 +87,24 @@ class LCConfig(config): class LCDistribution(Distribution): def run_commands (self): - if 'config' not in self.commands: + if "config" not in self.commands: self.check_ssl() - self.additional_things() Distribution.run_commands(self) def check_ssl(self): if not os.path.exists(config_file): raise SystemExit, 'Please configure LinkChecker by running ' \ '"python setup.py config".' - import config - if config.have_ssl: + from test import config + if 'bdist_wininst' in self.commands and os.name!='nt': + self.announce("bdist_wininst command found on non-Windows " + "platform. Disabling SSL compilation") + elif config.have_ssl: self.ext_modules = [Extension('ssl', ['ssl.c'], include_dirs=config.ssl_include_dirs, library_dirs=config.ssl_library_dirs, libraries=config.libraries)] - def additional_things(self): - if 'bdist_wininst' in self.commands or os.name=='nt': - # enabling windows files - self.scripts.append('linkchecker.bat') - elif os.name=='posix': - # for local run - os.chmod("linkchecker", 0755) - setup (name = "LinkChecker", version = "1.2.6", @@ -153,5 +143,6 @@ o (Fast)CGI web interface ['locale/fr/LC_MESSAGES/linkcheck.mo', 'locale/fr/LC_MESSAGES/linkcheck.po']), ('/etc', ['linkcheckerrc']), + ('share/linkchecker',['linkchecker.bat']), ], ) diff --git a/test/.cvsignore b/test/.cvsignore index a4257e17..3b97f777 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -1,2 +1,4 @@ *.result *.prof +*.pyc +config.py diff --git a/test/__init__.py b/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/test/profiletest.py.tmpl b/test/profiletest.py similarity index 91% rename from test/profiletest.py.tmpl rename to test/profiletest.py index 8919e73d..3399b0dc 100755 --- a/test/profiletest.py.tmpl +++ b/test/profiletest.py @@ -17,10 +17,7 @@ """ # profiling test -import sys,re,profile,pstats -# add the path to linkcheck module if you do not install with distutils -$syspath -import linkcheck +import sys,re,profile,pstats,linkcheck #linkcheck.Config.DebugFlag = 1 def runit(config, name):