diff --git a/INSTALL b/INSTALL index 8fc81be4..b8da3082 100644 --- a/INSTALL +++ b/INSTALL @@ -1,5 +1,5 @@ - LinkChecker installation - ========================== + Installation + ============== Requirements ------------ @@ -33,8 +33,8 @@ To install LinkChecker run "python setup.py install". Debian users can build the .deb package with "debian/rules binary". -Running LinkChecker -------------------- +Running the link checker +------------------------ Type "linkchecker" followed by your URLs you want to check. Type "linkchecker -h" for help. diff --git a/MANIFEST.in b/MANIFEST.in index 6a1bcd15..3eca925c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,6 @@ include MANIFEST.in include INSTALL LICENSE TODO -include linkchecker.tmpl linkchecker.bat.tmpl linkcheckerrc +include *.tmpl 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/__init__.py.tmpl -include test/viewprof.py test/profiletest.py.tmpl -recursive-include test *.html +include linkcheck/*.tmpl +include test/viewprof.py test/profiletest.py.tmpl test/*.html recursive-include locale *.mo *.po diff --git a/Makefile b/Makefile index 92886cfc..1291c295 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,16 @@ # This Makefile is only used by developers! No need for users to # call make. VERSION=$(shell python setup.py --version) -#HOST=treasure.calvinsplayground.de -#PROXY=--proxy= -itreasure.calvinsplayground.de -s -#PROXY=-P$(HOST):5050 -HOST=fsinfo.cs.uni-sb.de -PROXY=-Pwww-proxy.uni-sb.de:3128 +HOST=treasure.calvinsplayground.de +PROXY=--proxy= -itreasure.calvinsplayground.de -s +#PROXY=-P$(HOST):8080 +#HOST=fsinfo.cs.uni-sb.de +#PROXY=-Pwww-proxy.uni-sb.de:3128 LCOPTS=-ocolored -Ftext -Fhtml -Fgml -Fsql -Fcsv -R -t0 -v PACKAGE = linkchecker DEBPACKAGE = ../$(PACKAGE)_$(VERSION)_i386.deb SRCPACKAGE = linkchecker-$(VERSION).tar.gz -RPMPATH=build/bdist.linux2/rpm +#RPMPATH=build/bdist.linux2/rpm #RPMPACKAGE=$(RPMPATH)/RPMS/i386/$(PACKAGE)-$(VERSION)-1.i386.rpm #SRPMPACKAGE=$(RPMPATH)/SRPMS/$(PACKAGE)-$(VERSION)-1.src.rpm ALLPACKAGES = $(DEBPACKAGE) $(SRCPACKAGE) #$(RPMPACKAGE) $(SRPMPACKAGE) diff --git a/README b/README.tmpl similarity index 80% rename from README rename to README.tmpl index 09a6bf37..8c7d63ea 100644 --- a/README +++ b/README.tmpl @@ -1,24 +1,7 @@ LinkChecker ============= -With LinkChecker you can check your HTML documents for broken links. - -Features --------- -o recursive checking -o multithreaded -o output can be colored or normal text, HTML, SQL, CSV or a GML sitemap - graph -o HTTP/1.1, HTTPS, FTP, mailto:, news:, Gopher, Telnet and local file links - are supported - Javascript links are currently ignored -o restrict link checking with regular expression filters for URLs -o HTTP proxy support -o give username/password for HTTP and FTP authorization -o robots.txt exclusion protocol support -o internationalization support -o (Fast)CGI web interface - +$long_description Installing, Requirements, Running --------------------------------- @@ -27,7 +10,7 @@ Read the file INSTALL. License -------- -LinkChecker is licensed under the GNU Public License. +$appname is licensed under the GNU Public License. Credits go to Guido van Rossum for making Python. His hovercraft is full of eels! As this program is directly derived from my Java link checker, additional @@ -110,9 +93,6 @@ Nifty features you did not expect o Included brain enhancer. Just read Python code to gain intelligence. o Wash-O-matic. LinkChecker has a secret option which washes all your dirty clothes in a matter of seconds. -o Y2K-Compatibility(tm) guarantee. The fact that you can read this text - in the Millenium age is proof enough! -o Self destruction option (also called kamikaze option). Punch your fists - several times on your keyboard. Banzaaaiiii! +o Y10K-Compatibility(tm) guaranteed. Trust me on that one. o There is no spoon. Wake up already! diff --git a/install.py b/install.py.tmpl similarity index 63% rename from install.py rename to install.py.tmpl index 2fc66af4..e0f5380e 100644 --- a/install.py +++ b/install.py.tmpl @@ -15,21 +15,31 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. """ -import Template,os +import os +from Template import Template distpath = os.getcwd() -t = Template.Template("linkcheck/__init__.py.tmpl") -f = open("linkcheck/__init__.py","w") -f.write(t.fill_in({"install_data": distpath})) -f.close() -for name in ['linkchecker','test/profiletest.py']: - t = Template.Template(name+".tmpl") +data = { + 'install_data': distpath, + 'install_scripts': distpath, + "syspath": "sys.path.insert(0, '%s')" % distpath, + 'author': '$author', + 'version': '$version', + 'url': '$url', + 'appname': '$appname', + 'email': '$email', +} +files = [ + 'linkchecker', + 'linkchecker.bat', + 'test/profiletest.py', + 'linkcheck/__init__.py', + 'linkcheck/Config.py', +] +for name in files: + t = Template(name+".tmpl") f = open(name,"w") - f.write(t.fill_in({"syspath": "sys.path.insert(0, '"+distpath+"')"})) + f.write(t.fill_in(data)) f.close() os.chmod("linkchecker", 0755) -t = Template.Template("linkchecker.bat.tmpl") -f = open("linkchecker.bat","w") -f.write(t.fill_in({"install_scripts": distpath})) -f.close() print "Local installation ok" diff --git a/linkcheck/Config.py b/linkcheck/Config.py.tmpl similarity index 98% rename from linkcheck/Config.py rename to linkcheck/Config.py.tmpl index 040289a9..9be38ef7 100644 --- a/linkcheck/Config.py +++ b/linkcheck/Config.py.tmpl @@ -36,18 +36,18 @@ def dictjoin(d1, d2): return d -Version = "1.2.4" -AppName = "LinkChecker" +Version = "$version" +AppName = "$appname" App = AppName+" "+Version UserAgent = AppName+"/"+Version -Author = "Bastian Kleineidam" -HtmlAuthor = "Bastian Kleineidam" +Author = "$author" +HtmlAuthor = string.replace(Author, ' ', ' ') Copyright = "Copyright © 2000 by "+Author HtmlCopyright = "Copyright © 2000 by "+HtmlAuthor AppInfo = App+" "+Copyright HtmlAppInfo = App+", "+HtmlCopyright -Url = "http://linkchecker.sourceforge.net/" -Email = "calvin@users.sourceforge.net" +Url = "$url" +Email = "$email" Freeware = AppName+""" comes with ABSOLUTELY NO WARRANTY! This is free software, and you are welcome to redistribute it under certain conditions. Look at the file `LICENSE' whithin this diff --git a/linkchecker.bat b/linkchecker.bat index df2516ef..747eb23f 100644 --- a/linkchecker.bat +++ b/linkchecker.bat @@ -18,4 +18,4 @@ rem Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. rem uncomment the next line to enable german output rem set LC_MESSAGES=de rem Limited to 9 parameters? Is there a * for Windows? -python "/home/calvin/projects/linkchecker\linkchecker" %1 %2 %3 %4 %5 %6 %7 %8 %9 +python "/usr/bin\linkchecker" %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/setup.py b/setup.py index 78f6185d..216e2900 100755 --- a/setup.py +++ b/setup.py @@ -61,6 +61,7 @@ class LCDistribution(Distribution): "Use the -I option for the build_ext command.") def has_ssl(self): + """check if we can find ssl.h""" incls = self.get_command_obj("build_ext").include_dirs incls = (incls and string.split(incls, os.pathsep)) or [] for d in incls + self.default_include_dirs: @@ -70,28 +71,43 @@ class LCDistribution(Distribution): def additional_things(self): + """replace path names and program information in various files""" + self.announce("Filling template values.") inst = self.get_command_obj("install") inst.ensure_finalized() - t = Template("linkcheck/__init__.py.tmpl") - f = open("linkcheck/__init__.py","w") - f.write(t.fill_in({"install_data": inst.install_data})) - f.close() - t = Template("linkchecker.tmpl") - f = open("linkchecker","w") - f.write(t.fill_in({"syspath": "# sys.path augmentation not needed"})) - f.close() - if os.name=='nt': - t = Template("linkchecker.bat.tmpl") - f = open("linkchecker.bat","w") - f.write(t.fill_in({"install_scripts": \ - change_root_inv(inst.root, inst.install_scripts)})) + data = { + 'install_data': inst.install_data, + "install_scripts": change_root_inv(inst.root, inst.install_scripts), + "syspath": "# sys.path augmentation not needed", + 'author': self.get_author(), + 'version': self.get_version(), + 'url': self.get_url(), + 'appname': self.get_name(), + 'email': self.get_author_email(), + 'long_description': self.get_long_description(), + } + files = [ + 'linkchecker', + 'linkchecker.bat', + 'test/profiletest.py', + 'linkcheck/__init__.py', + 'linkcheck/Config.py', + 'install.py', + 'README', + ] + for name in files: + t = Template(name+".tmpl") + f = open(name,"w") + f.write(t.fill_in(data)) f.close() + # append system specific files + if os.name=='nt': self.scripts.append('linkchecker.bat') elif os.name=='posix': self.data_files.append(('/etc', ['linkcheckerrc'])) -setup (name = "linkchecker", +setup (name = "LinkChecker", version = "1.2.4", description = "check links of HTML pages", author = "Bastian Kleineidam", @@ -100,19 +116,22 @@ setup (name = "linkchecker", licence = "GPL", long_description = """With LinkChecker you can check your HTML documents for broken links. + Features: +--------- o recursive checking o multithreaded o output can be colored or normal text, HTML, SQL, CSV or a GML sitemap graph -o HTTP/1.1, HTTPS, FTP, mailto:, news:, Gopher, Telnet and local file links - are supported. +o HTTP/1.1, HTTPS, FTP, mailto:, news:, nntp:, Gopher, Telnet and local + file links are supported. Javascript links are currently ignored o restrict link checking with regular expression filters for URLs o HTTP proxy support o give username/password for HTTP and FTP authorization o robots.txt exclusion protocol support o internationalization support +o (Fast)CGI web interface """, distclass = LCDistribution, packages = ['','DNS','linkcheck'],