summaryrefslogtreecommitdiff
path: root/debian/rules
blob: 242137673fa1532b4f7072495f57ff4eedf4b9f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1
package:=dist
SRCTOP:= $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
INSTALL = install
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
    INSTALL_PROGRAM += -s
endif
install_file	= $(INSTALL) -p	   -o root -g root  -m	644
install_program = $(INSTALL) -p	   -o root -g root  -m	755
install_script	= $(INSTALL) -p	   -o root -g root  -m	755
make_directory	= $(INSTALL) -p -d -o root -g root  -m	755
email := srivasta@debian.org
TMPTOP:=$(SRCTOP)/debian/tmp
DOCDIR=$(SRCTOP)/debian/$(package)/usr/share/doc/$(package)
DEBDOCDIR=$(TMPTOP)/usr/share/doc/$(package)
DEBLIBDIR=$(TMPTOP)/usr/lib/$(package)
PKG_DIR = $(TMPTOP)/usr/share/$(package)
MAN1DIR = $(TMPTOP)/usr/share/man/man1
MAN7DIR = $(TMPTOP)/usr/share/man/man7
PAT_EXEC       = patcil patdiff patbase patlog patmake patsend \
                 patnotify patpost patftp patname patsnap patcol \
                 patclean patindex

DPKG_ARCH := dpkg-architecture
export DEB_HOST_MULTIARCH  := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_MULTIARCH)

%:
	dh $@

override_dh_auto_configure:
	/bin/cp -rpf debian/Config      .config         && \
          /bin/cp -pf  debian/config.over config.over   && \
	    touch .config/nomail                        && \
              sh ./Configure                               \
                -de                                        \
                -D prefix=$(PREFIX)                        \
                -D orgname=/etc/news/organization          \
                -D defeditor=/usr/ae                       \
	        -D privlib=/usr/share/$(package)           \
                -D pager=/bin/more                         \
                -D mansrc=/usr/share/man/                  \
                -D cf_email='$(email)'                     \
                -D d_berknames='define'


override_dh_auto_build:
	dh_auto_build
	bash -m debian/postinst
	bash -n debian/config
	bash -n debian/postrm
	bash -n debian/prerm

override_dh_install:
	test -d $(MAN1DIR) || $(make_directory) $(MAN1DIR)
	$(MAKE) install
	$(MAKE) install.man
	$(make_directory) $(MAN7DIR)
	(cd $(MAN1DIR); for file in $(PAT_EXEC) ; do \
                        ln -s pat.1.gz $$file.1.gz ; \
                        done )
	mv $(MAN1DIR)/dist.1 $(MAN7DIR)/dist.7
	dh_install

override_dh_installdocs:
	dh_installdocs
	test ! -d $(DOCDIR) || $(make_directory) $(DOCDIR)
	$(install_file) mcon/INTRO	$(DOCDIR)/INTRO.mcon
	$(install_file) jmake/NOTES	$(DOCDIR)/NOTES.jmake
	$(install_file) mcon/NOTES	$(DOCDIR)/NOTES.mcon
	$(install_file) jmake/README	$(DOCDIR)/README.jmake
	$(install_file) kit/README	$(DOCDIR)/README.kit
	$(install_file) mcon/README	$(DOCDIR)/README.mcon
	$(install_file) pat/README	$(DOCDIR)/README.pat


override_dh_clean:
	test ! -f Makefile || $(MAKE) clobber
	dh_clean
	test ! -d .config || rm -rf .config

#Local variables:
#mode: makefile
#End: