drop __RCSID (these are all -kb anyway) and reduce diff to upstream
[alioth/cvs.git] / debian / rules
1 #!/usr/bin/make -f
2 # $MirOS: contrib/hosted/tg/deb/cvs/debian/rules,v 1.9 2011/07/28 11:23:54 tg Exp $
3 #-
4 # -*- makefile -*-
5 # Sample debian/rules that uses debhelper.
6 # This file was originally written by Joey Hess and Craig Small.
7 # As a special exception, when this file is copied by dh-make into a
8 # dh-make output file, you may use that output file without restriction.
9 # This special exception was added by Craig Small in version 0.37 of dh-make.
10
11 CC?=            gcc
12 CFLAGS=         -Wall -g
13
14 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
15 CFLAGS+=        -O0
16 else
17 CFLAGS+=        -O2
18 endif
19
20 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
21 NUMJOBS=        $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
22 MAKEFLAGS+=     -j${NUMJOBS}
23 endif
24
25 CPPFLAGS+=      -D_GNU_SOURCE
26 CFLAGS+=        -fno-strict-aliasing -Wformat
27
28 CPPFLAGS+=      -DUSE_LIBBSD
29 LIBS+=          -lbsd
30
31 CONFIGURE_ENV:=         CC='${CC}'
32 CONFIGURE_ENV+=         CFLAGS='${CFLAGS}'
33 CONFIGURE_ENV+=         CPPFLAGS='${CPPFLAGS}'
34 CONFIGURE_ENV+=         LIBS='${LIBS}'
35 CONFIGURE_ENV+=         CSH=/bin/csh
36
37 # check takes forever, so assume the safe choice
38 CONFIGURE_ENV+=         ac_cv_func_working_mktime=no
39
40 CONFIGURE_ARGS:=        --prefix=/usr \
41                         --infodir=/usr/share/info \
42                         --mandir=/usr/share/man \
43                         --sysconfdir=/etc \
44                         --disable-dependency-tracking \
45                         --disable-maintainer-mode \
46                         --disable-pam \
47                         --disable-nls \
48                         --enable-client \
49                         --enable-password-authenticated-client \
50                         --enable-server \
51                         --enable-proxy \
52                         --enable-case-sensitivity \
53                         --enable-encryption \
54                         --disable-lock-compatibility \
55                         --disable-rootcommit \
56                         --disable-old-info-format-support \
57                         --enable-config-override=no \
58                         --without-krb4 \
59                         --with-gssapi \
60                         --with-external-zlib \
61                         --with-rsh=ssh \
62                         --with-editor=/usr/bin/editor \
63                         --with-tmpdir=/var/tmp \
64                         --with-umask=002 \
65                         --with-cvs-admin-group=_cvsadmin
66
67 MAKE_ARGS:=             MAKEINFO=makeinfo
68 MAKE_ARGS+=             MAKEINFOFLAGS=--no-split
69
70 CLEANFILES:=            autom4te.cache debian/CVSTEMP debian/.*_stamp \
71                         debian/builddir debian/stagedir \
72                         build-aux/config.guess build-aux/config.sub \
73                         doc/cvs.1 doc/cvs.info* doc/cvsclient.info* \
74                         doc/cvs.pdf doc/cvsclient.pdf \
75                         doc/getdate-cvs.texi \
76                         vms/config.h windows-NT/config.h
77
78 debian/.configure_stamp:
79         dh_testdir
80         -rm -rf ${CLEANFILES}
81         cp /usr/share/misc/config.guess /usr/share/misc/config.sub build-aux/
82         mkdir debian/builddir debian/stagedir
83         cd debian/builddir && \
84             env ${CONFIGURE_ENV} sh ../../configure ${CONFIGURE_ARGS}
85         @:>$@
86
87 build: debian/.build_stamp
88
89 debian/.build_stamp: debian/.configure_stamp
90         dh_testdir
91         cd debian/builddir && ${MAKE} ${MAKE_ARGS}
92         cd debian/builddir && ${MAKE} -C doc ${MAKE_ARGS} doc html info pdf txt
93         @:>$@
94
95 clean:
96         dh_testdir
97         -rm -rf ${CLEANFILES}
98         dh_clean
99
100 install: debian/.install_stamp
101
102 debian/.install_stamp: debian/.build_stamp
103         dh_testdir
104         dh_testroot
105         dh_clean -k
106         dh_installdirs
107         -rm -rf debian/stagedir
108         mkdir -p debian/stagedir/clogs
109         cd debian/builddir && \
110             ${MAKE} ${MAKE_ARGS} DESTDIR=${CURDIR}/debian/stagedir install
111         cat ChangeLog ChangeLog.zoo >debian/stagedir/clogs/ChangeLog
112         cat doc/ChangeLog doc/ChangeLog.fsf >debian/stagedir/clogs/ChangeLog.doc
113         #cat lib/ChangeLog lib/ChangeLog.fsf >debian/stagedir/clogs/ChangeLog.lib
114         #cat src/ChangeLog src/ChangeLog-97 src/ChangeLog-96 src/ChangeLog-9395 \
115         #    src/ChangeLog-9194 >debian/stagedir/clogs/ChangeLog.src
116         cp src/ChangeLog debian/stagedir/clogs/ChangeLog.src
117         cp contrib/ChangeLog debian/stagedir/clogs/ChangeLog.contrib
118         cp diff/ChangeLog debian/stagedir/clogs/ChangeLog.diff
119         #cp m4/ChangeLog debian/stagedir/clogs/ChangeLog.m4
120         #cp man/ChangeLog debian/stagedir/clogs/ChangeLog.man
121         #cp tools/ChangeLog debian/stagedir/clogs/ChangeLog.tools
122         nroff -man -Tascii contrib/cvshelp.man | \
123             col -b >debian/stagedir/cvshelp.txt
124         @:>$@
125
126 # Build architecture-independent files here.
127 binary-indep: build install
128 # We have nothing to do by default.
129
130 # Build architecture-dependent files here.
131 binary-arch: build install
132         dh_testdir
133         dh_testroot
134         dh_installchangelogs debian/stagedir/clogs/ChangeLog
135         dh_installdocs
136         dh_install
137         dh_installinfo
138         dh_installman
139         dh_link
140         dh_strip
141         dh_compress
142         cd debian/cvs/usr/share/cvs/contrib && chmod +x descend.sh rcs2sccs.sh
143         dh_fixperms
144         dh_installdeb
145         dh_shlibdeps
146         dh_gencontrol
147         dh_md5sums
148         dh_builddeb
149
150 binary: binary-indep binary-arch
151 .PHONY: build clean binary-indep binary-arch binary install check