File: rules

package info (click to toggle)
ftpcopy 0.6.7-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 204 kB
  • sloc: makefile: 37; sh: 32
file content (54 lines) | stat: -rwxr-xr-x 1,660 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
include /usr/share/dpkg/default.mk
export CFLAGS  += $(shell getconf LFS_CFLAGS)
export LDFLAGS += $(shell getconf LFS_LDFLAGS)
include $(shell debian/cfg-diet)

# src/error.h checks for presence of errno with #ifndef.  It breaks diet
# libc build, which does not define errno as macro, hence this workaround.
CFLAGS += -Derrno=errno

%:
	dh $@

V = $(DEB_VERSION_UPSTREAM)

override_dh_auto_configure:
	tar xzf ftpcopy-$V.tar.gz

	# Patching can't be done with quilt, since upstream distribution
	# is very wierd -- it contains tarball in tarball.
	for diff in debian/diff/*.diff ; do \
		(cd web/ftpcopy-$V && patch -p1) < $$diff; \
	done
	cp -r --link web/ftpcopy-$V ftpcopy-diet
	cp -r --link web/ftpcopy-$V ftpcopy-glibc

	echo '$(CC)'      > ftpcopy-glibc/src/conf-cc
	echo '$(CC)'      > ftpcopy-glibc/src/conf-ld
	echo '$(CFLAGS)'  > ftpcopy-glibc/src/conf-cflags
	echo '$(LDFLAGS)' > ftpcopy-glibc/src/conf-ldflags
	echo 'diet gcc'   > ftpcopy-diet/src/conf-cc
	echo 'diet gcc'   > ftpcopy-diet/src/conf-ld
	echo '$(CFLAGS)'  > ftpcopy-diet/src/conf-cflags
	echo '$(LDFLAGS)' > ftpcopy-diet/src/conf-ldflags
# Used on installation phase.
ifeq ($(WANT_DIETLIBC),yes)
	ln -s ftpcopy-diet ftpcopy
else
	ln -s ftpcopy-glibc ftpcopy
endif

override_dh_auto_clean:
	rm -rf ./web ftpcopy-glibc ftpcopy-diet debian/diet.mk ftpcopy

override_dh_auto_build:
ifeq ($(HAVE_DIETLIBC),yes)
	make -C ftpcopy-diet
endif
	make -C ftpcopy-glibc
	# This manpage is wierd and seems to be more tailored to HTML
	# output, then to normal terminal one.
	sed -ri '/^.("|URL|HTML|LINE)/ d' ftpcopy/doc/ftpcp.1