[med-svn] [Git][med-team/libpinchesandcacti][master] Use d-shlibs, add shared lib package
Andreas Tille (@tille)
gitlab at salsa.debian.org
Mon Oct 26 13:33:30 GMT 2026
Andreas Tille pushed to branch master at Debian Med / libpinchesandcacti
Commits:
5eb63300 by Andreas Tille at 2026-10-26T14:32:15+01:00
Use d-shlibs, add shared lib package
- - - - -
3 changed files:
- debian/control
- debian/rules
- debian/tests/run-unit-test
Changes:
=====================================
debian/control
=====================================
@@ -4,18 +4,36 @@ Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.
Uploaders: Andreas Tille <tille at debian.org>
Build-Depends:
debhelper-compat (= 14),
+ d-shlibs,
libsonlib-dev,
Standards-Version: 4.7.4
Vcs-Browser: https://salsa.debian.org/med-team/libpinchesandcacti
Vcs-Git: https://salsa.debian.org/med-team/libpinchesandcacti.git
Homepage: https://github.com/benedictpaten/pinchesAndCacti
+Package: libpinchesandcacti0
+Section: libs
+Architecture: any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends:
+ ${shlibs:Depends},
+ ${misc:Depends},
+Description: cactus graph and pinch graph library
+ pinchesAndCacti implements two graph data structures used by genome
+ alignment tools: pinch graphs, a generalised overlap graph of alignment
+ blocks over sequences, and cactus graphs, which represent the sequence
+ alignments of a genome as a set of nested cycles.
+ .
+ This package contains the shared library.
+
Package: libpinchesandcacti-dev
Section: libdevel
Architecture: any
Multi-Arch: same
Depends:
${misc:Depends},
+ libpinchesandcacti0 (= ${binary:Version}),
libsonlib-dev,
Description: cactus graph and pinch graph library (development files)
pinchesAndCacti implements two graph data structures used by genome
@@ -23,5 +41,5 @@ Description: cactus graph and pinch graph library (development files)
blocks over sequences, and cactus graphs, which represent the sequence
alignments of a genome as a set of nested cycles.
.
- This package contains the static library and the C headers needed to link
- against it.
+ This package contains the static and shared libraries and the C headers
+ needed to link against them.
=====================================
debian/rules
=====================================
@@ -2,28 +2,48 @@
export DH_VERBOSE = 1
-# Upstream's makefile wants sonLib checked out next to the source tree and
-# builds a CuTest based test binary, so compile the library directly.
+# Upstream's makefile wants a sonLib checkout next to the source tree (and
+# builds a CuTest test binary), so compile the library directly. Its
+# DPkg::Buildsystem is therefore disabled and the *.install files take the
+# build products.
SOURCES = impl/stPinchGraphs.c impl/stCactusGraphs.c \
externalTools/threeEdgeConnected/impl/3_Absorb3edge2x.c
INCLUDES = -Iinc -IexternalTools/threeEdgeConnected/inc -I/usr/include/sonLib
-# The shared sonLib leaves quicktree/tokyocabinet symbols undefined, so link
-# the static archive.
+# libsonlib.so.1 is linked with -z now and leaves the quicktree symbols it
+# needs undefined, so it cannot be loaded at all. Do not link the shared
+# library against it: the sonLib symbols stay undefined there and the consumer
+# supplies them from the static archive, exactly as it already has to for
+# libpinchesandcacti.a.
LIBS = -l:libsonlib.a -lm -lpthread
+LIB = libpinchesandcacti.so
+SONAME = $(LIB).0
+REAL = $(LIB).0.0.0
override_dh_auto_clean:
- rm -rf obj libpinchesandcacti.a
+ rm -rf obj libpinchesandcacti.a libpinchesandcacti.so*
%:
- dh $@
+ dh $@ --buildsystem=none
override_dh_auto_build:
mkdir -p obj
for s in $(SOURCES); do \
- $(CC) $(CPPFLAGS) $(CFLAGS) $(INCLUDES) -c $$s \
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(INCLUDES) -fPIC -c $$s \
-o obj/`basename $$s .c`.o; \
done
$(AR) rcs libpinchesandcacti.a obj/*.o
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -Wl,-z,now \
+ -Wl,-soname,$(SONAME) -o $(REAL) obj/*.o -lm -lpthread
+ ln -sf $(REAL) $(SONAME)
+ ln -sf $(SONAME) $(LIB)
+
+execute_after_dh_install:
+ d-shlibmove --commit \
+ --multiarch \
+ --devunversioned \
+ --exclude-la \
+ --movedev "inc/*.h" usr/include/pinchesAndCacti \
+ *.so
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
@@ -31,10 +51,3 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
libpinchesandcacti.a $(LIBS) -o obj/consumer
obj/consumer
endif
-
-override_dh_auto_install:
- install -d debian/libpinchesandcacti-dev/usr/include/pinchesAndCacti
- install -m644 inc/stPinchGraphs.h inc/stCactusGraphs.h \
- debian/libpinchesandcacti-dev/usr/include/pinchesAndCacti/
- install -Dm644 libpinchesandcacti.a \
- debian/libpinchesandcacti-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libpinchesandcacti.a
=====================================
debian/tests/run-unit-test
=====================================
@@ -15,5 +15,10 @@ cd "${AUTOPKGTEST_TMP}"
gcc -O2 -Wall -I/usr/include/pinchesAndCacti -I/usr/include/sonLib \
consumer.c -l:libpinchesandcacti.a -l:libsonlib.a -lm -lpthread \
- -o consumer
-./consumer | grep -qx PINCHESANDCACTI-OK
+ -o consumer-static
+./consumer-static | grep -qx PINCHESANDCACTI-OK
+
+gcc -O2 -Wall -I/usr/include/pinchesAndCacti -I/usr/include/sonLib \
+ consumer.c -lpinchesandcacti -l:libsonlib.a -lm -lpthread \
+ -o consumer-shared
+./consumer-shared | grep -qx PINCHESANDCACTI-OK
View it on GitLab: https://salsa.debian.org/med-team/libpinchesandcacti/-/commit/5eb6330008ec348bc0c575aa2beff76dbf25b40f
--
View it on GitLab: https://salsa.debian.org/med-team/libpinchesandcacti/-/commit/5eb6330008ec348bc0c575aa2beff76dbf25b40f
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20261026/304d1267/attachment-0001.htm>
More information about the debian-med-commit
mailing list