apply patch from Daniel Schepler to fix mktime.m4
[alioth/cvs.git] / debian / rules
1 #!/usr/bin/make -f
2 # $MirOS: contrib/hosted/tg/deb/cvs/debian/rules,v 1.21 2013/06/26 17:53:16 tg Exp $
3
4 CC?=                    gcc
5 CONFIGURE_ENV:=         CC='${CC}'
6 EXTRA_CFLAGS=           -Wall -fno-strict-aliasing -Wformat
7 # for now. uses are mostly checked.
8 EXTRA_CFLAGS+=          -Wno-unused-result
9 EXTRA_CPPFLAGS=         -D_GNU_SOURCE -DUSE_LIBBSD
10
11 ifneq (,$(wildcard /usr/share/dpkg/buildflags.mk))
12 # dpkg-dev (>= 1.16.1~)
13 DEB_CFLAGS_MAINT_APPEND=${EXTRA_CFLAGS}
14 DEB_CPPFLAGS_MAINT_APPEND=${EXTRA_CPPFLAGS}
15 DEB_BUILD_MAINT_OPTIONS=hardening=+all
16 DPKG_EXPORT_BUILDFLAGS= Yes
17 include /usr/share/dpkg/buildflags.mk
18 else
19 # old-fashioned way to determine build flags
20 CFLAGS=                 -O$(if $(findstring noopt,${DEB_BUILD_OPTIONS}),0,2) -g
21 CFLAGS+=                ${EXTRA_CFLAGS}
22 CPPFLAGS+=              ${EXTRA_CPPFLAGS}
23 CONFIGURE_ENV+=         CFLAGS='${CFLAGS}'
24 CONFIGURE_ENV+=         CPPFLAGS='${CPPFLAGS}'
25 CONFIGURE_ENV+=         LDFLAGS='${LDFLAGS}'
26 endif
27
28 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
29 NUMJOBS=                $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
30 MAKEFLAGS+=             -j${NUMJOBS}
31 endif
32
33 LIBS+=                  -lbsd
34
35 CONFIGURE_ENV+=         LIBS='${LIBS}'
36 CONFIGURE_ENV+=         CSH=/bin/csh
37
38 CONFIGURE_ARGS:=        --prefix=/usr \
39                         --infodir=/usr/share/info \
40                         --mandir=/usr/share/man \
41                         --sysconfdir=/etc \
42                         --disable-dependency-tracking \
43                         --disable-maintainer-mode \
44                         --disable-pam \
45                         --disable-nls \
46                         --enable-client \
47                         --enable-password-authenticated-client \
48                         --enable-server \
49                         --enable-proxy \
50                         --enable-case-sensitivity \
51                         --enable-encryption \
52                         --disable-lock-compatibility \
53                         --enable-rootcommit \
54                         --disable-old-info-format-support \
55                         --enable-config-override=no \
56                         --without-krb4 \
57                         --with-gssapi \
58                         --with-external-zlib \
59                         --with-rsh=ssh \
60                         --with-editor=/usr/bin/editor \
61                         --with-tmpdir=/var/tmp \
62                         --with-umask=002 \
63                         --with-cvs-admin-group=_cvsadmin
64
65 MAKE_ARGS:=             MAKEINFO=makeinfo
66 MAKE_ARGS+=             MAKEINFOFLAGS=--no-split
67
68 CLEANFILES:=            autom4te.cache debian/CVSTEMP debian/.*_stamp \
69                         debian/builddir debian/stagedir \
70                         build-aux/config.guess build-aux/config.sub \
71                         doc/cvs.1 doc/cvs.info* doc/cvsclient.info* \
72                         doc/cvs.pdf doc/cvsclient.pdf \
73                         doc/getdate-cvs.texi m4/mktime.m4 \
74                         vms/config.h windows-NT/config.h
75
76 debian/.configure_stamp:
77         dh_testdir
78         -rm -rf ${CLEANFILES}
79         dh_autoreconf
80         mkdir debian/builddir debian/stagedir
81         cd debian/builddir && \
82             env ${CONFIGURE_ENV} sh ../../configure ${CONFIGURE_ARGS}
83         @:>$@
84
85 build build-indep build-arch: debian/.build_stamp
86
87 debian/.build_stamp: debian/.configure_stamp
88         dh_testdir
89         cd debian/builddir && ${MAKE} ${MAKE_ARGS}
90         cd debian/builddir && ${MAKE} -C doc ${MAKE_ARGS} doc html info pdf txt
91         @:>$@
92
93 clean:
94         dh_testdir
95         dh_autoreconf_clean
96         -rm -rf ${CLEANFILES}
97         dh_clean
98
99 binary-indep:
100
101 binary-arch: debian/.build_stamp
102         dh_testdir
103         dh_testroot
104         if test -x "$$(which dh_prep)"; then dh_prep; else dh_clean -k; fi
105         -rm -rf debian/stagedir
106         mkdir -p debian/stagedir/clogs
107         cd debian/builddir && \
108             ${MAKE} ${MAKE_ARGS} DESTDIR=${CURDIR}/debian/stagedir install
109         cat ChangeLog ChangeLog.zoo >debian/stagedir/clogs/ChangeLog
110         cat doc/ChangeLog doc/ChangeLog.fsf >debian/stagedir/clogs/ChangeLog.doc
111         #cat lib/ChangeLog lib/ChangeLog.fsf >debian/stagedir/clogs/ChangeLog.lib
112         #cat src/ChangeLog src/ChangeLog-97 src/ChangeLog-96 src/ChangeLog-9395 \
113         #    src/ChangeLog-9194 >debian/stagedir/clogs/ChangeLog.src
114         cp src/ChangeLog debian/stagedir/clogs/ChangeLog.src
115         cp contrib/ChangeLog debian/stagedir/clogs/ChangeLog.contrib
116         cp diff/ChangeLog debian/stagedir/clogs/ChangeLog.diff
117         #cp m4/ChangeLog debian/stagedir/clogs/ChangeLog.m4
118         #cp man/ChangeLog debian/stagedir/clogs/ChangeLog.man
119         #cp tools/ChangeLog debian/stagedir/clogs/ChangeLog.tools
120         # fat and nonsensical to ship this
121         rm -f debian/stagedir/usr/share/cvs/contrib/rcs-5.7-commitid.patch
122         # uses csh
123         rm -f debian/stagedir/usr/share/cvs/contrib/sccs2rcs
124         # unsafe
125         rm -f debian/stagedir/usr/share/cvs/contrib/commit_prep
126         rm -f debian/stagedir/usr/share/cvs/contrib/cvs_acls
127         rm -f debian/stagedir/usr/share/cvs/contrib/log
128         rm -f debian/stagedir/usr/share/cvs/contrib/log_accum
129         rm -f debian/stagedir/usr/share/cvs/contrib/mfpipe
130         rm -f debian/stagedir/usr/share/cvs/contrib/rcslock
131         # we ship cvs-switchroot(1) instead
132         rm -f debian/stagedir/usr/share/cvs/contrib/newcvsroot
133         dh_installchangelogs debian/stagedir/clogs/ChangeLog
134         dh_installdocs
135         dh_install
136         dh_installinfo
137         dh_installman
138         dh_link
139         dh_strip
140         dh_compress -X.pdf
141         cd debian/cvs/usr/share/cvs/contrib && chmod +x descend.sh rcs2sccs.sh
142         dh_fixperms
143         dh_installdeb
144         dh_shlibdeps
145         dh_gencontrol
146         dh_md5sums
147         dh_builddeb
148
149 binary: binary-indep binary-arch
150 .PHONY: binary binary-arch binary-indep build build-arch build-indep clean