Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
5
6 PACKAGE="procps"
7 DEBROOT=$(CURDIR)/debian/tmp
8
9 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
10 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
11 DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
12 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
13 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
14 ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
15 configure_flags += --host=$(DEB_HOST_GNU_TYPE)
16 CROSS = PKG_CONFIG=$(DEB_HOST_GNU_TYPE)-pkg-config \
17 ac_cv_func_malloc_0_nonnull=yes \
18 ac_cv_func_realloc_0_nonnull=yes
19 else
20 CROSS=
21 endif
22
23 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
24
25 ifeq ($(DEB_HOST_ARCH_OS),linux)
26 LINUX_CONFIGURE_EXTRA_FLAGS = --with-systemd --enable-libselinux
27 endif
28
29 %:
30 dh $@
31
32 override_dh_auto_configure:
33 $(CROSS) ./configure \
34 $(configure_flags) \
35 --build=$(DEB_BUILD_GNU_TYPE) \
36 --disable-silent-rules \
37 --enable-watch8bit --enable-colorwatch \
38 --enable-w-from \
39 --enable-skill ${LINUX_CONFIGURE_EXTRA_FLAGS} \
40 --disable-pidof \
41 --disable-modern-top \
42 --prefix=/usr \
43 --libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
44 --build=$(DEB_BUILD_GNU_TYPE) \
45 --host=$(DEB_HOST_GNU_TYPE) \
46
47
48 override_dh_auto_install: $(autogen-files)
49 dh_auto_install
50
51 ifneq ($(DEB_HOST_ARCH_OS), linux)
52 rm -f \
53 $(DEBROOT)/bin/slabtop \
54 $(DEBROOT)/usr/share/man/man1/slabtop.1 \
55 $(DEBROOT)/sbin/sysctl \
56 $(DEBROOT)/usr/share/man/man8/sysctl.8 \
57 $(DEBROOT)/usr/share/man/man5/sysctl.conf.5 \
58 $(NULL)
59
60 # Rename kill as there are two of them
61 (cd $(DEBROOT)/usr/bin && mv kill kill.procps )
62 (cd $(DEBROOT)/usr/share/man/man1 && mv kill.1 kill.procps.1 )
63 endif
64 ifeq ($(DEB_HOST_ARCH_OS), hurd)
65 rm -f \
66 $(DEBROOT)/bin/pmap \
67 $(DEBROOT)/usr/share/man/man1/pmap.1 \
68 $(NULL)
69
70 # Rename vmstat as there are two of them
71 (cd $(DEBROOT)/usr/bin && mv vmstat vmstat.procps )
72 (cd $(DEBROOT)/usr/share/man/man8 && mv vmstat.8 vmstat.procps.8 )
73
74 # Rename uptime as there are two of them
75 (cd $(DEBROOT)/usr/bin && mv uptime uptime.procps )
76 (cd $(DEBROOT)/usr/share/man/man1 && mv uptime.1 uptime.procps.1 )
77
78 # Rename ps as there are two of them
79 (cd $(DEBROOT)/usr/bin && mv ps ps.procps )
80 (cd $(DEBROOT)/usr/share/man/man1 && mv ps.1 ps.procps.1 )
81 endif
82
83 override_dh_installchangelogs:
84 dh_installchangelogs NEWS
85
86 override_dh_installinit:
87 ifeq ($(DEB_HOST_ARCH_OS), linux)
88 dh_installinit --no-start
89 endif
90