File: rules

package info (click to toggle)
chntpw 0.99.6-2
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 1,024 kB
  • ctags: 483
  • sloc: ansic: 5,239; makefile: 92
file content (99 lines) | stat: -rwxr-xr-x 2,304 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
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This is the debhelper compatibility version to use.
# export DH_COMPAT=5

include /usr/share/quilt/quilt.make

CFLAGS = -DUSELIBGCRYPT -Wall

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -g
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
        CFLAGS += -O0
else
		CFLAGS += -O2
endif

build: build-stamp
build-stamp: $(QUILT_STAMPFN)
	dh_testdir
	$(MAKE) CFLAGS="$(CFLAGS)"
	touch build-stamp

clean: unpatch
	dh_testdir
	dh_testroot
	[ ! -f Makefile ] || $(MAKE) clean
	-rm -f *.gif
	rm -f build-stamp 
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	install -m 755 chntpw $(CURDIR)/debian/chntpw/usr/sbin/


binary-indep: build install
# We have nothing to do here

binary-arch: build install
	dh_testdir
	dh_testroot
	# Do not install the documentation until available
	[ ! -f faq.uu ] || for i in *.uu; do uudecode  $$i; done
	[ ! -f faq.html ] || dh_installdocs faq.html bootdisk.html *.gif
	dh_installdocs
	dh_installexamples
	dh_installman debian/chntpw.8
	dh_installchangelogs HISTORY.txt
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb


UPSTREAM_VER=080526
UPSTREAM_URL=http://pogostick.net/~pnh/ntpasswd
UPSTREAM_FILE=chntpw-source-$(UPSTREAM_VER).zip
PACKNAME=chntpw
DEBIAN_VER=0.99.6
UNPACK_DIR=$(PACKNAME)-$(DEBIAN_VER).orig
EXTRACT_DIR=/tmp

update-docs:
	for file in faq.html bootdisk.html syskey.txt regedit.txt ; do \
		wget -q -O $$file $(UPSTREAM_URL)/$$file; \
	done

get-orig-source:
	wget -O $(UPSTREAM_FILE) $(UPSTREAM_URL)/$(UPSTREAM_FILE)
	-rm -rf chntpw-$(UPSTREAM_VER) $(UNPACK_DIR)
	unzip $(UPSTREAM_FILE)
	mv chntpw-$(UPSTREAM_VER) $(UNPACK_DIR)
	# Statically linked with OpenSSL, therefore not distributable
	# Upstream has been notified, no response yet
	rm -f $(UNPACK_DIR)/chntpw.static
	tar zcf $(PACKNAME)_$(DEBIAN_VER).orig.tar.gz $(UNPACK_DIR)
	rm -rf $(UNPACK_DIR) $(UPSTREAM_FILE)


binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure