File: rules

package info (click to toggle)
dwm 6.1-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 320 kB
  • sloc: ansic: 2,725; makefile: 111; sh: 36
file content (32 lines) | stat: -rwxr-xr-x 1,099 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

SHELL := sh -e

%:
	dh ${@}

override_dh_auto_clean:
	rm -f config.h
	$(MAKE) clean

override_dh_auto_install:
	$(MAKE) install DESTDIR=$(CURDIR)/debian/dwm PREFIX=/usr

	mv debian/dwm/usr/bin/dwm debian/dwm/usr/bin/dwm.default
	ln -s dwm.1.gz debian/dwm/usr/share/man/man1/dwm.default.1.gz

	# Building alternatives
	for ALTERNATIVE in debian/local/config.*.h; \
	do \
		$(MAKE) clean; \
		cp $${ALTERNATIVE} config.h; \
		CFLAGS="$(CFLAGS)" $(MAKE) PREFIX=/usr; \
		install -m 0755 dwm debian/dwm/usr/bin/dwm.`basename $${ALTERNATIVE} | cut -d'.' -f 2`; \
		ln -s dwm.1.gz debian/dwm/usr/share/man/man1/dwm.`basename $${ALTERNATIVE} | cut -d'.' -f 2`.1.gz; \
	done

	# Configuring maintainer scripts
	sed -e "s|@ALTERNATIVES@|$(shell find debian/local/ -name 'config.*.h' | LC_ALL=C sort | cut -d'.' -f 2 | tr '\n' ' ')|" debian/dwm.postinst.in > debian/dwm.postinst
	sed -e "s|@ALTERNATIVES@|$(shell find debian/local/ -name 'config.*.h' | LC_ALL=C sort | cut -d'.' -f 2 | tr '\n' ' ')|" debian/dwm.prerm.in > debian/dwm.prerm