summaryrefslogtreecommitdiff
path: root/debian/rules
blob: d56c42c4b1aa32018fa73163c57da73c53114b6d (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
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-

DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)

%:
	dh $@ --with autoreconf

DEB_CONFIGURE_EXTRA_FLAGS := \
	--disable-shared \
	--without-libcrack \
	--without-audit \
	--with-libpam \
	--enable-shadowgrp \
	--enable-man \
	--disable-account-tools-setuid \
	--with-group-name-max-length=32 \
	--without-acl \
	--without-attr \
	--without-tcb

ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
DEB_CONFIGURE_EXTRA_FLAGS += --host=$(DEB_HOST_GNU_TYPE)
endif

ifeq (illumos,$(DEB_HOST_ARCH_OS))
DEB_CONFIGURE_EXTRA_FLAGS += --enable-utmpx
DEB_CONFIGURE_EXTRA_FLAGS += --exec-prefix=/usr
endif

override_dh_auto_configure:
	dh_auto_configure -- $(DEB_CONFIGURE_EXTRA_FLAGS)

override_dh_install:
	dh_install
ifeq (hurd,$(DEB_HOST_ARCH_OS))
	install -d debian/passwd/etc
	install -c -m 644 debian/login.defs debian/passwd/etc/login.defs
else
	install -d debian/login/etc
	install -c -m 644 debian/login.defs debian/login/etc/login.defs
endif
	install -c -m 444 debian/securetty.$(DEB_HOST_ARCH_OS) debian/login/etc/securetty
	install -c -m 644 debian/useradd.default debian/passwd/etc/default/useradd
	install -d debian/passwd/sbin
	install -c -m 555 debian/shadowconfig.sh debian/passwd/sbin/shadowconfig

override_dh_installpam:
	dh_installpam -p login
	dh_installpam -p login --name=su
	dh_installpam -p passwd --name=passwd
	dh_installpam -p passwd --name=chfn
	dh_installpam -p passwd --name=chsh
	dh_installpam -p passwd --name=chpasswd
	dh_installpam -p passwd --name=newusers

override_dh_fixperms:
	dh_fixperms
	chmod u+s debian/login/usr/bin/su
	chmod u+s debian/login/usr/bin/newgrp
	chmod u+s debian/passwd/usr/bin/chfn
	chmod u+s debian/passwd/usr/bin/chsh
	chmod u+s debian/passwd/usr/bin/gpasswd
	chmod u+s debian/passwd/usr/bin/passwd
	chgrp shadow debian/passwd/usr/bin/chage
	chgrp shadow debian/passwd/usr/bin/expiry
	chmod g+s debian/passwd/usr/bin/chage
	chmod g+s debian/passwd/usr/bin/expiry