| 1 |
#!/usr/bin/make -f
|
| 2 |
# Uncomment this to turn on verbose mode.
|
| 3 |
#export DH_VERBOSE=1
|
| 4 |
|
| 5 |
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
| 6 |
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
| 7 |
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
|
| 8 |
|
| 9 |
debbuild = debian/build-deb
|
| 10 |
udebbuild = debian/build-udeb
|
| 11 |
|
| 12 |
CFLAGS = -Wall -g
|
| 13 |
|
| 14 |
confopts = --with-fsprobe=blkid
|
| 15 |
ifeq ($(DEB_HOST_ARCH_OS),linux)
|
| 16 |
confopts += --with-selinux
|
| 17 |
endif
|
| 18 |
|
| 19 |
confopts_udeb = --with-fsprobe=blkid
|
| 20 |
|
| 21 |
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
|
| 22 |
confbuild += --build $(DEB_HOST_GNU_TYPE)
|
| 23 |
else
|
| 24 |
confbuild += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
|
| 25 |
endif
|
| 26 |
|
| 27 |
build: build-deb build-udeb
|
| 28 |
|
| 29 |
$(debbuild)/config.status: patch-stamp
|
| 30 |
mkdir -p $(debbuild)
|
| 31 |
cd $(debbuild) && \
|
| 32 |
CFLAGS="$(CFLAGS) -O2" \
|
| 33 |
../../configure $(confbuild) $(confopts)
|
| 34 |
|
| 35 |
build-deb: build-deb-stamp
|
| 36 |
build-deb-stamp: $(debbuild)/config.status
|
| 37 |
dh_testdir
|
| 38 |
$(MAKE) -C $(debbuild)
|
| 39 |
touch $@
|
| 40 |
|
| 41 |
$(udebbuild)/config.status: patch-stamp
|
| 42 |
mkdir -p $(udebbuild)
|
| 43 |
cd $(udebbuild) && \
|
| 44 |
CFLAGS="$(CFLAGS) -Os" \
|
| 45 |
../../configure $(confbuild) $(confopts_udeb)
|
| 46 |
|
| 47 |
build-udeb: build-udeb-stamp
|
| 48 |
build-udeb-stamp: $(udebbuild)/config.status
|
| 49 |
dh_testdir
|
| 50 |
$(MAKE) -C $(udebbuild)
|
| 51 |
touch $@
|
| 52 |
|
| 53 |
clean: clean1 unpatch
|
| 54 |
clean1:
|
| 55 |
dh_testdir
|
| 56 |
dh_testroot
|
| 57 |
rm -f *-stamp
|
| 58 |
rm -rf $(debbuild) $(udebbuild)
|
| 59 |
[ ! -f Makefile ] || $(MAKE) distclean
|
| 60 |
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
|
| 61 |
cp -f /usr/share/misc/config.sub config.sub
|
| 62 |
endif
|
| 63 |
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
|
| 64 |
cp -f /usr/share/misc/config.guess config.guess
|
| 65 |
endif
|
| 66 |
dh_clean
|
| 67 |
|
| 68 |
DIR = debian/loop-aes-utils
|
| 69 |
DIR_UDEB = debian/mount-aes-udeb
|
| 70 |
|
| 71 |
install: build
|
| 72 |
dh_testdir
|
| 73 |
dh_testroot
|
| 74 |
dh_clean -k
|
| 75 |
dh_installdirs
|
| 76 |
|
| 77 |
install -m 4755 -o root $(debbuild)/mount/mount $(DIR)/bin
|
| 78 |
install -m 4755 -o root $(debbuild)/mount/umount $(DIR)/bin
|
| 79 |
install -m 755 $(debbuild)/mount/losetup $(DIR)/sbin
|
| 80 |
install -m 755 $(debbuild)/mount/swapon $(DIR)/sbin
|
| 81 |
install -m 755 debian/loop-aes-keygen $(DIR)/usr/bin
|
| 82 |
|
| 83 |
# lintian-override
|
| 84 |
install -m 644 debian/lintian-override $(DIR)/usr/share/lintian/overrides/loop-aes-utils
|
| 85 |
|
| 86 |
# udeb
|
| 87 |
install -d $(DIR_UDEB)/bin
|
| 88 |
install -d $(DIR_UDEB)/sbin
|
| 89 |
install -m 755 $(udebbuild)/mount/mount $(DIR_UDEB)/bin/mount-aes
|
| 90 |
install -m 755 $(udebbuild)/mount/umount $(DIR_UDEB)/bin/umount-aes
|
| 91 |
install -m 755 $(udebbuild)/mount/losetup $(DIR_UDEB)/sbin/losetup-aes
|
| 92 |
install -m 755 $(udebbuild)/mount/swapon $(DIR_UDEB)/sbin/swapon-aes
|
| 93 |
install -m 755 debian/loop-aes-keygen $(DIR_UDEB)/bin
|
| 94 |
|
| 95 |
# initramsfs-tools integration
|
| 96 |
install -m 755 debian/initramfs/script $(DIR)/usr/share/initramfs-tools/scripts/local-top/loopaes
|
| 97 |
install -m 755 debian/initramfs/hook $(DIR)/usr/share/initramfs-tools/hooks/loopaes
|
| 98 |
install -m 644 debian/initramfs/conf $(DIR)/usr/share/initramfs-tools/conf.d/loopaes
|
| 99 |
|
| 100 |
binary-indep: build install
|
| 101 |
|
| 102 |
binary-arch: build install
|
| 103 |
dh_testdir
|
| 104 |
dh_testroot
|
| 105 |
dh_installchangelogs docs/v2.13-ReleaseNotes
|
| 106 |
dh_installdocs debian/README
|
| 107 |
dh_installman -A
|
| 108 |
dh_installinit --name=checkfs-loop --no-start -- start 28 S .
|
| 109 |
dh_link
|
| 110 |
dh_strip
|
| 111 |
dh_compress
|
| 112 |
dh_fixperms --exclude bin/mount --exclude bin/umount
|
| 113 |
dh_installdeb
|
| 114 |
dh_shlibdeps
|
| 115 |
dh_gencontrol
|
| 116 |
dh_md5sums
|
| 117 |
dh_builddeb
|
| 118 |
|
| 119 |
binary: binary-indep binary-arch
|
| 120 |
|
| 121 |
patch: patch-stamp
|
| 122 |
patch-stamp:
|
| 123 |
dpatch apply-all -v
|
| 124 |
touch patch-stamp
|
| 125 |
|
| 126 |
unpatch:
|
| 127 |
dpatch deapply-all
|
| 128 |
rm -rf patch-stamp debian/patched
|
| 129 |
|
| 130 |
.PHONY: build clean binary-indep binary-arch binary install patch unpatch clean1
|