[med-svn] [libdisorder] 02/02: Initial debian packaging

Andreas Tille tille at debian.org
Mon Jun 27 14:49:23 UTC 2016


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository libdisorder.

commit 40f0d3ac323b1bfb7a255bfb6f54554bc989b232
Author: Andreas Tille <tille at debian.org>
Date:   Mon Jun 27 16:48:23 2016 +0200

    Initial debian packaging
---
 debian/changelog              |   5 ++
 debian/compat                 |   1 +
 debian/control                |  58 +++++++++++++++++
 debian/copyright              |  25 ++++++++
 debian/get-orig-source        |  28 +++++++++
 debian/patches/autoconf.patch | 142 ++++++++++++++++++++++++++++++++++++++++++
 debian/patches/cpp.patch      |  26 ++++++++
 debian/patches/series         |   2 +
 debian/rules                  |  22 +++++++
 debian/source/format          |   1 +
 debian/watch                  |   2 +
 11 files changed, 312 insertions(+)

diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..ca4d12a
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+libdisorder (0.0.2-1) UNRELEASED; urgency=medium
+
+  * Initial release (Closes: #???)
+
+ -- Andreas Tille <tille at debian.org>  Thu, 23 Jun 2016 14:30:12 +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..b509241
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,58 @@
+Source: libdisorder
+Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
+Uploaders: Andreas Tille <tille at debian.org>
+Section: science
+Priority: optional
+Build-Depends: debhelper (>= 9),
+               dh-autoreconf,
+               d-shlibs
+Standards-Version: 3.9.8
+Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/libdisorder.git
+Vcs-Git: https://anonscm.debian.org/git/debian-med/libdisorder.git
+Homepage: https://github.com/locasto/libdisorder
+
+Package: libdisorder0
+Architecture: any
+Section: libs
+Depends: ${shlibs:Depends},
+         ${misc:Depends}
+Description: library for entropy measurement of byte streams and other data
+ libdisorder is a small, simple C library for use by programmers in
+ other programs. There is a small test program included that opens
+ /dev/urandom and calls libdisorder in the `test/' directory. There is
+ also a command-line tool, `ropy' in the `tool/' directory for reporting
+ on the entropy of normal files.
+ .
+ You will probably want to pipe the output of libdisorder to some other
+ math analysis or graphing environment (e.g., gnuplot).
+ .
+ The library's primary function reports entropy in bits: essentially,
+ this is the number of bits necessary to encode the actual level of
+ information contained in the data passed to the library: it is the
+ theoretical maximum amount of compression possible.
+ .
+ This package contains the dynamic library.
+
+Package: libdisorder-dev
+Architecture: any
+Section: libdevel
+Depends: libdisorder0 (= ${binary:Version}),
+         ${shlibs:Depends},
+         ${misc:Depends}
+Description: library for entropy measurement of byte streams and other data (devel)
+ libdisorder is a small, simple C library for use by programmers in
+ other programs. There is a small test program included that opens
+ /dev/urandom and calls libdisorder in the `test/' directory. There is
+ also a command-line tool, `ropy' in the `tool/' directory for reporting
+ on the entropy of normal files.
+ .
+ You will probably want to pipe the output of libdisorder to some other
+ math analysis or graphing environment (e.g., gnuplot).
+ .
+ The library's primary function reports entropy in bits: essentially,
+ this is the number of bits necessary to encode the actual level of
+ information contained in the data passed to the library: it is the
+ theoretical maximum amount of compression possible.
+ .
+ This is the development package containing the statically linked
+ library and the header files.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..21a248e
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,25 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: libdisorder
+Source: https://github.com/locasto/libdisorder
+
+Files: *
+Copyright: 2010-2013 Michael E. Locasto
+License: GPL-2+
+
+Files: debian/*
+Copyright: 2016 Andreas Tille <tille at debian.org>
+License: GPL-2+
+
+License: GPL-2+
+ This program 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 2 of the License, or
+ (at your option) any later version.
+ .
+ This program 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.
+ .
+ On Debian systems you can find a copy of the full text of the GNU
+ General Public License version 2 at /usr/share/common-licenses/GPL-2.
diff --git a/debian/get-orig-source b/debian/get-orig-source
new file mode 100755
index 0000000..d5056df
--- /dev/null
+++ b/debian/get-orig-source
@@ -0,0 +1,28 @@
+#!/bin/sh -e
+
+COMPRESS=xz
+
+NAME=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
+MVERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | sed 's/^\([0-9\.]\+\)[+~][-0-9]\+$/\1/'`
+
+mkdir -p ../tarballs
+cd ../tarballs
+# need to clean up the tarballs dir first because upstream tarball might
+# contain a directory with unpredictable name
+rm -rf *
+git clone --quiet https://github.com/locasto/libdisorder
+cd $NAME
+#VERSION=${MVERSION}+`date -d @$(git show --format="%at" | head -n1) +%Y%m%d`
+VERSION=$(cat code/VERSION | head -n1)
+# for esthetical reasons set file timestamps (if git-restore-mtime is installed)
+git restore-mtime || true
+rm -f README
+mv code/* .
+rmdir code
+cd ..
+TARDIR=${NAME}-${VERSION}
+mv ${NAME} ${TARDIR}
+rm -rf ${TARDIR}/.git
+
+GZIP="--best --no-name" tar --owner=root --group=root --mode=a+rX -caf "$NAME"_"$VERSION".orig.tar.${COMPRESS} "${TARDIR}"
+rm -rf ${TARDIR}
diff --git a/debian/patches/autoconf.patch b/debian/patches/autoconf.patch
new file mode 100644
index 0000000..9fab9f0
--- /dev/null
+++ b/debian/patches/autoconf.patch
@@ -0,0 +1,142 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Wed, 22 Jun 2016 16:27:46 +0200
+Description: Add autoconf stuff to enable simple library creation
+
+--- /dev/null
++++ b/Makefile.am
+@@ -0,0 +1,8 @@
++lib_LTLIBRARIES  = libdisorder.la
++
++libdisorder_la_LDFLAGS = -version-info @LIB_VERSION@
++
++libdisorder_la_CPPFLAGS = $(INCLUDES)
++
++LDADD = -ldisorder
++
+--- /dev/null
++++ b/configure.ac
+@@ -0,0 +1,63 @@
++#                                               -*- Autoconf -*-
++# Process this file with autoconf to produce a configure script.
++
++AC_INIT(disorder, 0.0.2, michael at freshdefense.net)
++AC_CONFIG_HEADERS([config.h])
++
++AC_PREREQ(2.57)
++
++#	Directory that contains install-sh and other auxiliary files
++AC_CONFIG_AUX_DIR([config])
++
++################################################################################
++#	According to (http://www.mail-archive.com/autoconf@gnu.org/msg14232.html)
++#		this macro should be after AC_INIT but before AM_INIT_AUTOMAKE
++################################################################################
++AC_CONFIG_MACRO_DIR(config)
++
++AM_INIT_AUTOMAKE([1.6 foreign dist-zip tar-ustar filename-length-max=299])
++
++LIB_VERSION=0:0
++
++AC_SUBST([VERSION])
++AC_SUBST([LIB_VERSION])
++
++AC_SUBST([VERSION])
++
++# Checks for programs.
++AC_PROG_LN_S
++AC_PROG_INSTALL
++AC_PROG_LIBTOOL
++
++################################################################################
++# calling AC_PROG_CXX resets CXXFLAGS, we use our own flags set in the
++#	the AX_CXXFLAGS macro below.
++# So we cache the argument to configure
++#	here in ARG_CXX_FLAGS (so that our macro does not override them)
++################################################################################
++ARG_CXX_FLAGS="$CXXFLAGS"
++AC_PROG_CXX
++
++#Ranlib handled by check for libtool
++CXXFLAGS="$ARG_CXX_FLAGS"
++AX_CXXFLAGS
++
++AC_SUBST(CXXFLAGS)
++
++CPPFLAGS="-I\$(top_srcdir) $CPPFLAGS"
++# Checks for libraries.
++
++# Checks for header files.
++AC_HEADER_STDC
++AC_CHECK_HEADERS([stdlib.h])
++
++AC_PROG_MAKE_SET
++
++AC_CONFIG_FILES([
++	Makefile
++        include/Makefile
++        src/Makefile
++        tool/Makefile
++	])
++AC_OUTPUT
++
+--- a/src/Makefile
++++ /dev/null
+@@ -1,37 +0,0 @@
+-LDFLAGS=-L../lib -L/usr/lib
+-INCLUDES=-I/usr/include -I../include
+-LIBS=-ldisorder -lm
+-#OPTS=-Wall -g -pg
+-OPTS=-Wall -g
+-TESTOUT=../test/testexec
+-TESTSRC=../test/test.c
+-TOOLOUT=../tool/ropy
+-TOOLSRC=../tool/ropy.c
+-
+-all:	disorder library test tool
+-
+-library: libdisorder.a
+-
+-libdisorder.a: disorder.o
+-	ar rc $@ disorder.o
+-	mkdir -p ../lib
+-	mv libdisorder.a ../lib
+-
+-disorder: disorder.c ../include/disorder.h
+-	gcc $(OPTS) -c disorder.c
+-
+-test:	../test/test.c
+-	gcc $(OPTS) $(LDFLAGS) $(INCLUDES) -o $(TESTOUT) $(TESTSRC) $(LIBS)
+-
+-tool:	../tool/ropy.c
+-	gcc $(OPTS) $(LDFLAGS) $(INCLUDES) -o $(TOOLOUT) $(TOOLSRC) $(LIBS)
+-
+-clean:
+-	@/bin/rm -f *~ *.o *.a $(TESTOUT) $(TOOLOUT)
+-	@/bin/rm -f ../test/*~
+-	@/bin/rm -f ../tool/*~
+-	@/bin/rm -Rf ../test/testexec.dSYM/
+-	@/bin/rm -Rf ../tool/ropy.dSYM/
+-	@/bin/rm -f ../include/*~
+-	@/bin/rm -f ../lib/*.a
+-	@/bin/rm -f ../*~
+\ No newline at end of file
+--- /dev/null
++++ b/include/Makefile.am
+@@ -0,0 +1,2 @@
++libdisorderdir=$(includedir)
++libdisorder_HEADERS=disorder.h
+--- /dev/null
++++ b/man/Makefile.am
+@@ -0,0 +1 @@
++man_MANS = shannon_H.3
+--- /dev/null
++++ b/src/Makefile.am
+@@ -0,0 +1,2 @@
++libdisorder_la_SOURCES = disorder.c
++
+--- /dev/null
++++ b/tool/Makefile.am
+@@ -0,0 +1,3 @@
++bin_PROGRAMS = ropy
++ropy_SOURCES = ropy.c
++
diff --git a/debian/patches/cpp.patch b/debian/patches/cpp.patch
new file mode 100644
index 0000000..90a1de1
--- /dev/null
+++ b/debian/patches/cpp.patch
@@ -0,0 +1,26 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Wed, 22 Jun 2016 16:27:46 +0200
+Description: Allow C++ name space
+
+--- a/include/disorder.h
++++ b/include/disorder.h
+@@ -24,6 +24,10 @@
+ #ifndef __DISORDER_H_
+ #define __DISORDER_H_
+ 
++#ifdef __cplusplus
++extern "C" {
++#endif
++
+ /** Max number of bytes (i.e., tokens) */
+ #define LIBDO_MAX_BYTES      256
+ 
+@@ -59,4 +63,8 @@ float    get_max_entropy(void);
+ /** Returns the ratio of entropy to maxentropy */
+ float    get_entropy_ratio(void);
+ 
++#ifdef __cplusplus
++}
++#endif
++
+ #endif
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..a7a9410
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+cpp.patch
+autoconf.patch
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..9aa3085
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,22 @@
+#!/usr/bin/make -f
+
+# DH_VERBOSE := 1
+
+DEBPKGNAME     := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}')
+
+export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow
+
+%:
+	dh $@ --with autoreconf
+
+override_dh_install:
+	dh_install
+	d-shlibmove --commit \
+		    --multiarch \
+		    --devunversioned \
+		    --exclude-la \
+		    --movedev debian/tmp/usr/include/* usr/include \
+		    debian/tmp/usr/lib/*/$(DEBPKGNAME).so
+
+get-orig-source:
+	. debian/get-orig-source
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/watch b/debian/watch
new file mode 100644
index 0000000..ce144f4
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,2 @@
+# version=3
+# Upstream does not tag releases

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/libdisorder.git



More information about the debian-med-commit mailing list