File: rules

package info (click to toggle)
lockfile-progs 0.1.17
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 76 kB
  • ctags: 28
  • sloc: ansic: 326; makefile: 80
file content (40 lines) | stat: -rwxr-xr-x 1,122 bytes parent folder | download
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
#!/usr/bin/make -f
# Copyright 1998-2012 Rob Browning <rlb@defaultvalue.org>
# This file is covered under the terms of the Gnu Public License.

DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)

ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
export CC := $(DEB_HOST_GNU_TYPE)-gcc
endif

export CFLAGS := -DDEBIAN -O2 -g
export LDFLAGS := -g

%:
	dh $@

override_dh_testdir:
	test -f debian/rules
	test -f lockfile-progs.c

override_dh_auto_install:
	install -d debian/lockfile-progs/usr/bin
	cp -a bin/* debian/lockfile-progs/usr/bin/

        # manpages
	install -d debian/lockfile-progs/usr/share/man/man1
	cp -a man/* debian/lockfile-progs/usr/share/man/man1
	find debian/lockfile-progs/usr/share/man -type f | xargs gzip -9v
	(cd debian/lockfile-progs/usr/share/man && \
	 for file in `find -type l`; \
	 do \
	   ln -sf lockfile-progs.1.gz $${file}.gz; \
	   rm -f $${file}; \
	 done)

override_dh_fixperms:
	dh_fixperms
	chown :mail debian/lockfile-progs/usr/bin/mail-lock
	chmod g+s debian/lockfile-progs/usr/bin/mail-lock