Skip to content

Commit

Permalink
Add basic Debian packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed Mar 8, 2024
1 parent 74fe8bb commit 2550362
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
rmf (1.6.0-1~@CODENAME@) @CODENAME@; urgency=low

* Initial .deb release

-- IMP Developers <imp@salilab.org> Thu, 07 Mar 2024 14:52:50 -0800
24 changes: 24 additions & 0 deletions tools/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Source: rmf
Priority: optional
Maintainer: Ben Webb <ben@salilab.org>
Build-Depends: debhelper-compat (= 13), cmake, swig, libboost-filesystem-dev, libboost-iostreams-dev, libboost-program-options-dev, libboost-thread-dev, libhdf5-dev, python3-dev, python3-numpy
Standards-Version: 4.6.2
Section: libs
Homepage: https://integrativemodeling.org/rmf
Vcs-Browser: https://github.com/salilab/rmf/

Package: rmf-dev
Section: libdevel
Architecture: any
Depends: rmf (= ${binary:Version}), ${misc:Depends}, cmake, swig, libboost-filesystem-dev, libboost-iostreams-dev, libboost-program-options-dev, libboost-thread-dev, libhdf5-dev, python3-dev, python3-numpy
Description: Library to support reading and writing of RMF files
Headers to compile against RMF.

Package: rmf
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, python3-numpy
Description: Library to support reading and writing of RMF files
The library provides support for the RMF file format for storing hierarchical
molecular data (such as atomic or coarse grained representations of proteins),
along with markup, including geometry and score data.
6 changes: 6 additions & 0 deletions tools/debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: rmf
Source: https://integrativemodeling.org/rmf/

Copyright: 2007-2024 IMP Inventors
License: Apache
23 changes: 23 additions & 0 deletions tools/debian/make-package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh
# Build a Debian package from source

set -e

CODENAME=`lsb_release -c -s`

# Make sure we can find the rest of our input files
TOOL_DIR=`dirname "$0"`
# Get absolute path to top dir
TOP_DIR=`cd "${TOOL_DIR}/../.." && pwd`

cd ${TOP_DIR}
rm -rf debian
cp -r util/debian/ .
rm debian/make-package.sh
sed -i -e "s/\@CODENAME\@/$CODENAME/g" debian/changelog

if [ "${CODENAME}" = "focal" ]; then
sed -i -e "s/debhelper-compat (= 13)/debhelper-compat (= 12)/" debian/control
fi

dpkg-buildpackage -S
3 changes: 3 additions & 0 deletions tools/debian/rmf-dev.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
usr/lib/*/libRMF*.so
usr/include/*
usr/share/RMF/swig
16 changes: 16 additions & 0 deletions tools/debian/rmf.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
usr/lib/*/libRMF*.so.*
usr/lib/python3*/dist-packages/RMF*
usr/lib/python3*/dist-packages/_RMF*
usr/bin/rmf3_dump
usr/bin/rmf_cat
usr/bin/rmf_frames
usr/bin/rmf_info
usr/bin/rmf_interpolate
usr/bin/rmf_pdb
usr/bin/rmf_show
usr/bin/rmf_signature
usr/bin/rmf_slice
usr/bin/rmf_transform
usr/bin/rmf_update
usr/bin/rmf_validate
usr/bin/rmf_xml
3 changes: 3 additions & 0 deletions tools/debian/rmf.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
python3 -m compileall -q /usr/lib/python3.*/dist-packages/RMF.py
python3 -m compileall -q /usr/lib/python3.*/dist-packages/RMF_HDF5.py
3 changes: 3 additions & 0 deletions tools/debian/rmf.prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
rm -f /usr/lib/python3.*/dist-packages/__pycache__/RMF.*.pyc
rm -f /usr/lib/python3.*/dist-packages/__pycache__/RMF_HDF5.*.pyc
34 changes: 34 additions & 0 deletions tools/debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# Don't use Debian-provided flags for now; they slow down the build
CFLAGS :=
CXXFLAGS :=
LDFLAGS :=

%:
dh $@

override_dh_auto_configure:
mkdir build
cd build && py3_ver=`python3 -c "import sys; print('%d.%d' % sys.version_info[:2])"` \
&& cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PYTHONDIR=/usr/lib/python$${py3_ver}/dist-packages \
-DCMAKE_INSTALL_PREFIX=/usr -DUSE_PYTHON2=off

override_dh_auto_build:
$(MAKE) -C build

override_dh_install:
$(MAKE) -C build DESTDIR=$(CURDIR)/debian/tmp install
# Make sure all Python applications use the system Python in /usr/bin
perl -pi -e 's@^#!.*python.*$$@#!/usr/bin/python3@' debian/tmp/usr/bin/*
dh_install
dh_missing --fail-missing

override_dh_compress:
# Don't compress example files, since then they won't work!
dh_compress -Xexamples
1 change: 1 addition & 0 deletions tools/debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)

0 comments on commit 2550362

Please sign in to comment.