1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
|
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2007, 2008, 2010, 2011, 2013 Jonas Smedegaard
# <dr@jones.dk>
# Description: Main Debian packaging script for libSRTP
#
# 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 3, 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.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/rules/upstream-tarball.mk
# Tighten security - more info at http://wiki.debian.org/Hardening
include /usr/share/dpkg/buildflags.mk
# Update this checksum when new releases occur, to catch silent server side file content forges
DEB_UPSTREAM_TARBALL_MD5 = f706820bb54a4ff805c3f04f31a13082
DEB_UPSTREAM_URL = https://github.com/cisco/libsrtp/archive
#DEB_UPSTREAM_TARBALL_BASENAME = $(DEB_UPSTREAM_TARBALL_VERSION)
DEB_UPSTREAM_TARBALL_BASENAME = 7713d5706524f9f1ee94fd6b55125357e63656d5
DEB_UPSTREAM_REPACKAGE_EXCLUDES = ./CVS .cvsignore ./doc/rfc*.txt ./doc/draft*.txt ./doc/*.pdf ./releases/
DEB_UPSTREAM_TARBALL_SRCDIR = libsrtp-7713d5706524f9f1ee94fd6b55125357e63656d5
# Needed by upstream testsuite
CDBS_BUILD_DEPENDS +=, procps, psmisc, miscfiles
DEB_CONFIGURE_EXTRA_FLAGS = --disable-stdout --enable-syslog
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
DEB_CONFIGURE_EXTRA_FLAGS += --enable-debug
else
DEB_CONFIGURE_EXTRA_FLAGS += --disable-debug
endif
ifeq ($(DEB_HOST_ARCH_CPU),sparc)
CFLAGS += -DFORCE_64BIT_ALIGN
endif
CFLAGS += -D_REENTRANT
# Reapply default strong optimizations unless noopt in DEB_BUILD_OPTIONS
CFLAGS += $(if $(filter noopt,$(DEB_BUILD_OPTIONS))-O0,-O4 -fexpensive-optimizations -funroll-loops)
DEB_MAKE_CLEAN_TARGET = superclean
DEB_MAKE_CHECK_TARGET = runtest
# preserve (and restore) upstream-shipped files tampered with
upstreamtmpfiles = doc/Makefile crypto/Makefile doc/Doxyfile
pre-build:: debian/stamp-upstreamtmpstuff
debian/stamp-upstreamtmpstuff: debian/stamp-copyright-check
for file in $(upstreamtmpfiles); do \
[ ! -e $$file ] || cp -np $$file $$file.upstream; \
done
touch $@
clean::
for file in $(upstreamtmpfiles); do \
[ ! -e $$file.upstream ] || mv -f $$file.upstream $$file; \
done
rm -f debian/stamp-upstreamtmpstuff
# generate (and cleanup) documentation
CDBS_BUILD_DEPENDS +=, doxygen-latex | doxygen
CDBS_BUILD_DEPENDS +=, doxygen-latex | texlive-latex-recommended
CDBS_BUILD_DEPENDS +=, texlive-fonts-recommended
DEB_INSTALL_DOCS_srtp-docs += doc/*.txt doc/*.pdf
DEB_COMPRESS_EXCLUDE += .pdf
build/srtp-docs::
[ -f debian/stamp-make-docs ] || $(DEB_MAKE_INVOKE) libsrtpdoc
touch debian/stamp-make-docs
clean::
rm -f doc/*.pdf
rm -f debian/stamp-make-docs
# Ensure test script is executable
post-patches::
chmod +x test/rtpw_test.sh
# Let d-shlibs calculate development package dependencies
# and handle shared library install
CDBS_BUILD_DEPENDS +=, d-shlibs
binary-post-install/libsrtp0::
d-shlibmove --commit \
--movedev "debian/tmp/usr/include/srtp/*" usr/include/srtp/ \
debian/tmp/usr/lib/libsrtp.so
|