almost there
[alioth/cvs.git] / debian / rules
1 #!/usr/bin/make -f
2 # $MirOS: contrib/hosted/tg/deb/cvs/debian/rules,v 1.2 2010/09/16 18:55:46 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
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 CONFIGURE_ARGS+=        --enable-pam \
47                         --with-hardcoded-pam-service-name=cvs
48 CONFIGURE_ARGS+=        --disable-nls \
49                         --enable-client \
50                         --enable-password-authenticated-client \
51                         --enable-server \
52                         --enable-proxy \
53                         --enable-case-sensitivity \
54                         --disable-encryption \
55                         --disable-lock-compatibility \
56                         --disable-rootcommit \
57                         --disable-old-info-format-support \
58                         --enable-config-override=no \
59                         --without-krb4 \
60                         --without-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
77 debian/.configure_stamp:
78         dh_testdir
79         -rm -rf ${CLEANFILES}
80         cp /usr/share/misc/config.guess /usr/share/misc/config.sub build-aux/
81         mkdir debian/builddir debian/stagedir
82         cd debian/builddir && \
83             env ${CONFIGURE_ENV} sh ../../configure ${CONFIGURE_ARGS}
84         @:>$@
85
86 build: debian/.build_stamp
87
88 debian/.build_stamp: debian/.configure_stamp
89         dh_testdir
90         cd debian/builddir && ${MAKE} ${MAKE_ARGS}
91         cd debian/builddir && ${MAKE} -C doc ${MAKE_ARGS} doc html info pdf txt
92         @:>$@
93
94 clean:
95         dh_testdir
96         -rm -rf ${CLEANFILES}
97         dh_clean
98
99 install: debian/.install_stamp
100
101 debian/.install_stamp: debian/.build_stamp
102         dh_testdir
103         dh_testroot
104         dh_clean -k
105         dh_installdirs
106         -rm -rf debian/stagedir
107         mkdir -p debian/stagedir/clogs
108         cd debian/builddir && \
109             ${MAKE} ${MAKE_ARGS} DESTDIR=${CURDIR}/debian/stagedir install
110         cat ChangeLog ChangeLog.zoo >debian/stagedir/clogs/ChangeLog
111         cat doc/ChangeLog doc/ChangeLog.fsf >debian/stagedir/clogs/ChangeLog.doc
112         cat lib/ChangeLog lib/ChangeLog.fsf >debian/stagedir/clogs/ChangeLog.lib
113         cat src/ChangeLog src/ChangeLog-97 src/ChangeLog-96 src/ChangeLog-9395 \
114             src/ChangeLog-9194 >debian/stagedir/clogs/ChangeLog.src
115         cp contrib/ChangeLog debian/stagedir/clogs/ChangeLog.contrib
116         cp contrib/pam/ChangeLog debian/stagedir/clogs/ChangeLog.pam
117         cp diff/ChangeLog debian/stagedir/clogs/ChangeLog.diff
118         cp m4/ChangeLog debian/stagedir/clogs/ChangeLog.m4
119         cp man/ChangeLog debian/stagedir/clogs/ChangeLog.man
120         cp tools/ChangeLog debian/stagedir/clogs/ChangeLog.tools
121         @:>$@
122
123 # Build architecture-independent files here.
124 binary-indep: build install
125 # We have nothing to do by default.
126
127 # Build architecture-dependent files here.
128 binary-arch: build install
129         dh_testdir
130         dh_testroot
131         dh_installchangelogs debian/stagedir/clogs/ChangeLog
132         dh_installdocs
133 #       dh_installexamples
134         dh_install
135 #       dh_installmenu
136 #       dh_installdebconf
137 #       dh_installlogrotate
138 #       dh_installemacsen
139         dh_installpam
140 #       dh_installmime
141 #       dh_installinit
142 #       dh_installcron
143         dh_installinfo
144         dh_installman
145         dh_link
146         dh_strip
147         dh_compress
148         cd debian/cvs/usr/share/cvs/contrib && chmod +x descend.sh rcs2sccs.sh
149         dh_fixperms
150 #       dh_perl
151 #       dh_python
152 #       dh_makeshlibs
153         dh_installdeb
154         dh_shlibdeps
155         dh_gencontrol
156         dh_md5sums
157         dh_builddeb
158
159 binary: binary-indep binary-arch
160 .PHONY: build clean binary-indep binary-arch binary install check