Subject: Rename CLI tool to source-extractor
From: Teake Nutma <[email-masked]>
Date: Tue, 3 Sep 2019 16:17:02 +0200

---
 configure.ac           | 12 ++++++------
 doc/src/Config.rst     |  2 +-
 doc/src/Input.rst      |  2 +-
 doc/src/Installing.rst |  4 ++--
 doc/src/Param.rst      |  2 +-
 doc/src/Using.rst      |  2 +-
 man/Makefile.am        |  5 ++++-
 man/sex.1.in           | 16 ++++++++--------
 man/sex.x              |  2 +-
 src/Makefile.am        |  8 ++++----
 src/define.h           |  4 ++--
 tests/modelfit.test    |  2 +-
 12 files changed, 32 insertions(+), 29 deletions(-)

diff --git a/configure.ac b/configure.ac
index 07e1b37..942043d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,22 +5,22 @@
 #
 #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #
-#	This file part of:	SExtractor
+#	This file part of:	Source Extractor
 #
 #	Copyright:		(C) 2002-2023 CFHT/IAP/CNRS/SorbonneU
 #
 #	License:		GNU General Public License
 #
-#	SExtractor is free software: you can redistribute it and/or modify
+#	Source Extractor is free software: you can redistribute it and/or modify
 #	it under the terms of the GNU General Public License as published by
 #	the Free Software Foundation, either version 3 of the License, or
 # 	(at your option) any later version.
-#	SExtractor is distributed in the hope that it will be useful,
+#	Source Extractor is distributed in the hope that it will be useful,
 #	but WITHOUT ANY WARRANTY; without even the implied warranty of
 #	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #	GNU General Public License for more details.
 #	You should have received a copy of the GNU General Public License
-#	along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
+#	along with Source Extractor. If not, see <http://www.gnu.org/licenses/>.
 #
 #	Last modified:		07/03/2023
 #
@@ -31,8 +31,8 @@ define([AC_CACHE_LOAD],)
 define([AC_CACHE_SAVE],)
 
 # This is your standard AstrOmatic source code...
