first rough draft of a mircvs package
[alioth/cvs.git] / debian / rules
1 #!/usr/bin/make -f
2 # $MirOS: contrib/hosted/tg/deb/cvs/debian/rules,v 1.1 2010/09/16 00:18:40 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+=      -DUSE_LIBBSD
27 LIBS+=          -lbsd
28
29 CPPFLAGS+=      -include ${CURDIR}/debian/port.h
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 --no-split'
69
70 debian/.configure_stamp:
71         dh_testdir
72         -rm -f debian/.*_stamp build-aux/config.guess build-aux/config.sub
73         -rm -rf debian/builddir debian/stagedir
74         cp /usr/share/misc/config.guess /usr/share/misc/config.sub build-aux/
75         mkdir debian/builddir debian/stagedir
76         cd debian/builddir && \
77             env ${CONFIGURE_ENV} sh ../../configure ${CONFIGURE_ARGS}
78         @:>$@
79
80 build: debian/.configure_stamp
81         dh_testdir
82         cd debian/builddir && ${MAKE}
83
84 clean:
85         dh_testdir
86         -rm -f debian/.*_stamp build-aux/config.guess build-aux/config.sub
87         -rm -f doc/cvs.1 doc/cvs.info* doc/cvsclient.info*
88         -rm -rf debian/builddir debian/stagedir
89         dh_clean
90
91 install: build
92         dh_testdir
93         dh_testroot
94         dh_clean -k
95         dh_installdirs
96         -rm -rf debian/stagedir
97         _topdir=$$(pwd); cd debian/builddir && \
98             ${MAKE} DESTDIR=$$_topdir/debian/stagedir install
99
100 # Build architecture-independent files here.
101 binary-indep: build install
102 # We have nothing to do by default.
103
104 # Build architecture-dependent files here.
105 binary-arch: build install
106         dh_testdir
107         dh_testroot
108         dh_installchangelogs ChangeLog
109         dh_installdocs
110 #       dh_installexamples
111         dh_install
112 #       dh_installmenu
113 #       dh_installdebconf
114 #       dh_installlogrotate
115 #       dh_installemacsen
116         dh_installpam
117 #       dh_installmime
118 #       dh_installinit
119 #       dh_installcron
120         dh_installinfo
121         dh_installman
122         dh_link
123         dh_strip
124         dh_compress
125         cd debian/cvs/usr/share/cvs/contrib && chmod +x descend.sh rcs2sccs.sh
126         dh_fixperms
127 #       dh_perl
128 #       dh_python
129 #       dh_makeshlibs
130         dh_installdeb
131         dh_shlibdeps
132         dh_gencontrol
133         dh_md5sums
134         dh_builddeb
135
136 binary: binary-indep binary-arch
137 .PHONY: build clean binary-indep binary-arch binary install check