5
parser = optparse.OptionParser()
6
parser.add_option("", "--prefix", dest="prefix",default="/usr/local",help="installation prefix (default: /usr/local)")
7
parser.add_option("", "--confdir", dest="confdir", default="/etc",help="configuration files directory prefix (default: /etc)")
8
parser.add_option("", "--port", dest="port", default="8022", help="set the listening TCP port (default: 8022)")
9
parser.add_option("", "--command", dest="cmd", default=None,help="set the command (default: /bin/login or ssh localhost)")
10
(o, a) = parser.parse_args()
12
print "Configuring prefix=",o.prefix," port=",o.port
17
bin=os.path.join(o.prefix,"bin")
18
lib=os.path.join(o.prefix,"share/ajaxterm")
19
man=os.path.join(o.prefix,"share/man/man1")
21
file("ajaxterm.bin","w").write(file("configure.ajaxterm.bin").read()%locals())
22
file("Makefile","w").write(file("configure.makefile").read()%locals())
24
if os.path.isfile("/etc/gentoo-release"):
25
file("ajaxterm.initd","w").write(file("configure.initd.gentoo").read()%locals())
26
elif os.path.isfile("/etc/fedora-release") or os.path.isfile("/etc/redhat-release"):
27
file("ajaxterm.initd","w").write(file("configure.initd.redhat").read()%locals())
29
file("ajaxterm.initd","w").write(file("configure.initd.debian").read()%locals())
31
os.system("chmod a+x ajaxterm.bin")
32
os.system("chmod a+x ajaxterm.initd")