update and bring them in sync
[alioth/cvs.git] / debian / rules
1 #!/usr/bin/make -f
2 # $MirOS: contrib/hosted/tg/deb/cvs/debian/rules,v 1.7 2011/06/11 03:55:32 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 CPPFLAGS+=      -include ${CURDIR}/debian/port.h
27 CFLAGS+=        -fno-strict-aliasing -Wformat
28
29 CPPFLAGS+=      -DUSE_LIBBSD
30 LIBS+=          -lbsd
31
32 CONFIGURE_ENV:=         CC='${CC}'
33 CONFIGURE_ENV+=         CFLAGS='${CFLAGS}'
34 CONFIGURE_ENV+=         CPPFLAGS='${CPPFLAGS}'
35 CONFIGURE_ENV+=         LIBS='${LIBS}'
36 CONFIGURE_ENV+=         CSH=/bin/csh
37
38 # check takes forever, so assume the safe choice
39 CONFIGURE_ENV+=         ac_cv_func_working_mktime=no
40
41 CONFIGURE_ARGS:=        --prefix=/usr \
42                         --infodir=/usr/share/info \
43                         --mandir=/usr/share/man \
44                         --sysconfdir=/etc \
45                         --disable-dependency-tracking \
46                         --disable-maintainer-mode \
47                         --disable-pam \
48                         --disable-nls \
49                         --enable-client \
50                         --enable-password-authenticated-client \
51                         --enable-server \
52                         --enable-proxy \
53                         --enable-case-sensitivity \
54                         --enable-encryption \
55                         --disable-lock-compatibility \
56                         --disable-rootcommit \
57                         --disable-old-info-format-support \
58                         --enable-config-override=no \
59                         --without-krb4 \
60                         --with-gssapi \
61                         --with-external-zlib \
62                         --with-rsh=ssh \
63                         --with-editor=/bin/ed \
64                         --with-tmpdir=/var/tmp \
65                         --with-umask=002 \
66                         --with-cvs-admin-group=_cvsadmin
67
68 MAKE_ARGS:=             MAKEINFO=makeinfo
69 MAKE_ARGS+=             MAKEINFOFLAGS=--no-split
70
71 CLEANFILES:=            autom4te.cache debian/CVSTEMP debian/.*_stamp \
72                         debian/builddir debian/stagedir \
73                         build-aux/config.guess build-aux/config.sub \
74                         doc/cvs.1 doc/cvs.info* doc/cvsclient.info* \
75                         doc/cvs.pdf doc/cvsclient.pdf \
76                         doc/getdate-cvs.texi \
77                         vms/config.h windows-NT/config.h
78
79 debian/.configure_stamp:
80         dh_testdir
81         -rm -rf ${CLEANFILES}
82         cp /usr/share/misc/config.guess /usr/share/misc/config.sub build-aux/
83         mkdir debian/builddir debian/stagedir
84         cd debian/builddir && \
85             env ${CONFIGURE_ENV} sh ../../configure ${CONFIGURE_ARGS}
86         @:>$@
87
88 build: debian/.build_stamp
89
90 debian/.build_stamp: debian/.configure_stamp
91         dh_testdir
92         cd debian/builddir && ${MAKE} ${MAKE_ARGS}
93         cd debian/builddir && ${MAKE} -C doc ${MAKE_ARGS} doc html info pdf txt
94         @:>$@
95
96 clean:
97         dh_testdir
98         -rm -rf ${CLEANFILES}
99         dh_clean
100
101 install: debian/.install_stamp
102
103 debian/.install_stamp: debian/.build_stamp
104         dh_testdir
105         dh_testroot
106         dh_clean -k
107         dh_installdirs
108         -rm -rf debian/stagedir
109         mkdir -p debian/stagedir/clogs
110         cd debian/builddir && \
111             ${MAKE} ${MAKE_ARGS} DESTDIR=${CURDIR}/debian/stagedir install
112         cat ChangeLog ChangeLog.zoo >debian/stagedir/clogs/ChangeLog
113         cat doc/ChangeLog doc/ChangeLog.fsf >debian/stagedir/clogs/ChangeLog.doc
114         #cat lib/ChangeLog lib/ChangeLog.fsf >debian/stagedir/clogs/ChangeLog.lib
115         #cat src/ChangeLog src/ChangeLog-97 src/ChangeLog-96 src/ChangeLog-9395 \
116         #    src/ChangeLog-9194 >debian/stagedir/clogs/ChangeLog.src
117         cp src/ChangeLog debian/stagedir/clogs/ChangeLog.src
118         cp contrib/ChangeLog debian/stagedir/clogs/ChangeLog.contrib
119         cp diff/ChangeLog debian/stagedir/clogs/ChangeLog.diff
120         #cp m4/ChangeLog debian/stagedir/clogs/ChangeLog.m4
121         #cp man/ChangeLog debian/stagedir/clogs/ChangeLog.man
122         #cp tools/ChangeLog debian/stagedir/clogs/ChangeLog.tools
123         nroff -man -Tascii contrib/cvshelp.man | \
124             col -b >debian/stagedir/cvshelp.txt
125         @:>$@
126
127 # Build architecture-independent files here.
128 binary-indep: build install
129 # We have nothing to do by default.
130
131 # Build architecture-dependent files here.
132 binary-arch: build install
133         dh_testdir
134         dh_testroot
135         dh_installchangelogs debian/stagedir/clogs/ChangeLog
136         dh_installdocs
137         dh_install
138         dh_installinfo
139         dh_installman
140         dh_link
141         dh_strip
142         dh_compress
143         cd debian/cvs/usr/share/cvs/contrib && chmod +x descend.sh rcs2sccs.sh
144         dh_fixperms
145         dh_installdeb
146         dh_shlibdeps
147         dh_gencontrol
148         dh_md5sums
149         dh_builddeb
150
151 binary: binary-indep binary-arch
152 .PHONY: build clean binary-indep binary-arch binary install check