--- /home/hestern/pybuild/Twisted-12.1.0/twisted/scripts/tap2rpm.py.orig	2012-08-17 16:34:32.381232942 +0000
+++ /apps/lib/python2.7/site-packages/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/scripts/tap2rpm.py	2012-08-17 17:12:02.741992134 +0000
@@ -35,9 +35,9 @@
 [ -r /etc/default/%(rpm_file)s ] && . /etc/default/%(rpm_file)s
 
 #  check for required files
-if [ ! -x /usr/bin/twistd ]
+if [ ! -x %(twistd)s ]
 then
-        echo "$0: Aborting, no /usr/bin/twistd found"
+        echo "$0: Aborting, no %(twistd)s found"
         exit 0
 fi
 if [ ! -r "$file" ]
@@ -56,7 +56,7 @@
 case "$1" in
         start)
                 echo -n "Starting %(rpm_file)s: twistd"
-                daemon twistd  \\
+                daemon %(twistd)s  \\
                                 --pidfile=$pidfile \\
                                 --rundir=$rundir \\
                                 --%(twistd_option)s=$file \\
@@ -95,7 +95,7 @@
 Group:      Networking/Daemons
 Source:     %(tarfile_basename)s
 BuildRoot:  %%{_tmppath}/%%{name}-%%{version}-root
-Requires:   /usr/bin/twistd
+Requires:   %(twistd)s
 BuildArch:  noarch
 
 %%description
@@ -237,6 +237,8 @@
 
     tapFileBase = os.path.basename(config['tapfile'])
 
+    twistdPath = os.path.join(os.path.dirname(sys.argv[0]), 'twistd')
+
     initFileInfo = tarfile.TarInfo(
             os.path.join(
                 config['release-name'],
@@ -248,6 +250,7 @@
     initFileRealData = initFileData % {
             'tap_file': tapFileBase,
             'rpm_file': config['release-name'],
+            'twistd': twistdPath,
             'twistd_option': config['twistd_option'],
         }
     initFileInfo.size = len(initFileRealData)
@@ -279,6 +282,7 @@
             'date': time.strftime('%a %b %d %Y', time.localtime(time.time())),
             'maintainer': config['maintainer'],
             'long_description': config['long_description'],
+            'twistd': twistdPath,
         }
     specHandle.write(specFileRealData)
     specHandle.close()