-AC_INIT([SExtractor],[2.28.0],[[email-masked]],
-        [sextractor],[http://astromatic.net/software/sextractor])
+AC_INIT(Source-Extractor, 2.28.0,[[email-masked]],
+	source-extractor, [http://astromatic.net/software/sextractor])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_AUX_DIR(autoconf)
 AC_CONFIG_SRCDIR(src/makeit.c)
diff --git a/doc/src/Config.rst b/doc/src/Config.rst
index be953db..111823d 100644
--- a/doc/src/Config.rst
+++ b/doc/src/Config.rst
@@ -19,7 +19,7 @@ By redirecting the standard output of SExtractor to a file, one creates a config
 
 .. code-block:: console
 
-  $ sex -d > default.sex
+  $ source-extractor -d > default.sex
 
 A more extensive dump with less commonly used parameters can be generated by using the ``-dd`` option.
 
diff --git a/doc/src/Input.rst b/doc/src/Input.rst
index fccf40e..e5e31b8 100644
--- a/doc/src/Input.rst
+++ b/doc/src/Input.rst
@@ -34,7 +34,7 @@ Double image mode is automatically engaged when providing |SExtractor| with two
 
 .. code-block:: console
 
-  $ sex detection.fits,measurement.fits
+  $ source-extractor detection.fits,measurement.fits
 
 A space may be used instead of a coma. In the example above, :file:`detection.fits` is used as a detection image, while measurements are carried out on :file:`measurement.fits`.
 
diff --git a/doc/src/Installing.rst b/doc/src/Installing.rst
index 6079234..37a06ee 100644
--- a/doc/src/Installing.rst
+++ b/doc/src/Installing.rst
@@ -87,7 +87,7 @@ In all cases, |SExtractor| can now be compiled with
 
   $ make -j
 
-An :file:`src/sex` executable is created. For system-wide installation, run the usual
+An :file:`src/source-extractor` executable is created. For system-wide installation, run the usual
 
 .. code-block:: console
 
@@ -97,7 +97,7 @@ You may now check that the software is properly installed by simply typing in yo
 
 .. code-block:: console
 
-  $ sex
+  $ source-extractor
 
 which will return the version number and other basic information (note that some shells require the :program:`rehash` command to be run before making a freshly installed executable accessible in the execution path).
 
diff --git a/doc/src/Param.rst b/doc/src/Param.rst
index 0a67f67..438b34f 100644
--- a/doc/src/Param.rst
+++ b/doc/src/Param.rst
@@ -9,7 +9,7 @@ In addition to the configuration file detailed above, |SExtractor| requires a fi
 
 .. code-block:: console
 
- $ sex -dp
+ $ source-extractor -dp
 
 Format
 ~~~~~~
diff --git a/doc/src/Using.rst b/doc/src/Using.rst
index 953b84e..95d8ea0 100644
--- a/doc/src/Using.rst
+++ b/doc/src/Using.rst
@@ -11,7 +11,7 @@ Using SExtractor
 
 .. code-block:: console
 
-  $ sex Image1 [Image2] -c configuration-file [-Parameter1 Value1 -Parameter2 Value2 ...]
+  $ source-extractor Image1 [Image2] -c configuration-file [-Parameter1 Value1 -Parameter2 Value2 ...]
 
 The parts enclosed within brackets are optional.
 Any `-Parameter Value` statement in the command-line overrides the corresponding definition in the configuration file or any default value (see :ref:`configuration section<config_file>`).
diff --git a/man/Makefile.am b/man/Makefile.am
index 8e1f78c..441696f 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -26,5 +26,8 @@
 #
 #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-dist_man_MANS = sex.1 sex.x
+dist_man_MANS = source-extractor.1
+
+source-extractor.1: sex.1
+	cp -f  $< $@
 
diff --git a/man/sex.1.in b/man/sex.1.in
index d0f7208..8a90720 100644
--- a/man/sex.1.in
+++ b/man/sex.1.in
@@ -1,18 +1,18 @@
 .TH SEXTRACTOR "1" "@DATE3@" "SExtractor @PACKAGE_VERSION@" "User Commands"
 .SH NAME
-sex \- extract a source catalogue from an astronomical FITS image
+source-extractor \- extract a source catalogue from an astronomical FITS image
 .SH SYNOPSIS
-.B sex \fIimage\fR [\fI-c configuration-file\fR]
+.B source-extractor \fIimage\fR [\fI-c configuration-file\fR]
 .RS
-[\fI-parameter1 value1 -parameter2 value2 ...\fR]
+[\fI\-parameter1 value1 \-parameter2 value2 ...\fR]
 .RE
 .TP
-.B sex \fIimage\_detect\fR \fIimage_measure\fR [\fI-c configuration-file\fR]
+.B source-extractor \fIimage\_detect\fR \fIimage_measure\fR [\fI-c configuration-file\fR]
 .RS
-[\fI-parameter1 value1 -parameter2 value2 ...\fR]
+[\fI\-parameter1 value1 \-parameter2 value2 ...\fR]
 .RE
 .TP
-.B sex \fI-d\fR
+.B source-extractor \fI-d\fR
 .SH DESCRIPTION
 SExtractor is a program that builds a catalogue of objects from an astronomical
 image. Although it is particularly oriented towards reduction of large scale
@@ -39,8 +39,8 @@ Please report bugs to the SExtractor software forum at
 http://astromatic.net/forum.
 .SH "SEE ALSO"
 .BR
-eye(1), missfits(1), psfex(1), scamp(1), sky(1), stiff(1), stuff(1), swarp (1),
-ww(1)
+missfits(1), psfex(1), scamp(1), sky(1), stiff(1), stuff(1), swarp (1),
+weightwatcher(1)
 .SH AUTHORS
 Written by Emmanuel Bertin (Institut d'Astrophysique de Paris)
 .PP
diff --git a/man/sex.x b/man/sex.x
index c6f97ad..134310f 100644
--- a/man/sex.x
+++ b/man/sex.x
@@ -1,2 +1,2 @@
 [name]
-sex \- extract a source catalog from an astronomical FITS image
+source-extractor \- extract a source catalog from an astronomical FITS image
diff --git a/src/Makefile.am b/src/Makefile.am
index 3017766..8dd1c98 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -34,9 +34,9 @@ if USE_MODEL
   LEVDIR		= levmar
 endif
 SUBDIRS			= fits $(LEVDIR) wcs
-bin_PROGRAMS		= sex ldactoasc
-check_PROGRAMS		= sex
-sex_SOURCES		= analyse.c assoc.c astrom.c back.c bpro.c catout.c \
+bin_PROGRAMS		= source-extractor ldactoasc
+check_PROGRAMS		= source-extractor
+source_extractor_SOURCES= analyse.c assoc.c astrom.c back.c bpro.c catout.c \
 			  check.c clean.c dgeo.c extract.c $(FFTSOURCE) \
 			  field.c filter.c fitswcs.c flag.c graph.c growth.c \
 			  header.c image.c interpolate.c main.c makeit.c \
@@ -53,7 +53,7 @@ sex_SOURCES		= analyse.c assoc.c astrom.c back.c bpro.c catout.c \
 			  sexheadsc.h som.h threads.h types.h wcscelsys.h \
 			  weight.h winpos.h xml.h
 ldactoasc_SOURCES 	= ldactoasc.c ldactoasc.h
-sex_LDADD		= $(srcdir)/fits/libfits.a \
+source_extractor_LDADD		= $(srcdir)/fits/libfits.a \
 			  $(srcdir)/wcs/libwcs_c.a \
 			  $(LEVLIB) 
 ldactoasc_LDADD		= $(srcdir)/fits/libfits.a
diff --git a/src/define.h b/src/define.h
index 22653bb..2f163e7 100644
--- a/src/define.h
+++ b/src/define.h
@@ -35,9 +35,9 @@
 
 /*------------------------ what, who, when and where ------------------------*/
 
-#define		BANNER		"SExtractor"
+#define		BANNER		"Source Extractor"
 #define		MYVERSION	VERSION
-#define		EXECUTABLE	"sex"
+#define		EXECUTABLE	"source-extractor"
 #define         COPYRIGHT       "2012-2015 IAP/CNRS/UPMC"
 #define		DISCLAIMER	BANNER " comes with ABSOLUTELY NO WARRANTY\n" \
 		"You may redistribute copies of " BANNER "\n" \
diff --git a/tests/modelfit.test b/tests/modelfit.test
index a98dc0e..791032c 100755
--- a/tests/modelfit.test
+++ b/tests/modelfit.test
@@ -1,4 +1,4 @@
 #! /bin/sh
 # Copyright (C) 2007 Emmanuel Bertin.
 # 
-../src/sex galaxies.fits -WEIGHT_IMAGE galaxies.weight.fits -CATALOG_NAME galaxies.cat
+../src/source-extractor galaxies.fits -WEIGHT_IMAGE galaxies.weight.fits -CATALOG_NAME galaxies.cat