[SCM] Algorithms for models in fundamental astronomy branch, debian, updated. bcb4be8c6d04a802633aeb00ec47c14b3e01f0fa

Ole Streicher debian at liska.ath.cx
Fri Feb 24 09:25:31 UTC 2012


The following commit has been merged in the debian branch:
commit 9886c7b32766c3c4b9eca24fcc012acfdfd68c7f
Author: Ole Streicher <debian at liska.ath.cx>
Date:   Thu Feb 23 16:47:35 2012 +0100

    Set installation path and create shared libs

diff --git a/debian/patches/create_shared_lib.patch b/debian/patches/create_shared_lib.patch
new file mode 100644
index 0000000..54584cc
--- /dev/null
+++ b/debian/patches/create_shared_lib.patch
@@ -0,0 +1,73 @@
+Author: Ole Streicher <debian at liska.ath.cx>
+Description: Create a shared library
+--- a/20101201/c/src/makefile
++++ b/20101201/c/src/makefile
+@@ -64,7 +64,7 @@ SOFA_INC_DIR = $(INSTALL_DIR)/include/
+ # for functions, CFLAGX for executables) here.
+ 
+ CCOMPC = gcc
+-CFLAGF = -c -pedantic -Wall -W -O
++CFLAGF = -c -pedantic -Wall -W -O -fPIC
+ CFLAGX = -pedantic -Wall -W -O
+ 
+ #----YOU SHOULDN'T HAVE TO MODIFY ANYTHING BELOW THIS LINE---------
+@@ -80,6 +80,12 @@ INSTALL_DIRS = $(SOFA_LIB_DIR) $(SOFA_INC_DIR)
+ SOFA_LIB_NAME = libsofa_c.a
+ SOFA_LIB = $(SOFA_LIB_DIR)$(SOFA_LIB_NAME)
+ 
++# Name the SOFA/C library in its source and target locations.
++
++SOFA_SHLIB_NAME = libsofa_c.so.0.0
++SOFA_SHLIB_SONAME = libsofa_c.so.0
++SOFA_SHLIB = $(SOFA_LIB_DIR)$(SOFA_SHLIB_NAME)
++
+ # Name the SOFA/C testbed in its source and target locations.
+ 
+ SOFA_TEST_NAME = t_sofa_c.c
+@@ -292,12 +298,14 @@ all : $(SOFA_LIB_NAME)
+ 	-@ echo ""
+ 
+ # Install the library and header files.
+-install $(SOFA_LIB) : $(INSTALL_DIRS) $(SOFA_LIB_NAME) $(SOFA_INC)
++install $(SOFA_LIB) : $(INSTALL_DIRS) $(SOFA_LIB_NAME) $(SOFA_SHLIB_NAME) $(SOFA_INC)
+ 	cp $(SOFA_LIB_NAME) $(SOFA_LIB_DIR)
++	cp $(SOFA_SHLIB_NAME) $(SOFA_LIB_DIR)
++	ln -s $(SOFA_SHLIB_NAME) $(SOFA_LIB_DIR)/$(SOFA_SHLIB_SONAME)
+ 
+ # Deinstall the library and header files.
+ deinstall:
+-	rm -f $(SOFA_LIB) $(SOFA_INC)
++	rm -f $(SOFA_LIB) $(SOFA_SHLIB) $(SOFA_INC)
+ 
+ # Test the build.
+ check: $(SOFA_TEST_NAME) $(SOFA_INC_NAMES) $(SOFA_LIB_NAME)
+@@ -310,16 +318,16 @@ check: $(SOFA_TEST_NAME) $(SOFA_INC_NAMES) $(SOFA_LIB_NAME)
+ installcheck: $(SOFA_TEST_NAME) $(SOFA_INC) $(SOFA_LIB)
+ 	$(CCOMPC) $(CFLAGX) $(SOFA_TEST_NAME) -I$(SOFA_INC_DIR) \
+         -L$(SOFA_LIB_DIR) -lsofa_c -lm -o $(SOFA_TEST)
+-	./$(SOFA_TEST)
++	LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(SOFA_LIB_DIR) ./$(SOFA_TEST)
+ 	rm -f $(SOFA_TEST)
+ 
+ # Local clean up.
+ clean realclean:
+-	rm -f $(SOFA_OBS) $(SOFA_LIB_NAME)
++	rm -f $(SOFA_OBS) $(SOFA_LIB_NAME) $(SOFA_SHLIB_NAME)
+ 
+ # Clean up and deinstall.
+ distclean:
+-	rm -f $(SOFA_OBS) $(SOFA_LIB_NAME) $(SOFA_INC) $(SOFA_LIB)
++	rm -f $(SOFA_OBS) $(SOFA_LIB_NAME) $(SOFA_SHLIB_NAME) $(SOFA_INC) $(SOFA_LIB)
+ 
+ # Create the installation directories if not already present.
+ $(INSTALL_DIRS):
+@@ -329,6 +337,9 @@ $(INSTALL_DIRS):
+ $(SOFA_LIB_NAME): $(SOFA_OBS)
+ 	ar ru $(SOFA_LIB_NAME) $?
+ 
++$(SOFA_SHLIB_NAME): $(SOFA_OBS)
++	gcc -shared -Wl,-soname,$(SOFA_SHLIB_SONAME) -o $(SOFA_SHLIB_NAME) $? -lm
++
+ # Install the header files.
+ $(SOFA_INC) : $(INSTALL_DIRS) $(SOFA_INC_NAMES)
+ 	cp $(SOFA_INC_NAMES) $(SOFA_INC_DIR)
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..2526990
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+set_installation_path.patch
+create_shared_lib.patch
diff --git a/debian/patches/set_installation_path.patch b/debian/patches/set_installation_path.patch
new file mode 100644
index 0000000..4c2574c
--- /dev/null
+++ b/debian/patches/set_installation_path.patch
@@ -0,0 +1,23 @@
+Author: Ole Streicher <debian at liska.ath.cx>
+Description: Set the installation path according to the FHS. Also, remove the
+ "test" target alias (use installcheck instead).
+--- a/20101201/c/src/makefile
++++ b/20101201/c/src/makefile
+@@ -49,7 +49,7 @@
+ 
+ # Specify the installation home directory.
+ 
+-INSTALL_DIR = $(HOME)
++INSTALL_DIR = $(DESTDIR)/usr
+ 
+ # Specify the installation directory for the library.
+ 
+@@ -307,7 +307,7 @@ check: $(SOFA_TEST_NAME) $(SOFA_INC_NAMES) $(SOFA_LIB_NAME)
+ 	rm -f $(SOFA_TEST)
+ 
+ # Test the installed library.
+-installcheck test: $(SOFA_TEST_NAME) $(SOFA_INC) $(SOFA_LIB)
++installcheck: $(SOFA_TEST_NAME) $(SOFA_INC) $(SOFA_LIB)
+ 	$(CCOMPC) $(CFLAGX) $(SOFA_TEST_NAME) -I$(SOFA_INC_DIR) \
+         -L$(SOFA_LIB_DIR) -lsofa_c -lm -o $(SOFA_TEST)
+ 	./$(SOFA_TEST)

-- 
Algorithms for models in fundamental astronomy



More information about the debian-science-commits mailing list