[SCM] calculates spectra of different spectroscopies branch, master, updated. upstream/0.0.20120607-1-g9837e22

Andreas Tille tille at debian.org
Fri Jun 29 21:31:22 UTC 2012


The following commit has been merged in the master branch:
commit 9837e222a3a57890d948b37943afc81b67a49130
Author: Andreas Tille <tille at debian.org>
Date:   Fri Jun 29 23:29:49 2012 +0200

    Initial packaging;  the most important thing which is lacking is any license statement from upstream

diff --git a/debian/Makefile_ESRF b/debian/Makefile_ESRF
new file mode 100644
index 0000000..a592b26
--- /dev/null
+++ b/debian/Makefile_ESRF
@@ -0,0 +1,321 @@
+################################################################################
+#
+# This Makefile creates the executable "fdmnes" of the X-ray absorption
+# spectroscopy package.
+#
+# (GNUmake file, will not work with basic Unix make command, use gmake.)
+#
+# This Makefile can compile "fdmnes" for Linux (32 and 64 bit) and Windows PCs
+# with CYGWIN. The versions for the different operating systems are stored in
+# different subdirectories. For details, see below.
+#
+# Possible targets of this Makefile are:
+#
+# - all          (default) to make the executable
+# - clean        to clean all object files created by the Makefile
+# - allclean     to clean everything that was created by the Makefile
+#
+# Update: 11/06/2012 R. Wilcke (wilcke at esrf.fr)
+#                    add a comment about the OS "Debian6".
+# Update: 03/03/2011 R. Wilcke (wilcke at esrf.fr)
+#                    removed the code for "Solaris";
+#                    added compiler options for the "module" files directory.
+# Update: 24/02/2011 R. Wilcke (wilcke at esrf.fr)
+#                    create target "ERR_CONF" for incorrect specification of the
+#                    executable;
+#                    remove linker option "-static" for LINUX-MPI executable.
+# Update: 13/12/2010 R. Wilcke (wilcke at esrf.fr)
+#                    set flag "-no-ansi-alias" in FFLAGS for LINUX ifort.
+# Update: 31/05/2010 R. Wilcke (wilcke at esrf.fr)
+#                    define new macros FDM_SUBSPC and FFLAGSPC for routines that
+#                    need special compile options;
+#                    put module "sub_util.o" from FDM_SUBS into FDM_SUBSPC;
+#                    set flag "-ffloat-store" in FFLAGSPC for CYGWIN;
+#                    define new macro FDM_EXEC to contain the full name
+#                    (including directory) of the FDMNES executable, and make
+#                    this the main target ("all") of the Makefile.
+# Update: 21/05/2010 R. Wilcke (wilcke at esrf.fr)
+#                    add routines "hubbard.o" and "tddft.o" to macro FDM_SUBS.
+# Update: 30/03/2009 R. Wilcke (wilcke at esrf.fr)
+#                    add new routine "scf.o" to macro FDM_SUBS.
+# Update: 25/04/2008 R. Wilcke (wilcke at esrf.fr)
+#                    add new routines "fdm.o", "potential.o" and "select.o" to
+#                    macro FDM_SUBS.
+# Update: 03/08/2007 R. Wilcke (wilcke at esrf.fr)
+#                    add new routine "tab_data.o" to macro FDM_SUBS;
+#                    change OS dependent subdirectory name to "bin/cygwin" for
+#                    CYGWIN (same name as provided by CS script "get_os").
+# Update: 11/04/2007 R. Wilcke (wilcke at esrf.fr)
+#                    change macro DIRECTORY to DIRNAM;
+# Update: 11/01/2007 R. Wilcke (wilcke at esrf.fr)
+#                    add new routine "lecture.o" to macro FDM_SUBS.
+# Update: 09/01/2007 R. Wilcke (wilcke at esrf.fr)
+#                    change logic for MPI compilation, remove MPIHOME macro.
+# Update: 31/07/2006 R. Wilcke (wilcke at esrf.fr)
+#                    make DIRECTORY a simple expanded variable and use shell().
+# Update: 03/07/2006 R. Wilcke (wilcke at esrf.fr)
+#                    get OS dependent subdirectory from CS script "get_os".
+# Update: 28/06/2006 R. Wilcke (wilcke at esrf.fr)
+#                    add macro MPIHOME for the MPI installation directory;
+#                    change default for names of external references for ABSOFT.
+# Update: 21/03/2005 R. Wilcke (wilcke at esrf.fr)
+#                    change the name of some macros for better consistency with
+#                    other software, simplify the conditional execution clauses.
+# Update: 08/02/2005 R. Wilcke (wilcke at esrf.fr)
+#                    first working version.
+#
+################################################################################
+#
+# Start of user-definable parameters
+#-------------------------------------------------------------------------------
+#
+
+#FDM_NAME = fdmnes_mpi
+FDM_NAME = fdmnes
+
+FFLAGS = -c
+DBGFLAG =
+#DBGFLAG = -g
+OPTLVL = 3
+
+#
+# End of user-definable parameters
+#-------------------------------------------------------------------------------
+#
+# FDM_SUBSPC contains the list of modules that need special compile options
+# FFLAGSPC   contains these special compile options
+FDM_SUBSPC =
+FFLAGSPC =
+
+MPI_DUM = not_mpi.o
+MPI_NOINC =
+
+#
+# Find out the operating system, and define the names of the directories
+# for the object files and executables accordingly. They will be in
+#    bin/$(DIRNAM)
+#
+# where $(DIRNAM) is
+# - cygwin    on PCs with the Cygnus user enviromnent
+# - centos5   on 64-bit Linux systems with CentOS version 5
+# - debian6   on 64-bit Linux systems with Debian version 6
+# - redhate3  on 32-bit Linux systems with RedHat version 3
+# - redhate4  on 64-bit Linux systems with RedHat version 4
+# - redhate5  on 64-bit Linux systems with RedHat version 5
+# - suse82    on 32-bit Linux systems with Suse version 8.2
+# - suse90    on 64-bit Linux systems with Suse version 9.0
+#
+HOST = $(shell uname -s)
+
+ifeq ($(findstring CYGWIN,$(HOST)),CYGWIN)
+   DIRNAM := ../bin/cygwin
+   SYSTEM = CYGWIN
+else
+# DIRNAM := ../bin/$(shell get_os)
+DIRNAM := tmp
+ifeq ($(word 1, $(HOST)),Linux)
+   SYSTEM = LINUX
+endif      # Linux
+endif      # CYGWIN
+
+#
+# FDM_EXEC contains the full name of the executable, including directory name
+# and (where applicable) suffix.
+#
+# Giving the full name of the executable as main target of the Makefile allows
+# "make" to locate the executable. If only specifying the module name, "make"
+# does not find it (as it is not in the present directory) and therefore always
+# remakes it, even when that is not necessary.
+#
+#
+FDM_EXEC := $(DIRNAM)/$(FDM_NAME)
+
+ifeq ($(SYSTEM),LINUX)
+#
+# Intel Fortran 90 compiler.
+#
+# For external reference names use the ESRF's F90 defaults: convert names to
+# lower case and add trailing underscore.
+#
+#   FC := ifort
+   FC := gfortran
+   MPIFC = mpif90
+#
+# With OPTLVL=3 ifort needs this option, otherwise the program goes into an
+# infinite loop (too agressive optimization by the compiler, it seems).
+#
+   FFLAGS += # -no-ansi-alias
+#
+# The path to the module files is defined with the "-module" option for "ifort".
+#
+#   FFLAGS += -module $(DIRNAM)
+#   DBGFLAG += -debug extended -traceback
+#   DBGFLAG += -check all
+#   DBGFLAG += -check uninit -check bounds
+#   DBGFLAG += -debug all
+#
+# Absoft Fortran 90 compiler.
+#
+# For external reference names use the ESRF's F90 defaults: convert names to
+# lower case and add trailing underscore.
+#
+# Use -YDEALLOC option to force deallocation of dynamic memory.
+#
+#   FC := af90
+#   MPIFC = mpif90
+#   FFLAGS += -YEXT_NAMES=LCS -YEXT_SFX=_ -YDEALLOC=ALL
+#   LDFLAGS = -X
+#
+# Portland Fortran 90 compiler
+#   FC := pgf90
+#
+# Public Domain g95 Fortran 95 compiler (www.g95.org).
+#
+# For external reference names use the ESRF's F90 defaults: convert names to
+# lower case and add one trailing underscore.
+#
+#   FC := g95
+#
+# Routine "DLAMC1()" in "sub_util.f" must be compiled with flag "-ffloat-store",
+# otherwise the program goes into an infinite loop.
+#
+#   FFLAGSPC += -ffloat-store
+#
+# The path to the module files is defined with the "-fmod" option for "g95".
+#
+#   FFLAGS += -fmod=$(DIRNAM)
+#
+# Creates traceback for runtime errors.
+#
+#   DBGFLAG += -ftrace=full -Wuninitialized -Wunset-vars
+#
+# GNU Fortran 95 compiler
+   FC := gfortran
+#
+# The path to the module files is defined with the "-J" option for "gfortran".
+#
+   FFLAGS += -J$(DIRNAM)
+   DBGFLAG += -fbacktrace
+#
+#
+# MPI F90 compilation script.
+# This actually uses the selected F90 compiler with the MPI parallel processing
+# library.
+#
+# For external reference names use the ESRF's F90 defaults: convert names to
+# lower case and add trailing underscore (these options are set in "mpif90").
+#
+# Note that on the newer versions of the LINUX operating system, "static"
+# linking does not work well with MPI. It seems that with static linking the
+# MPI processes cannot communicate with each other if they are on different
+# hosts.
+#
+   ifeq ($(FDM_NAME),fdmnes_mpi)
+      FC := $(MPIFC)
+      MPI_DUM =
+      MPI_NOINC = mpif.h.not
+   else
+      LDFLAGS += # We just do no static linking under Debian anyway ... ### -static
+   endif
+else
+ifeq ($(SYSTEM),CYGWIN)
+   ifeq ($(FDM_NAME),fdmnes)
+#
+# For CYGWIN, add suffix ".exe" to the name of the executable.
+#
+      FDM_EXEC := $(FDM_EXEC).exe
+#
+# The path to the module files is defined with the "-J" option for "gfortran",
+# and with the "-fmod" option for "g95".
+#
+#      FC := gfortran
+#      FFLAGS += -J$(DIRNAM)
+      FC := g95
+      FFLAGS += -fmod=$(DIRNAM)
+#      DBGFLAG += -fbounds-check
+#      DBGFLAG += -fzero
+#      DBGFLAG += -ftrace=full
+#
+# Routine "DLAMC1()" in "sub_util.f" must be compiled with flag "-ffloat-store",
+# otherwise the program goes into an infinite loop.
+#
+      FFLAGSPC += -ffloat-store
+      LDFLAGS = # We just do no static linking under Debian anyway ... ### -static
+   else
+      ERR_CONF = 1
+   endif
+endif      # CYGWIN
+endif      # LINUX
+
+FFLAGS += -O$(OPTLVL) $(DBGFLAG)
+
+#
+# Define search path for dependency files
+#
+vpath %.o ./$(DIRNAM)
+
+#
+# Define symbol for normal FDMNES files
+#
+FDM_SUBS = main.o clemf0.o coabs.o convolution.o dirac.o fdm.o fprime.o \
+   general.o hubbard.o lecture.o mat.o metric.o minim.o potential.o scf.o \
+   selec.o spgroup.o sphere.o tab_data.o tddft.o tensor.o $(MPI_DUM)
+#
+# Define symbol for FDMNES files that need special compilation options
+#
+FDM_SUBSPC = sub_util.o
+
+#
+# Define total system link symbol
+#
+LINK = $(SYS_LIBS)
+
+all: $(FDM_EXEC)
+
+$(FDM_EXEC): $(ERR_CONF) $(DIRNAM) $(MPI_NOINC) $(FDM_SUBS) $(FDM_SUBSPC)
+	(cd $(DIRNAM); \
+	   $(FC) $(DBGFLAG) $(LDFLAGS) $(FDM_SUBS) $(FDM_SUBSPC) $(LINK) \
+	   -o $(notdir $@))
+ifdef MPI_NOINC
+	mv $(MPI_NOINC) mpif.h
+endif
+
+$(ERR_CONF):
+	$(error *** Cannot create $(FDM_NAME) on $(SYSTEM) - exit)
+
+#
+# Create directory for binaries if needed.
+#
+$(DIRNAM):
+	mkdir -p $(DIRNAM)
+
+#
+# For compilation with MPI, move the local "mpif.h" file to a dummy name to
+# force the compiler to get the real one from the MPI distribution.
+#
+$(MPI_NOINC):
+	mv mpif.h $(MPI_NOINC)
+
+#
+# Rule to compile all normal Fortran source files
+#
+$(FDM_SUBS): %.o: %.f
+	$(FC) $(FFLAGS) $< -o ./$(DIRNAM)/$(notdir $@)
+
+#
+# Rule to compile all Fortran source files needing special compile options
+#
+$(FDM_SUBSPC): %.o: %.f
+	$(FC) $(FFLAGS) $(FFLAGSPC) $< -o ./$(DIRNAM)/$(notdir $@)
+
+#
+# Remove all object files
+#
+clean:
+	rm -f $(DIRNAM)/*.o $(DIRNAM)/*.mod
+
+#
+# Remove everything created by the Makefile
+#
+allclean:
+	rm -rf $(DIRNAM)
diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 0000000..3be6985
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,9 @@
+fdmnes for Debian
+=================
+
+To run this program you need to copy the file
+   /usr/share/doc/fdmnes/examples/fdmfile.txt
+to your working directory and change the parameters
+according to the documentation.
+
+ -- Andreas Tille <tille at debian.org>  Tue, 26 Jun 2012 11:19:22 +0200
diff --git a/debian/Readme_ESRF.txt b/debian/Readme_ESRF.txt
new file mode 100644
index 0000000..1d6d124
--- /dev/null
+++ b/debian/Readme_ESRF.txt
@@ -0,0 +1,533 @@
+                                    FDMNES                            12/06/2012
+                                    ======
+
+This file contains information specific to the installation of FDMNES at the
+ESRF:
+
+1) general information on FDMNES;
+2) the executable to select, and how to run it;
+3) the use of a batch processing system to run FDMNES;
+4) the input files needed;
+5) a list of the files and directories provided.
+
+
+1) General
+----------
+
+The installation contains the FDMNES version of 16/May/2012 with executables for
+Windows XP (native and Cygwin) and LINUX (64 bit).
+
+FDMNES calculates the spectra of different spectroscopies related to the real or
+virtual absorption of x-rays in material. It was written by Yves Joly of the
+"Institut Neel", CNRS Grenoble.
+
+For more details on the program, see the the file "readme.txt" in this
+directory, the manuals mentioned in this file and the web page
+http://www.neel.cnrs.fr/fdmnes
+
+The Windows XP native executable is part of the FDMNES distribution provided by
+Yves Joly at the web site mentioned above.
+
+The Windows Cygwin executable was compiled at the ESRF using the public domain
+Fortran 95 compiler "g95" version 0.92 (see www.g95.org) under Cygwin version
+1.7.9.
+
+The LINUX executable "fdmnes_linux64" is also part of the FDMNES distribution
+provided by Yves Joly. It was compiled on a 64-bit computer with the Portland
+Fortran 90 compiler.
+
+The other LINUX versions of the program were compiled at the ESRF using the
+Intel Fortran 90 compiler version 12.0.0. The parallel (MPI) versions were
+linked with the Intel MPI Library version 4.0 Update 1, this implements (most
+of) the MPI-2.1 functionality.
+
+For questions concerning the FDMNES installation at the ESRF, contact R. Wilcke
+(wilcke at esrf.fr, phone 2516).
+
+
+2) Program Execution
+--------------------
+
+This version can use the "Message Passing Interface" (MPI) mechanism of parallel
+computing. Therefore, there are two different executables for each computer
+architecture where MPI is available: one without and the other with MPI. MPI is
+(at present) only available on NICE-Linux computers ("rnice" and the high-
+performance clusters "hpc" and "htc").
+
+The names of the executables are "fdmnes" for the version without MPI and
+"fdmnes_mpi" for the version with MPI (where available).
+
+To execute the program, there are four possibilities:
+
+1) on the NICE-Linux computers, "/usr/local/bin/fdmnes" is a link to the
+   corresponding non-MPI executable, and "/usr/local/bin/fdmnes_mpi" is a link
+   to the corresponding MPI executable. Thus if your PATH environment contains
+   "/usr/local/bin", you can access the appropriate executable by just typing
+   "fdmnes" or "fdmnes_mpi";
+
+2) on the NICE-Linux computers, add the location of the program to your PATH
+   environment variable. The program is in a correspondingly named subdirectory
+   of "bin" (see below "Directories and Files", subdirectory "bin");
+
+3) use the script "fdmnes.sh" as an uniform interface to FDMNES. For more
+   information, see below "Directories and Files".
+
+4) copy the executable and the input files (see below "Input Files") into a
+   directory of your choice and run it from there.
+
+If you want to use the Windows version (native XP or Cygwin) of FDMNES on your
+own Windows PC, you can only use the fourth option.
+
+Moreover, if you want to use the Cygwin version and you do not have the Cygwin
+environment (version at least 1.5.24) installed on your computer, you need to
+copy the library "cygwin1.dll" into the same directory as the FDMNES executable
+on your PC (this library is provided, see below "Directories and Files"). You
+can then execute FDMNES in the standard Windows manner by double-clicking on it
+from the Windows explorer.
+
+If you want to execute FDMNES (with or without MPI) on your own Linux/Unix
+computer (e.g. on a beamline), you can only use the third or fourth option.
+
+If you want to use the MPI version of FDMNES, you can
+
+- start it with the "mpirun" command, which is in
+  "/usr/lib64/openmpi/1.4-gcc/bin". You may want to add this location to your
+  PATH environment variable;
+
+- or you can use the script "fdmnes.sh" (option 3 above) to run the MPI version
+  of FDMNES as well. This script will then start FDMNES for you. To get some
+  information on how to use it, type "fdmnes.sh -h".
+
+MPI needs two configuration files to run a parallel program:
+
+- a password file, which must reside in your HOME directory and have the name
+  ".mpd.conf" (note the leading dot ".");
+
+- a host file, which contains the names of the computers on which the MPI
+  program is to run. This file should reside in the directory where you start
+  your job from and have the name "mpd.hosts", but that can be changed with the
+  "-f" option of "mpirun". This file should contain the names of all "rnice"
+  computers if you run on "rnice", etc.
+
+Examples of the configuration files are provided (see section "Directories and
+Files" below).
+
+If the configuration files have been put into the default places, then a typical
+way to start the MPI version of FDMNES (in this case with 8 processes) is
+
+   mpirun --totalnum=8 -np 8 fdmnes_mpi
+
+or, if you use your own host file with the name "mpd.myhost"
+
+   mpirun --totalnum=8 -f mpd.myhost -np 8 fdmnes_mpi
+
+Using "fdmnes.sh" to start your MPI version of FDMNES, the equivalent commands
+would be
+
+   fdmnes.sh -np 8
+or
+   fdmnes.sh -np 8 -f mpd.myhost
+
+For more details, type "mpirun --help" or see "Intel MPI Library for Linux OS"
+manuals "Getting Started Guide" and "Reference Manual", which are in the
+directory "/opt/intel/ics/2011.0.013/impi/doc".
+
+Note that the MPI system tries to distribute your job over several computers.
+This can lead to some problems:
+
+- MPI fails with "Permission denied" errors, as it cannot start jobs remotely;
+- MPI fails with "No route to start" errors, as one of its target computers is
+  unavailable;
+- MPI warns that that the authenticity of the host it wants to connect to cannot
+  be established, and/or it requests the user's password every time it connects
+  to a computer.
+
+These problems will be explained in detail in the following.
+
+a) the MPI system must have the permission to start jobs remotely, otherwise it
+   will fail with "Permission denied" errors. One way to grant this permission
+   is to have all NICE-Linux computers listed in your own ".rhosts" file. See
+   the example file "example.rhosts" and the "man" pages for "rhosts" for more
+   information.
+
+   To make sure that all computers available for MPI jobs are contained in the
+   ".rhosts" file, it is easiest to use the script that Computing Services
+   provides for this purpose:
+
+      /sware/pub/condor/utilities/CREATE_rhosts
+
+   This will either create a suitable ".rhosts" file in the user's HOME
+   directory if there is none, or update an existing ".rhosts" file by adding
+   the missing computers.
+
+b) if one of the computers selected by the MPI system is unavailable (e.g.
+   "rnice31" is down), you get the following error message:
+
+      rnice31.esrf.fr: No route to start
+
+   As such a situation may last a while, here is a general way how to get around
+   the problem until the corresponding computer is back in operation:
+
+   First verify that the computer is indeed down by trying to log into it.
+   Note: getting a response from "ping" is not sufficient. It can happen that
+   logon to a computer is no longer possible, but it still responds to "ping".
+   Under those circumstances MPI will fail.
+
+   If you can reach the computer but still get this error message, then there is
+   a different problem. You will have to try to find out what is happening.
+
+   If, however, the computer is down, then you need to remove it from the list
+   of computers that the MPI system uses. This list is in the "host file" (one
+   of the MPI configuration files mentioned above).
+
+   If you want to exclude a computer from this list - e.g. "rnice31" in this
+   case, as it is not operational - then you should edit the host file to remove
+   the "rnice31" entry. Alternatively, you can create a new version of the host
+   file under a different name, remove the offending computer there and start
+   the MPI run with the "-f" option using the new host file.
+
+   For more details, see the "mpirun" documentation.
+
+c) MPI uses the "SSH" (Secure SHell) mechanism for the communication between the
+   various processes that run on different computers for a given MPI job.
+
+   SSH needs two keys, a public and a private one. It uses the private one to
+   initiate the communication to the desired remote computer, where the
+   encryption mechanism takes it and checks whether it is the correct private
+   key for this user's public key.
+
+   For this to work, SSH needs a file with the computers that it can use, and
+   one file each for its public and its private key. These files are kept in the
+   subdirectory ".ssh" of the user's home directory.
+
+   The file "known_hosts" contains the computer names. If you do not have this
+   file, or if the computers that you want to use are not contained in this
+   file, you will get a message that the authenticity of the host MPI wants to
+   connect to cannot be established. It then asks whether you want to continue.
+
+   You should answer "yes" to that question, as often as it is asked (once for
+   each new computer MPI connects to). This will automatically generate or
+   update the file "known_hosts", thus when you run the program again, you
+   should not be asked the question again, at least not for the same computers!
+
+   Warning: the identification data in "known_hosts" can become outdated, in
+   which case you get an error about an incorrect identity. If this happens, the
+   easiest is to delete the file "known_hosts", and then have it recreated as
+   described above.
+
+   The public and the private key are stored in the files "id_dsa.pub" and
+   "id_dsa", respectively. In addition, a third file "authorized_keys" is
+   needed.
+
+   If you do not have those files in your ".ssh" directory, then MPI will ask
+   you for your password every time it starts a process on a new computer. As
+   this is a bit tiring, you should create these files using "ssh-keygen".
+
+   A simple way to get this done is as follows:
+
+   c.1) type (in any directory) "ssh-keygen -t dsa"
+   c.2) you get some output, then the following line:
+          Enter file in which to save the key (/Your_Home_Dir/.ssh/id_dsa):
+   c.3) hit the "Enter" key
+   c.4) you get the line:
+          Enter passphrase (empty for no passphrase):
+   c.5) hit the "Enter" key
+   c.6) you get the line:
+          Enter same passphrase again:
+   c.7) hit the "Enter" key
+   c.8) the program runs and should tell you where your "identification" and
+        your "public key" has been saved.
+
+   You should now have in your ".ssh" directory the two new files "id_dsa" and
+   "id_dsa.pub".
+
+   The file "authorized_keys" is just a copy of the file "id_dsa.pub", thus copy   it over:
+
+      cp id_dsa.pub authorized_keys
+
+   For more details, see the manual pages for "ssh" and "ssh-keygen".
+
+
+3) Batch Program Processing
+---------------------------
+
+Instead of starting the program manually and then waiting for it to finish while
+looking at the output on the screen, the program can also be submitted to a
+batch queue. The scheduler of the queue will then execute it, based on the
+user's requirements. This is in particular to be recommended if long jobs are to
+be run and/or if the user wants to have several (many) jobs to be processed, but
+does not necessarily want them all to occupy the computer at the same time.
+
+At the ESRF, we use the OAR batch scheduler for the computers with the CentOS 5
+or the Debian 6 operating systems, in particular for the high-performance
+clusters "hpc" and "htc".
+
+When using the batch scheduler to submit MPI jobs, you do not need to specify a
+host file for MPI nor set up the public and private keys for SSH (see section
+"Program Execution" above), as the batch manager will take care of this. You
+must, however, still supply the MPI password file.
+
+
+Use of OAR
+----------
+
+The OAR scheduler is used at the ESRF for the computers running the CentOS 5 or
+the Debian 6 operating system, in particular the high-performance clusters "hpc"
+and "htc" (see http://wikiserv.esrf.fr/software/index.php/Main_Page for details
+of the ESRF's installation, or the documentation on the OAR home page
+http://oar.imag.fr/users/user_documentation.html).
+
+OAR is more than just a batch queue scheduler, it is a resource scheduler. In
+particular, it is possible to reserve computing resources with OAR for
+interactive computing. In fact, this is the only way to run interactive jobs on
+the high-performance cluster, as no direct login is allowed on the "hpc" and
+"htc" computers.
+
+A side effect of OAR being a resource scheduler is that you must specify how
+long (elapsed time) you want to use the resource. This is different from the way
+the old scheduler CONDOR worked, where a job always ran to its end, no matter
+how long that took. OAR will terminate a job once the reserved length of time is
+over.
+
+As you cannot directly log into the ESRF's high-performance cluster, the "rnice"
+computers serve as the front end. To use the high-performance cluster, you log
+into one of the "rnice" computers and use the OAR commands to request computing
+resources on the high-performance cluster. OAR then schedules and grants these
+requests and (in the case of a batch job) runs the corresponding jobs on the
+high-performance cluster.
+
+The OAR commands are in "/usr/bin", and the manual pages in "/usr/share/man".
+For the normal user, there are essentially three commands that are useful:
+
+- "oarsub"    to request a resource (submit a job to the batch queue);
+- "oarstat"   to inquire about the status of the submitted jobs;
+- "oardel"    to remove jobs from the batch queue.
+
+For detailed information, see the corresponding manual pages.
+
+The "oarstat" command, when used without any arguments, gives the status of all
+jobs in the system. This is slow, and probably not what most people want. To get
+only the status of your own jobs, use the "-u" option:
+
+   oarstat -u dupont
+
+gives only the status of the jobs submitted by user "dupont".
+
+The "oarsub" command can be used to request resources for interactive computing,
+or to submit a job to the batch queue. In both cases, you need to specify which
+resources you need and for how long with the "-l" option.
+
+This option allows to make quite specific requests (e.g. only for CPUs of a
+certain manufacturer, or with at least a given amount of memory, or...).
+However, the request most often used is likely to be for a number of cores.
+
+To request a certain number of cores for a given time, the option takes the
+following form:
+
+   -l /core=ncore,walltime=nh:nm:ns
+
+with
+   ncore: the number of cores
+   nh   : the number of hours to run
+   nm   : the number of minutes to run
+   ns   : the number of seconds to run
+
+The default is one computer core for two hours.
+
+Time for interactive processing can be requested with the "-I" option of
+"oarsub". Examples:
+
+   oarsub -I
+
+requests interactive use of one core for two hours.
+
+   oarsub -I -l /core=4,walltime=0:20:00
+
+requests interactive use of four cores for 20 minutes.
+
+When granting the request, OAR logs into one of the high-performance computers,
+and the user obtains an interactive shell on that computer. This can now be used
+for any task desired.
+
+It is in particular possible to run the parallel version of FDMNES
+interactively, using e.g. the "fdmnes.sh" script described above in the section
+"Program Execution". In this case it is not necessary to specify the number of
+parallel processes (i.e. the "-np" parameter) to "fdmnes.sh". The script tests
+if it has been called from an OAR environment, and if so it sets the number of
+processes accordingly.
+
+Instead of running interactively, you can also submit a job to the batch handler
+by specifying an executable in the "oarsub" command. OAR then runs the
+executable using the resources and the time requested. Note that the submit
+commands are issued on the "rnice" computers, but the jobs run on the
+high-performance cluster.
+
+Thus in order to run the parallel version of FDMNES with the "fdmnes.sh" script
+on 5 cores for 1 hour and 30 minutes of elapsed time, the "oarsub" command on
+"rnice" is:
+
+   oarsub -l /core=5,walltime=1:30:0 /sware/exp/fdmnes/fdmnes.sh
+
+Warning: the full path of the executable must be specified! As in the
+interactive case, the number of parallel processes needs not to be given.
+
+If only one job is to be run by the batch scheduler, the easiest is to submit it
+from the directory where the FDMNES input file "fdmfile.txt" resides. If,
+however, more than one job is to be submitted, matters get more complicated, as
+FDMNES does not allow different names for its input file.
+
+The solution is to have several data directories, one for each job. Each
+directory contains its own "fdmfile.txt" and (if needed) the additional files
+"xsect.dat" and "spacegroup.txt", as well as the input files for the
+calculations to be performed (see below "Input Files").
+
+In the "oarsub" command you then specify with the "-d" option for each job
+separately the name of the directory where the job will be started. All input
+and output for this particular job will refer to that directory, even if the
+"oarsub" command was issued in a different directory.
+
+The syntax of the "-d" option is
+
+   -d name_of_directory
+
+with "name_of_directory" the full name (with path) of the directory where the
+corresponding job is to start.
+
+In order to start two parallel FDMNES jobs on 5 cores for 1 hour each, the user
+"johndoe" might set up the two subdirectories "example_1" and "example_2" and
+then type the commands
+
+   oarsub -d /users/johndoe/example_1 -l /core=5,walltime=1:30:0 
+      /sware/exp/fdmnes/fdmnes.sh
+
+   oarsub -d /users/johndoe/example_2 -l /core=5,walltime=1:30:0 
+      /sware/exp/fdmnes/fdmnes.sh
+
+(Each "oarsub" command is fully typed on one line, they are distributed over two
+lines here only for better readability!)
+
+To make the task of submitting jobs to the OAR batch queue easier, there is the
+script "fdmnes_oar.sh" that can be used for this purpose. In this script, you
+have to modify the provided examples to suit your needs, and then just execute
+the script on "rnice". Thus the above "oarsub" command on "rnice" could be
+replaced by simply typing:
+
+   fdmnes_oar.sh
+
+One advantage of using this script is that many jobs can be submitted with just
+one "fdmnes_oar.sh" command. See the explanations in the script for more
+details.
+
+
+4) Input Files
+--------------
+
+To execute the example, copy the input files of the example (see below
+"Directories and Files", files "fdmfile.txt", "spacegroup.txt", "xsect.dat" and
+subdirectory "entree") into your own directory.
+
+You also need a (possibly empty) sub-directory "xanout/test_stand" in your
+directory. This is the output directory for the examples, and FDMNES will fail
+if it does not exist. 
+
+Note: the input files have been created on a WINDOWS system and therefore have
+the corresponding file properties. This means in particular that the "end of
+line" is indicated by a <CR><NL>, instead of just a <NL> as on UNIX systems. If
+you want to use the examples on WINDOWS, this is what you need. If you want to
+use them on LINUX, this will also work, as LINUX knows how to handle both UNIX
+and WINDOWS style files. However, if you want to use them on other UNIX systems,
+you will have to convert the files to UNIX style by removing the additional
+<CR>, otherwise you will get read errors during execution.
+
+The concerned files are: "fdmfile.txt", "spacegroup.txt", "xsect.dat", and all
+files in the subdirectories of "entree" (see below "Directories and Files").
+
+
+5) Directories and Files
+------------------------
+This directory contains the following subdirectories and files:
+
+Readme_ESRF.txt  this file
+readme.txt       general FDMNES information
+FDMNES_Modifications.txt
+                 list of corrections and modifications
+
+Manuel_Eng.pdf   FDMNES manual in English
+Manuel.pdf       FDMNES manual in French (more detailed than Manuel_Eng.pdf)
+Manuel_cours.pdf course on the x-ray absorption spectroscopies in French
+
+fdmfile.txt      FDMNES general input data file (contains the number and names 
+                 of the "indata" files, see "entree" directory below)
+xsect.dat        input file for resonant spectroscopy
+spacegroup.txt   input file with all space groups
+
+fdmnes.exe       FDMNES executable for Windows XP
+
+fdmnes_linux64   FDMNES executable for 64-bit LINUX (Portland Fortran 90)
+
+fdmnes.sh        script to run the FDMNES program at the ESRF. It allows to run
+                 the non-MPI or the MPI version of FDMNES and also to specify a
+                 different name for the input file "fdmfile.txt".
+
+                 Although set up for the ESRF central computers, this script can
+                 easily be re-configured for a particular user environment on a
+                 beamline or desktop computer and could thus provide an uniform
+                 user interface for FDMNES in varying configurations.
+
+                 For more information, see the description in the file.
+
+mpd.password     the password file needed by MPI. Copy it to $HOME/.mpd.conf
+                 Note: for security reasons, this file must have read- and
+                 write-permissions only for the owner (permission code 600)!
+
+mpd.hosts.centos5  |  the host files needed by MPI for 64-bit Linux.
+mpd.hosts.redhate5 |  Copy the one you need to "mpd.hosts" in your working
+                   |  directory; or use the "-f" option of "mpirun".
+
+example.rhosts   example of a ".rhosts" file needed to run the MPI version of
+                 FDMNES. The username "wilcke" in this file must be replaced by
+                 the username of the person starting the MPI executable.
+                 Note: for security reasons, this file must have read- and
+                 write-permissions only for the owner (permission code 600)!
+
+                 For more information, see the "man" pages for "rhosts".
+
+fdmnes_oar.sh    example of a script to submit FDMNES jobs (MPI and non-MPI) to
+                 the OAR batch scheduler
+
+bin              directory with the executables of FDMNES for Linux.
+                 This directory contains the following subdirectories for the
+                 different types of computer and operating system:
+
+                 - cygwin       32-bit Windows PCs with Cygwin version >= 1.5.24
+                                (also contains the version 1.5.24 library
+                                "cygwin1.dll")
+                 - centos5      64-bit Linux systems with CentOS version 5
+                 - debian6      64-bit Linux systems with Debian version 6
+
+prog             directory with:
+                 - readme_prog.txt   file with details about the source files
+                 - *.f               the FORTRAN source files
+                 - mpif.h            header file for the dummy MPI routines
+                 - Makefile          a (GNU) Makefile to create the executables
+                                     for Linux and Cygwin
+                 - Makefile_example  example makefile for the Portland compiler
+
+entree           data directory with the input files for an example application
+                 of FDMNES
+
+xanout           data directory with the output files for an example application
+                 of FDMNES
+
+                 Both directories contain the subdirectory "test_stand" with the
+                 complete input (output) files for the different calculations
+                 specified in the "fdmfile.txt" file of the FDMNES distribution.
+
+                 For each calculation there is at least one input file with the
+                 name "*_inp.txt". This is the "indata" (= input data) file
+                 referred to in the description of "fdmfile.txt" above.
+
+                 The 27 examples do different types of calculations. The input
+                 and output files for the examples are therefore different as
+                 well. For more information on these files, see the FDMNES
+                 manuals mentioned above.
diff --git a/debian/bin/fdmnes b/debian/bin/fdmnes
new file mode 100755
index 0000000..1c30970
--- /dev/null
+++ b/debian/bin/fdmnes
@@ -0,0 +1,39 @@
+#!/bin/sh
+# Wrapper script to call either fdmnes or fdmnes_mpi (file name of script is evaluated)
+
+# Doing some sanity checks for input file
+CTRLFILE=fdmfile.txt
+if [ ! -f "$CTRLFILE" ] ; then
+    echo "`basename $0`: Can't find control file $CTRLFILE."
+    exit
+fi
+
+# FIXME: If the first line is a comment please drop this check
+if ! head -n 1 "$CTRLFILE" | grep -q "^! General indata file for FDMNES" ; then
+    echo "`basename $0`: File $CTRLFILE does not seem to be a proper control file for FDMNES."
+    exit
+fi
+
+NFILES=`grep "^[[:space:]]*[0-9]\+[[:space:]]$" "$CTRLFILE" | sed 's/^[[:space:]]*\([0-9]\+\)[[:space:]]$/\1/' | head -n 1`
+
+i=0
+for input in `grep "\.txt[[:space:]]*$" "$CTRLFILE"` ; do
+    input=`echo $input | sed 's/^[[:space:]]*\([^[:space:]]\+\)[[:space:]]*$/\1/'`
+    if [ ! -f "$input" ] ; then
+	echo "`basename $0`: Control file $CTRLFILE is mentioning $input but this file does not exist."
+	exit
+    # else
+    #	echo "$input ... OK"
+    fi
+    i=$((i+1))
+done
+if  [ $i -ne $NFILES ] ; then
+    echo "`basename $0`: Control file $CTRLFILE is mentioning $NFILES input fules but it actually only contains $i."
+    exit
+fi
+
+# create output dir because this is not done in the Fortran code which fails if dir does not exist
+mkdir -p xanout/test_stand
+
+# Finally call the real executable
+/usr/lib/fdmnes/`basename $0`
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..e5a6e81
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+fdmnes (0.0.20120607-1) unstable; urgency=low
+
+  * Initial release (Closes: #<bug>)
+
+ -- Andreas Tille <tille at debian.org>  Tue, 26 Jun 2012 11:19:22 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..7cb01d0
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,96 @@
+Source: fdmnes
+Section: science
+Priority: optional
+Maintainer:  Debian Science Team <debian-science-maintainers at lists.alioth.debian.org>
+DM-Upload-Allowed: yes
+Uploaders: Andreas Tille <tille at debian.org>,
+ Rainer Wilcke <wilcke at esrf.fr>
+Build-Depends: debhelper (>= 9), gfortran, libmpich2-dev
+Standards-Version: 3.9.3
+Homepage: http://neel.cnrs.fr/spip.php?rubrique1007&lang=en
+Vcs-Git: git://git.debian.org/git/debian-science/packages/fdmnes.git
+Vcs-Browser: http://git.debian.org/?p=debian-science/packages/fdmnes.git
+
+Package: fdmnes
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, fdmnes-data
+Suggests: fdmnes-doc | fdmnes-doc-fr
+Description: calculates spectra of different spectroscopies
+ FDMNES calculates the spectra of different spectroscopies related to
+ the real or virtual absorption of x-ray in material. It gives the
+ absorption cross sections of photons around the ionization edge, that is
+ in the energy range of XANES in the EXAFS. The calculation is performed
+ with all conditions of rectilinear or circular polarization. In the same
+ way, it calculates the structure factors and intensities of anomalous or
+ resonant diffraction spectra (DAFS or RXD). FDMNES also allows the
+ comparison of the simulated spectra to experimental ones with the help
+ of objective criteria.
+
+Package: fdmnes-mpi
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, fdmnes-data
+Description: calculates spectra of different spectroscopies (parallel version)
+ FDMNES calculates the spectra of different spectroscopies related to
+ the real or virtual absorption of x-ray in material. It gives the
+ absorption cross sections of photons around the ionization edge, that is
+ in the energy range of XANES in the EXAFS. The calculation is performed
+ with all conditions of rectilinear or circular polarization. In the same
+ way, it calculates the structure factors and intensities of anomalous or
+ resonant diffraction spectra (DAFS or RXD). FDMNES also allows the
+ comparison of the simulated spectra to experimental ones with the help
+ of objective criteria.
+ .
+ This is the parallel version
+
+Package: fdmnes-data
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: calculates spectra of different spectroscopies (common data)
+ FDMNES calculates the spectra of different spectroscopies related to
+ the real or virtual absorption of x-ray in material. It gives the
+ absorption cross sections of photons around the ionization edge, that is
+ in the energy range of XANES in the EXAFS. The calculation is performed
+ with all conditions of rectilinear or circular polarization. In the same
+ way, it calculates the structure factors and intensities of anomalous or
+ resonant diffraction spectra (DAFS or RXD). FDMNES also allows the
+ comparison of the simulated spectra to experimental ones with the help
+ of objective criteria.
+ .
+ This is the package contains data that are common to single processor
+ and parallel version.
+
+Package: fdmnes-doc
+Architecture: all
+Section: doc
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Enhances: fdmnes, fdmnes-mpi
+Description: calculates spectra of different spectroscopies (English documentation)
+ FDMNES calculates the spectra of different spectroscopies related to
+ the real or virtual absorption of x-ray in material. It gives the
+ absorption cross sections of photons around the ionization edge, that is
+ in the energy range of XANES in the EXAFS. The calculation is performed
+ with all conditions of rectilinear or circular polarization. In the same
+ way, it calculates the structure factors and intensities of anomalous or
+ resonant diffraction spectra (DAFS or RXD). FDMNES also allows the
+ comparison of the simulated spectra to experimental ones with the help
+ of objective criteria.
+ .
+ This package contains the English documentation.
+
+Package: fdmnes-doc-fr
+Architecture: all
+Section: doc
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Enhances: fdmnes, fdmnes-mpi
+Description: calculates spectra of different spectroscopies (French documentation)
+ FDMNES calculates the spectra of different spectroscopies related to
+ the real or virtual absorption of x-ray in material. It gives the
+ absorption cross sections of photons around the ionization edge, that is
+ in the energy range of XANES in the EXAFS. The calculation is performed
+ with all conditions of rectilinear or circular polarization. In the same
+ way, it calculates the structure factors and intensities of anomalous or
+ resonant diffraction spectra (DAFS or RXD). FDMNES also allows the
+ comparison of the simulated spectra to experimental ones with the help
+ of objective criteria.
+ .
+ This package contains the French documentation.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..8b71b98
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,18 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: FDMNES
+Source: http://neel.cnrs.fr/spip.php?article3137
+
+Files: *
+Copyright: © 2007-2012 O. Bunău and Y. Joly
+License: To-be-clarified
+
+Files: *
+Copyright: © Ralf W. Grosse-Kunstleve, Laboratory of
+  Crystallography, ETH Zurich, Switzerland (ralf at kristall.erdw.ethz.ch)
+License: To-be-clarified
+
+Files: debian/*
+Copyright: © 2012 Andreas Tille <tille at debian.org>,
+ Rainer Wilcke <wilcke at esrf.fr>
+License: GPL-3+
+ Adapt to license of the code if necessary
diff --git a/debian/fdmnes-data.install b/debian/fdmnes-data.install
new file mode 100644
index 0000000..14388ba
--- /dev/null
+++ b/debian/fdmnes-data.install
@@ -0,0 +1,5 @@
+spacegroup.txt		usr/share/fdmnes
+xsect.dat		usr/share/fdmnes
+entree			usr/share/doc/fdmnes/examples
+xanout			usr/share/doc/fdmnes/examples
+fdmfile.txt		usr/share/doc/fdmnes/examples
diff --git a/debian/fdmnes-data.links b/debian/fdmnes-data.links
new file mode 100644
index 0000000..b95f5e2
--- /dev/null
+++ b/debian/fdmnes-data.links
@@ -0,0 +1 @@
+usr/share/man/man1/fdmnes.1.gz	usr/share/man/man1/fdmnes_mpi.1.gz
diff --git a/debian/fdmnes-data.manpages b/debian/fdmnes-data.manpages
new file mode 100644
index 0000000..0f65186
--- /dev/null
+++ b/debian/fdmnes-data.manpages
@@ -0,0 +1 @@
+debian/*.1
diff --git a/debian/fdmnes-doc-fr.doc-base.cours b/debian/fdmnes-doc-fr.doc-base.cours
new file mode 100644
index 0000000..3607694
--- /dev/null
+++ b/debian/fdmnes-doc-fr.doc-base.cours
@@ -0,0 +1,20 @@
+Document: fdmnes-cours
+Title: FDMNES Cours (French)
+Author: Yves Joly <yves.joly at grenoble.cnrs.fr>
+Abstract: calculates spectra of different spectroscopies
+ FDMNES calculates the spectra of different spectroscopies related to
+ the real or virtual absorption of x-ray in material. It gives the
+ absorption cross sections of photons around the ionization edge, that is
+ in the energy range of XANES in the EXAFS. The calculation is performed
+ with all conditions of rectilinear or circular polarization. In the same
+ way, it calculates the structure factors and intensities of anomalous or
+ resonant diffraction spectra (DAFS or RXD). FDMNES also allows the
+ comparison of the simulated spectra to experimental ones with the help
+ of objective criteria.
+ .
+ This is an introduction into FDMNES in French language.
+Section: Science/Physics
+
+Format: pdf
+Files: /usr/share/doc/fdmnes/Manuel.pdf
+
diff --git a/debian/fdmnes-doc-fr.doc-base.manual b/debian/fdmnes-doc-fr.doc-base.manual
new file mode 100644
index 0000000..33f0925
--- /dev/null
+++ b/debian/fdmnes-doc-fr.doc-base.manual
@@ -0,0 +1,20 @@
+Document: fdmnes-fr
+Title: FDMNES Manual (French)
+Author: Yves Joly <yves.joly at grenoble.cnrs.fr>
+Abstract: calculates spectra of different spectroscopies
+ FDMNES calculates the spectra of different spectroscopies related to
+ the real or virtual absorption of x-ray in material. It gives the
+ absorption cross sections of photons around the ionization edge, that is
+ in the energy range of XANES in the EXAFS. The calculation is performed
+ with all conditions of rectilinear or circular polarization. In the same
+ way, it calculates the structure factors and intensities of anomalous or
+ resonant diffraction spectra (DAFS or RXD). FDMNES also allows the
+ comparison of the simulated spectra to experimental ones with the help
+ of objective criteria.
+ .
+ This manual is the French version.
+Section: Science/Physics
+
+Format: pdf
+Files: /usr/share/doc/fdmnes/Manuel.pdf
+
diff --git a/debian/fdmnes-doc-fr.install b/debian/fdmnes-doc-fr.install
new file mode 100644
index 0000000..d286527
--- /dev/null
+++ b/debian/fdmnes-doc-fr.install
@@ -0,0 +1,2 @@
+Manuel.pdf		usr/share/doc/fdmnes
+Manuel_cours.pdf	usr/share/doc/fdmnes
diff --git a/debian/fdmnes-doc.doc-base b/debian/fdmnes-doc.doc-base
new file mode 100644
index 0000000..385c2b1
--- /dev/null
+++ b/debian/fdmnes-doc.doc-base
@@ -0,0 +1,18 @@
+Document: fdmnes
+Title: FDMNES Manual
+Author: Yves Joly <yves.joly at grenoble.cnrs.fr>
+Abstract: calculates spectra of different spectroscopies
+ FDMNES calculates the spectra of different spectroscopies related to
+ the real or virtual absorption of x-ray in material. It gives the
+ absorption cross sections of photons around the ionization edge, that is
+ in the energy range of XANES in the EXAFS. The calculation is performed
+ with all conditions of rectilinear or circular polarization. In the same
+ way, it calculates the structure factors and intensities of anomalous or
+ resonant diffraction spectra (DAFS or RXD). FDMNES also allows the
+ comparison of the simulated spectra to experimental ones with the help
+ of objective criteria.
+Section: Science/Physics
+
+Format: pdf
+Files: /usr/share/doc/fdmnes/Manuel_Eng.pdf
+
diff --git a/debian/fdmnes-doc.install b/debian/fdmnes-doc.install
new file mode 100644
index 0000000..e911bfe
--- /dev/null
+++ b/debian/fdmnes-doc.install
@@ -0,0 +1 @@
+Manuel_Eng.pdf		usr/share/doc/fdmnes
diff --git a/debian/fdmnes-mpi.docs b/debian/fdmnes-mpi.docs
new file mode 100644
index 0000000..8ea0c6e
--- /dev/null
+++ b/debian/fdmnes-mpi.docs
@@ -0,0 +1 @@
+debian/Readme_ESRF.txt
diff --git a/debian/fdmnes-mpi.install b/debian/fdmnes-mpi.install
new file mode 100644
index 0000000..db3d2e3
--- /dev/null
+++ b/debian/fdmnes-mpi.install
@@ -0,0 +1 @@
+prog/tmp/fdmnes_mpi	usr/lib/fdmnes
diff --git a/debian/fdmnes-mpi.lintian-overrides b/debian/fdmnes-mpi.lintian-overrides
new file mode 100644
index 0000000..c9f2a58
--- /dev/null
+++ b/debian/fdmnes-mpi.lintian-overrides
@@ -0,0 +1,3 @@
+# The manpages are delivered in the fdmnes-data package to enable
+# reasonable symlinking for the single file 
+fdmnes-mpi: binary-without-manpage usr/bin/fdmnes_mpi
diff --git a/debian/fdmnes.1 b/debian/fdmnes.1
new file mode 100644
index 0000000..d3e1aa9
--- /dev/null
+++ b/debian/fdmnes.1
@@ -0,0 +1,15 @@
+.TH fdmnes "1" "June 2012" "User Commands"
+.SH NAME
+fdmnes \-  calculates spectra of different spectroscopies
+fdmnes_mpi \-  calculates spectra of different spectroscopies (parallel version)
+.SH SYNOPSIS
+.B fdmnes
+.B fdmnes_mpi
+.SH DESCRIPTION
+You need to prepare some data files which are regarded by the executable.
+There is a working example available at
+
+/usr/share/doc/fdmes/examples
+
+.SH "SEE ALSO"
+The manual is available in the fdmes-doc or fdmes-doc-fr package.
diff --git a/debian/fdmnes.docs b/debian/fdmnes.docs
new file mode 100644
index 0000000..8ea0c6e
--- /dev/null
+++ b/debian/fdmnes.docs
@@ -0,0 +1 @@
+debian/Readme_ESRF.txt
diff --git a/debian/fdmnes.install b/debian/fdmnes.install
new file mode 100644
index 0000000..79d8d00
--- /dev/null
+++ b/debian/fdmnes.install
@@ -0,0 +1,2 @@
+prog/tmp/fdmnes		usr/lib/fdmnes
+debian/bin/fdmnes	usr/bin
diff --git a/debian/fdmnes.lintian-overrides b/debian/fdmnes.lintian-overrides
new file mode 100644
index 0000000..a8b13f9
--- /dev/null
+++ b/debian/fdmnes.lintian-overrides
@@ -0,0 +1,4 @@
+# The manpages are delivered in the fdmnes-data package to enable
+# reasonable symlinking for the single file 
+fdmnes: binary-without-manpage usr/bin/fdmnes
+
diff --git a/debian/get-orig-source b/debian/get-orig-source
new file mode 100755
index 0000000..b101260
--- /dev/null
+++ b/debian/get-orig-source
@@ -0,0 +1,30 @@
+#!/bin/sh
+# get source for FDMNES because upstream archive is bloated by
+# binary executables
+
+set -e
+NAME=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
+
+if ! echo $@ | grep -q upstream-version ; then
+    VERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | sed 's/\([0-9\.]\+\)-[0-9]\+$/\1/'`
+else
+    VERSION=`echo $@ | sed "s?^.*--upstream-version \([0-9.]\+\) .*${NAME}.*?\1?"`
+    if echo "$VERSION" | grep -q "upstream-version" ; then
+        echo "Unable to parse version number"
+        exit
+    fi
+fi
+
+UVERSION=`echo $VERSION | sed 's/^\(20[0-9][0-9]\)\([0-9][0-9]\)\([0-9][0-9]\)$/\1_\2_\3/'`
+mkdir -p ../tarballs
+cd ../tarballs
+unzip -q ../${NAME}_${UVERSION}.zip
+
+rm -f ${NAME}/*.exe
+rm -f ${NAME}/${NAME}_linux64
+
+VERSION="0.0.$VERSION"
+mv ${NAME} ${NAME}-${VERSION}
+
+GZIP="--best --no-name" tar --owner=root --group=root --mode=a+rX -caf "$NAME"_"$VERSION".orig.tar.xz "${NAME}-${VERSION}"
+rm -rf "$NAME-${VERSION}"
diff --git a/debian/patches/consolidate_path.patch b/debian/patches/consolidate_path.patch
new file mode 100644
index 0000000..b1f9eb5
--- /dev/null
+++ b/debian/patches/consolidate_path.patch
@@ -0,0 +1,31 @@
+Author: Andreas Tille <tille at debian.org>
+Date: Tue, 26 Jun 2012 11:19:22 +0200
+Description: Avoid copies of data files in user directory
+
+--- fdmnes.orig/prog/fprime.f
++++ fdmnes/prog/fprime.f
+@@ -81,11 +81,11 @@
+       do i = 1,3
+         select case(i)
+           case(1)
+-            file_name = 'xsect.dat'
++            file_name = '/usr/share/fdmnes/xsect.dat'
+           case(2)
+             file_name = 'C:/fdmnes/xsect.dat'
+           case(3)
+-            file_name = '/Share/public/FDMNES/xsect.dat'
++            file_name = '/usr/share/fdmnes/xsect.dat'
+         end select    
+         open(is, file = file_name, status='old', iostat=istat)
+         if( istat == 0 ) exit
+--- fdmnes.orig/prog/main.f
++++ fdmnes/prog/main.f
+@@ -77,7 +77,7 @@
+       Revision = '   FDMNES II program, Revision 7 June 2012'
+       fdmfile = 'fdmfile.txt'
+       fdmnes_error = 'fdmnes_error.txt'
+-      Space_file = 'spacegroup.txt'
++      Space_file = '/usr/share/fdmnes/spacegroup.txt'
+ 
+       call date_and_time( date = dat, time = tim )
+       com_date = '   Date = ' // dat(7:8)
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..6344304
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+consolidate_path.patch
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..dd0d356
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,36 @@
+#!/usr/bin/make -f
+
+# DH_VERBOSE := 1
+
+# The name of the package is needed because we do install the wrapper manually
+pkg := $(shell dpkg-parsechangelog | sed -n 's/^Source: //p')
+pkg-mpi := $(pkg)-mpi
+
+%:
+	dh $@
+
+override_dh_auto_build:
+	cd prog; $(MAKE) -f ../debian/Makefile_ESRF
+	cd prog; $(MAKE) -f ../debian/Makefile_ESRF clean
+	cd prog; $(MAKE) -f ../debian/Makefile_ESRF FDM_NAME=fdmnes_mpi
+
+override_dh_auto_clean:
+	dh_auto_clean
+	cd prog; $(MAKE) -f  ../debian/Makefile_ESRF allclean
+
+override_dh_compress:
+	dh_compress --exclude=.pdf
+
+override_dh_install:
+	dh_install
+	# we need to rename the script for the mpi version which can not be reasonably done with dh_install
+	mkdir -p debian/$(pkg-mpi)/usr/bin
+	cp -a debian/bin/$(pkg) debian/$(pkg-mpi)/usr/bin/$(pkg)_mpi
+
+override_dh_installchangelogs:
+	# for the binary packages also install upstream changelog
+	dh_installchangelogs -a -k FDMNES_Modifications.txt
+	dh_installchangelogs -i
+
+get-orig-source:
+	uscan --verbose --repack --force-download
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/upstream b/debian/upstream
new file mode 100644
index 0000000..9577735
--- /dev/null
+++ b/debian/upstream
@@ -0,0 +1,10 @@
+Reference:
+  Author: O. Bunău and Y. Joly
+  Title: "Self-consistent aspects of x-ray absorption calculations"
+  Journal: "J. Phys.: Condens. Matter"
+  Year:  2009
+  Volume: 21
+  Pages: 345501
+  DOI: 10.1088/0953-8984/21/34/345501
+  URL: http://iopscience.iop.org/0953-8984/21/34/345501/
+  eprint: http://iopscience.iop.org/0953-8984/21/34/345501/pdf/0953-8984_21_34_345501.pdf
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..94e4f2d
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,5 @@
+version=3
+opts="dversionmangle=s/^0.0.//,uversionmangle=s/_//g" \
+http://neel.cnrs.fr/spip.php?article3137 \
+   http://neel.cnrs.fr/IMG/zip/fdmnes_(.*).zip \
+   debian debian/get-orig-source

-- 
calculates spectra of different spectroscopies



More information about the debian-science-commits mailing list