summaryrefslogtreecommitdiffstats
path: root/debian/rules
blob: c7a291d53c9a304c3f542956f3f762ef4be8730c (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
#!/usr/bin/make -f

OSNAME = "GNU/`uname | sed -e 's/GNU\///'`"
ifeq ($(DEB_HOST_GNU_SYSTEM),linux)
  OSNAME=GNU/Linux
endif
ifeq ($(DEB_HOST_GNU_SYSTEM),gnu)
  OSNAME=GNU/Hurd
endif

VENDORFILE = debian
DESTDIR = debian/base-files

%:
	dh $@

override_dh_auto_build:
	sh debian/check-md5sum-etc profile

override_dh_auto_install:
	install -p -m 644 etc/*      $(DESTDIR)/etc
	install -p -m 755 motd/*     $(DESTDIR)/etc/update-motd.d
	install -p -m 644 licenses/* $(DESTDIR)/usr/share/common-licenses
	install -p -m 644 origins/*  $(DESTDIR)/etc/dpkg/origins
	install -p -m 644 share/*    $(DESTDIR)/usr/share/base-files
ifeq ($(DEB_HOST_GNU_SYSTEM),gnu)
	rmdir $(DESTDIR)/sys
endif
	sed -e "s&#OSNAME#&$(OSNAME)&g" share/motd     > $(DESTDIR)/usr/share/base-files/motd
	sed -e "s&#OSNAME#&$(OSNAME)&g" share/info.dir > $(DESTDIR)/usr/share/base-files/info.dir
	sed -e "s&#OSNAME#&$(OSNAME)&g" etc/issue      > $(DESTDIR)/etc/issue
	sed -e "s&#OSNAME#&$(OSNAME)&g" etc/issue.net  > $(DESTDIR)/etc/issue.net
	sed -e "s&#OSNAME#&$(OSNAME)&g" etc/os-release > $(DESTDIR)/etc/os-release
	mv $(DESTDIR)/etc/os-release $(DESTDIR)/usr/lib/os-release
	ln -s ../usr/lib/os-release $(DESTDIR)/etc/os-release

override_dh_installchangelogs:
	dh_installchangelogs --no-trim

override_dh_link:
	dh_link -X os-release

override_dh_compress:
	dh_compress -X README

override_dh_fixperms:
	dh_fixperms
	cd debian/base-files && chown root:staff   var/local
	cd debian/base-files && chmod 755  `find . -type d`
	cd debian/base-files && chmod 1777 `cat ../1777-dirs`
	cd debian/base-files && chmod 2775 `cat ../2775-dirs`
	cd debian/base-files && chmod 700 root

override_dh_installdeb:
	dh_installdeb -DVENDORFILE=$(VENDORFILE)