From 88c96bed0a86e0fd1b5f7805b6a2cb05bd41de7d Mon Sep 17 00:00:00 2001
From: David Keitel <david.keitel@ligo.org>
Date: Fri, 13 Apr 2018 14:42:14 +0100
Subject: [PATCH] make MakeSFTDAG installable as lalapps_MakeSFTDAG

 -moving up contents from MakeSFTs/script directory to MakeSFTs/
 -renaming source python script to lalapps_MakeSFTDAG.py
 -removing executable flag and shebang from it
  since the build system doesn't like it
 -so from now on it needs to be called from install location
  (as 'lalapps_MakeSFTDAG')
  or, if from source tree, as 'python lalapps_MakeSFTDAG.py'
 -refs https://git.ligo.org/CW/lalsuite/issues/35
---
 lalapps/.gitignore                                         | 1 +
 lalapps/src/pulsar/MakeSFTs/{scripts => }/CopySFTs.tcl     | 0
 .../src/pulsar/MakeSFTs/{scripts => }/MakeSFTs.sub.example | 0
 lalapps/src/pulsar/MakeSFTs/Makefile.am                    | 7 +++++++
 .../src/pulsar/MakeSFTs/{scripts => }/datafind.sub.example | 0
 .../MakeSFTs/{scripts/MakeSFTDAG => lalapps_MakeSFTDAG.py} | 1 -
 .../src/pulsar/MakeSFTs/{scripts => }/onasysd.example.ini  | 0
 .../src/pulsar/MakeSFTs/{scripts => }/onasysd.example.sub  | 0
 8 files changed, 8 insertions(+), 1 deletion(-)
 rename lalapps/src/pulsar/MakeSFTs/{scripts => }/CopySFTs.tcl (100%)
 rename lalapps/src/pulsar/MakeSFTs/{scripts => }/MakeSFTs.sub.example (100%)
 rename lalapps/src/pulsar/MakeSFTs/{scripts => }/datafind.sub.example (100%)
 rename lalapps/src/pulsar/MakeSFTs/{scripts/MakeSFTDAG => lalapps_MakeSFTDAG.py} (99%)
 mode change 100755 => 100644
 rename lalapps/src/pulsar/MakeSFTs/{scripts => }/onasysd.example.ini (100%)
 rename lalapps/src/pulsar/MakeSFTs/{scripts => }/onasysd.example.sub (100%)

diff --git a/lalapps/.gitignore b/lalapps/.gitignore
index 203f2dfeaa..78864f4e48 100644
--- a/lalapps/.gitignore
+++ b/lalapps/.gitignore
@@ -253,6 +253,7 @@ src/pulsar/Injections/lalapps_Makefakedata_v5
 src/pulsar/Injections/lalapps_compareTS
 src/pulsar/MakeSFTs/lalapps_LISAmakeSFTs
 src/pulsar/MakeSFTs/lalapps_MakeSFTs
+src/pulsar/MakeSFTs/lalapps_MakeSFTDAG
 src/pulsar/SFTTools/SFT-bad1
 src/pulsar/SFTTools/SFT-bad10
 src/pulsar/SFTTools/SFT-bad11
diff --git a/lalapps/src/pulsar/MakeSFTs/scripts/CopySFTs.tcl b/lalapps/src/pulsar/MakeSFTs/CopySFTs.tcl
similarity index 100%
rename from lalapps/src/pulsar/MakeSFTs/scripts/CopySFTs.tcl
rename to lalapps/src/pulsar/MakeSFTs/CopySFTs.tcl
diff --git a/lalapps/src/pulsar/MakeSFTs/scripts/MakeSFTs.sub.example b/lalapps/src/pulsar/MakeSFTs/MakeSFTs.sub.example
similarity index 100%
rename from lalapps/src/pulsar/MakeSFTs/scripts/MakeSFTs.sub.example
rename to lalapps/src/pulsar/MakeSFTs/MakeSFTs.sub.example
diff --git a/lalapps/src/pulsar/MakeSFTs/Makefile.am b/lalapps/src/pulsar/MakeSFTs/Makefile.am
index b725d39d24..2784ce6544 100644
--- a/lalapps/src/pulsar/MakeSFTs/Makefile.am
+++ b/lalapps/src/pulsar/MakeSFTs/Makefile.am
@@ -1,5 +1,7 @@
 MOSTLYCLEANFILES =
+EXTRA_DIST =
 include $(top_srcdir)/gnuscripts/lalapps.am
+include $(top_srcdir)/gnuscripts/lalsuite_python.am
 include $(top_srcdir)/gnuscripts/lalsuite_help2man.am
 
 if FRAME
@@ -31,3 +33,8 @@ lalapps_MakeSFTs_CPPFLAGS = $(AM_CPPFLAGS)
 if PSS
 lalapps_MakeSFTs_CPPFLAGS += -DPSS_ENABLED
 endif
+
+if HAVE_PYTHON
+pybin_scripts = lalapps_MakeSFTDAG
+pkgpython_PYTHON =
+endif
diff --git a/lalapps/src/pulsar/MakeSFTs/scripts/datafind.sub.example b/lalapps/src/pulsar/MakeSFTs/datafind.sub.example
similarity index 100%
rename from lalapps/src/pulsar/MakeSFTs/scripts/datafind.sub.example
rename to lalapps/src/pulsar/MakeSFTs/datafind.sub.example
diff --git a/lalapps/src/pulsar/MakeSFTs/scripts/MakeSFTDAG b/lalapps/src/pulsar/MakeSFTs/lalapps_MakeSFTDAG.py
old mode 100755
new mode 100644
similarity index 99%
rename from lalapps/src/pulsar/MakeSFTs/scripts/MakeSFTDAG
rename to lalapps/src/pulsar/MakeSFTs/lalapps_MakeSFTDAG.py
index cfb93818c8..75470508bb
--- a/lalapps/src/pulsar/MakeSFTs/scripts/MakeSFTDAG
+++ b/lalapps/src/pulsar/MakeSFTs/lalapps_MakeSFTDAG.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 """
 
 MakeSFTDAG.py - Creates DAGs to run jobs that generates SFTs; can act as a dag generator for use with onasys.
diff --git a/lalapps/src/pulsar/MakeSFTs/scripts/onasysd.example.ini b/lalapps/src/pulsar/MakeSFTs/onasysd.example.ini
similarity index 100%
rename from lalapps/src/pulsar/MakeSFTs/scripts/onasysd.example.ini
rename to lalapps/src/pulsar/MakeSFTs/onasysd.example.ini
diff --git a/lalapps/src/pulsar/MakeSFTs/scripts/onasysd.example.sub b/lalapps/src/pulsar/MakeSFTs/onasysd.example.sub
similarity index 100%
rename from lalapps/src/pulsar/MakeSFTs/scripts/onasysd.example.sub
rename to lalapps/src/pulsar/MakeSFTs/onasysd.example.sub
-- 
GitLab