Build with Kerberos V support (LP: #157760)
[alioth/cvs.git] / debian / rules
1 #!/usr/bin/make -f
2 # $MirOS: contrib/hosted/tg/deb/cvs/debian/rules,v 1.4 2011/05/06 20:45:10 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 CONFIGURE_ARGS+=        --enable-pam \
48                         --with-hardcoded-pam-service-name=cvs
49 CONFIGURE_ARGS+=        --disable-nls \
50                         --enable-client \
51                         --enable-password-authenticated-client \
52                         --enable-server \
53                         --enable-proxy \
54                         --enable-case-sensitivity \
55                         --disable-encryption \
56                         --disable-lock-compatibility \
57                         --disable-rootcommit \
58                         --disable-old-info-format-support \
59                         --enable-config-override=no \
60                         --without-krb4 \
61                         --with-gssapi \
62                         --with-external-zlib \
63                         --with-rsh=ssh \
64                         --with-editor=/bin/ed \
65                         --with-tmpdir=/var/tmp \
66                         --with-umask=002 \
67                         --with-cvs-admin-group=_cvsadmin
68
69 MAKE_ARGS:=             MAKEINFO=makeinfo
70 MAKE_ARGS+=             MAKEINFOFLAGS=--no-split
71
72 CLEANFILES:=            autom4te.cache debian/CVSTEMP debian/.*_stamp \
73                         debian/builddir debian/stagedir \
74                         build-aux/config.guess build-aux/config.sub \
75                         doc/cvs.1 doc/cvs.info* doc/cvsclient.info* \
76                         doc/cvs.pdf doc/cvsclient.pdf \
77                         doc/getdate-cvs.texi \
78                         vms/config.h windows-NT/config.h
79
80 debian/.configure_stamp:
81         dh_testdir
82         -rm -rf ${CLEANFILES}
83         cp /usr/share/misc/config.guess /usr/share/misc/config.sub build-aux/
84         mkdir debian/builddir debian/stagedir
85         cd debian/builddir && \
86             env ${CONFIGURE_ENV} sh ../../configure ${CONFIGURE_ARGS}
87         @:>$@
88
89 build: debian/.build_stamp
90
91 debian/.build_stamp: debian/.configure_stamp
92         dh_testdir
93         cd debian/builddir && ${MAKE} ${MAKE_ARGS}
94         cd debian/builddir && ${MAKE} -C doc ${MAKE_ARGS} doc html info pdf txt
95         @:>$@
96
97 clean:
98         dh_testdir
99         -rm -rf ${CLEANFILES}
100         dh_clean
101
102 install: debian/.install_stamp
103
104 debian/.install_stamp: debian/.build_stamp
105         dh_testdir
106         dh_testroot
107         dh_clean -k
108         dh_installdirs
109         -rm -rf debian/stagedir
110         mkdir -p debian/stagedir/clogs
111         cd debian/builddir && \
112             ${MAKE} ${MAKE_ARGS} DESTDIR=${CURDIR}/debian/stagedir install
113         cat ChangeLog ChangeLog.zoo >debian/stagedir/clogs/ChangeLog
114         cat doc/ChangeLog doc/ChangeLog.fsf >debian/stagedir/clogs/ChangeLog.doc
115         cat lib/ChangeLog lib/ChangeLog.fsf >debian/stagedir/clogs/ChangeLog.lib
116         cat src/ChangeLog src/ChangeLog-97 src/ChangeLog-96 src/ChangeLog-9395 \
117             src/ChangeLog-9194 >debian/stagedir/clogs/ChangeLog.src
118         cp contrib/ChangeLog debian/stagedir/clogs/ChangeLog.contrib
119         cp contrib/pam/ChangeLog debian/stagedir/clogs/ChangeLog.pam
120         cp diff/ChangeLog debian/stagedir/clogs/ChangeLog.diff
121         cp m4/ChangeLog debian/stagedir/clogs/ChangeLog.m4
122         cp man/ChangeLog debian/stagedir/clogs/ChangeLog.man
123         cp tools/ChangeLog debian/stagedir/clogs/ChangeLog.tools
124         nroff -man -Tascii contrib/cvshelp.man | \
125             col -b >debian/stagedir/cvshelp.txt
126         @:>$@
127
128 # Build architecture-independent files here.
129 binary-indep: build install
130 # We have nothing to do by default.
131
132 # Build architecture-dependent files here.
133 binary-arch: build install
134         dh_testdir
135         dh_testroot
136         dh_installchangelogs debian/stagedir/clogs/ChangeLog
137         dh_installdocs
138 #       dh_installexamples
139         dh_install
140 #       dh_installmenu
141 #       dh_installdebconf
142 #       dh_installlogrotate
143 #       dh_installemacsen
144         dh_installpam
145 #       dh_installmime
146 #       dh_installinit
147 #       dh_installcron
148         dh_installinfo
149         dh_installman
150         dh_link
151         dh_strip
152         dh_compress
153         cd debian/cvs/usr/share/cvs/contrib && chmod +x descend.sh rcs2sccs.sh
154         dh_fixperms
155 #       dh_perl
156 #       dh_python
157 #       dh_makeshlibs
158         dh_installdeb
159         dh_shlibdeps
160         dh_gencontrol
161         dh_md5sums
162         dh_builddeb
163
164 binary: binary-indep binary-arch
165 .PHONY: build clean binary-indep binary-arch binary install check