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 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
|
#!/usr/bin/make -f
ifeq (,$(filter terse,${DEB_BUILD_OPTIONS}))
export DH_VERBOSE=1
export V=1
export VERBOSE=1
endif
LC_ALL:=C
export LC_ALL
shellescape='$(subst ','\'',$(1))'
shellexport=$(1)=$(call shellescape,${$(1)})
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildtools.mk
OUR_CPPFLAGS:=
OUR_CFLAGS:=
OUR_LDFLAGS:=
ifneq (,$(filter debug,${DEB_BUILD_OPTIONS}))
OUR_CFLAGS+= -Og -g3
endif
OUR_CFLAGS+= -Wall -Wformat
OUR_CPPFLAGS+= -D_GNU_SOURCE
OUR_CPPFLAGS+= -DUSE_LIBBSD
OUR_CFLAGS+= -fno-strict-aliasing
# addresses part of #698908
OUR_CFLAGS+= -fwrapv
# for now. uses are mostly checked.
OUR_CFLAGS+= -Wno-unused-result
dpkgbuildflagsmkescape=$(subst \,\\\,$(1))
export DEB_BUILD_MAINT_OPTIONS:=hardening=+all optimize=-lto
export DEB_CPPFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_CPPFLAGS})
export DEB_CFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_CFLAGS})
export DEB_LDFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_LDFLAGS})
include /usr/share/dpkg/buildflags.mk
%:
dh $@ -Snone
LIBS+= -lbsd
CONFIGURE_ENV:= $(foreach i,CC CPPFLAGS CFLAGS LDFLAGS LIBS,$(call shellexport,$i))
CONFIGURE_ENV+= CSH=/bin/csh
CONFIGURE_ENV+= ac_cv_path_MKTEMP=/bin/mktemp
CONFIGURE_ARGS:= --build=${DEB_BUILD_GNU_TYPE} \
--host=${DEB_HOST_GNU_TYPE} \
--prefix=/usr \
--infodir=/usr/share/info \
--mandir=/usr/share/man \
--sysconfdir=/etc \
--disable-dependency-tracking \
--disable-maintainer-mode \
--disable-pam \
--disable-nls \
--enable-client \
--enable-password-authenticated-client \
--enable-server \
--enable-proxy \
--enable-case-sensitivity \
--enable-encryption \
--disable-lock-compatibility \
--enable-rootcommit \
--enable-config-override=no \
--without-krb4 \
--with-gssapi \
--with-external-zlib \
--with-rsh=/usr/bin/ssh \
--with-editor=/usr/bin/editor \
--with-tmpdir=/var/tmp \
--with-umask=002 \
--with-cvs-admin-group=_cvsadmin
MAKE_ARGS:= MAKEINFO=makeinfo
MAKE_ARGS+= MAKEINFOFLAGS=--no-split
# ‘u’ is default in Debian and gives warnings (upstream has ‘cru’)
MAKE_ARGS+= ARFLAGS=rc
CLEANFILES:= autom4te.cache build-aux/config.guess \
build-aux/config.sub cvs.spec debian/.*_stamp \
debian/CVSTEMP debian/builddir debian/stagedir \
doc/cvs-paper.pdf doc/cvs.1 doc/cvs.info* \
doc/cvs.pdf doc/cvsclient.info* doc/cvsclient.pdf \
doc/getdate-cvs.texi emx/Makefile os2/Makefile \
vms/config.h windows-NT/config.h
execute_before_dh_auto_clean:
dh_testdir
dh_autoreconf_clean
-rm -rf ${CLEANFILES}
override_dh_auto_configure:
dh_testdir
-rm -rf ${CLEANFILES}
cp /usr/share/misc/config.guess /usr/share/misc/config.sub build-aux/
dh_autoreconf
mkdir debian/builddir debian/stagedir
cd debian/builddir && \
env ${CONFIGURE_ENV} sh ../../configure ${CONFIGURE_ARGS}
# generate PDF 1.4 by default
ln -s ../../../build-aux/texinfo.tex debian/builddir/doc/texinfo-r.tex
printf '%s\n' \
'\pdfminorversion4\relax\pdfobjcompresslevel0\relax%' \
'\input texinfo-r.tex' \
>debian/builddir/doc/texinfo.tex
override_dh_auto_build:
dh_testdir
cd debian/builddir && ${MAKE} ${MAKE_ARGS}
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
cd debian/builddir && ${MAKE} -C doc ${MAKE_ARGS} doc html info pdf txt
endif
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
# run the testsuite after build
# Depends on procps and, if running locally (not in a buildd chroot),
# ssh + rsync (logging in to localhost), for testing remote/proxy op.
# Drop DISABLE_ANY_RSH=1 below to re-enable these.
# warning: this takes a *lot* of time!
# idea: run this under Valgrind to take even more time ;)
set +e; \
cd debian/builddir && \
env DISABLE_ANY_RSH=1 ${MAKE} ${MAKE_ARGS} check; \
rv=$$?; \
echo; \
test $$rv = 0 || for f in lib/getdate.log \
src/check.plog~ src/check.plog src/check.log; do \
echo; \
if test -e "$$f"; then \
echo === "$$f" ===; \
echo; \
cat "$$f"; \
else \
echo ::: "$$f" not found :::; \
fi; \
echo; \
done; \
echo === CVS testsuite finished with errorlevel $$rv; \
exit $$rv
endif
override_dh_auto_install:
-rm -rf debian/stagedir
mkdir -p debian/stagedir/clogs
cd debian/builddir && \
${MAKE} ${MAKE_ARGS} DESTDIR=${CURDIR}/debian/stagedir install
cat ChangeLog ChangeLog.zoo >debian/stagedir/clogs/ChangeLog
cat doc/ChangeLog doc/ChangeLog.fsf >debian/stagedir/clogs/ChangeLog.doc
#cat lib/ChangeLog lib/ChangeLog.fsf >debian/stagedir/clogs/ChangeLog.lib
#cat src/ChangeLog src/ChangeLog-97 src/ChangeLog-96 src/ChangeLog-9395 \
# src/ChangeLog-9194 >debian/stagedir/clogs/ChangeLog.src
cp src/ChangeLog debian/stagedir/clogs/ChangeLog.src
cp contrib/ChangeLog debian/stagedir/clogs/ChangeLog.contrib
cp diff/ChangeLog debian/stagedir/clogs/ChangeLog.diff
#cp m4/ChangeLog debian/stagedir/clogs/ChangeLog.m4
#cp man/ChangeLog debian/stagedir/clogs/ChangeLog.man
#cp tools/ChangeLog debian/stagedir/clogs/ChangeLog.tools
# fat and nonsensical to ship this
rm -f debian/stagedir/usr/share/cvs/contrib/rcs-5.7-commitid.patch
# uses csh
rm -f debian/stagedir/usr/share/cvs/contrib/sccs2rcs
# unsafe
rm -f debian/stagedir/usr/share/cvs/contrib/commit_prep
rm -f debian/stagedir/usr/share/cvs/contrib/cvs_acls
rm -f debian/stagedir/usr/share/cvs/contrib/log
rm -f debian/stagedir/usr/share/cvs/contrib/log_accum
rm -f debian/stagedir/usr/share/cvs/contrib/mfpipe
rm -f debian/stagedir/usr/share/cvs/contrib/rcslock
# we ship cvs-switchroot(1) instead
rm -f debian/stagedir/usr/share/cvs/contrib/newcvsroot
ifneq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
# the nodoc profile will cause lintian warnings as it installs the doc-base files
endif
override_dh_installchangelogs:
dh_installchangelogs debian/stagedir/clogs/ChangeLog
execute_after_dh_installdocs:
mv debian/cvs/usr/share/cvs/contrib/intro.doc \
debian/cvs/usr/share/doc/cvs/intro.txt
override_dh_compress:
dh_compress -X.pdf
execute_before_dh_fixperms:
cd debian/cvs/usr/share/cvs/contrib && chmod +x descend.sh rcs2sccs.sh
override_dh_builddeb:
dh_builddeb -- -Zgzip -z9
|