File: rules

package info (click to toggle)
sc 6.21-3
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 496 kB
  • ctags: 669
  • sloc: ansic: 8,969; yacc: 440; makefile: 207; lisp: 98; sed: 4
file content (70 lines) | stat: -rwxr-xr-x 2,156 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
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.

source = $(shell grep "^Source: " debian/control|head -1|sed 's/Source: \(.*\)/\1/g')
version = $(shell grep "^$(source) " debian/changelog|head -1 |sed 's/.*(\(.*\)\-[^\-]*).*/\1/g')
revision = $(shell grep "^$(source) " debian/changelog|head -1 |sed 's/.*([^\-]*\-\(.*\)).*/\1/g')

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

build:
	dh_testdir
	$(MAKE) CC=gcc CFLAGS="-O2 -Wall"
	touch build-stamp

clean: debclean
	rm -f build-stamp 
	if [ -f Makefile ]; then $(MAKE) clean ; fi
	rm -f sc psc scqref
	find . -name '*~' -exec rm {} \;

debclean:
	dh_testdir
	dh_testroot
	# Add here commands to clean up after the build process.
	dh_clean

# Build architecture-independent files here.
binary-indep: build

# Build architecture-dependent files here.
binary-arch: build
	dh_testdir
	dh_testroot
	dh_clean
	dh_installdirs usr/bin usr/lib/sc usr/man/man1
	# Add here commands to install the files into debian/tmp
	$(MAKE) prefix=debian/tmp install
	dh_installdocs
	dh_installchangelogs
	install -m 644 -o root -g root README debian/tmp/usr/doc/sc/readme.txt
	install -m 644 -o root -g root CHANGES debian/tmp/usr/doc/sc/changelog
	dh_strip 
	dh_compress
	cd debian/tmp/usr/man/man1 && ln -s ../man7/undocumented.7.gz scqref.1.gz
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	#dh_makeshlibs
	dh_md5sums
	dh_builddeb

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b' or target dsc; false

dsc:
	-test -d debian/tmp && $(MAKE) -f debian/rules clean
	if [ ! -f ../$(source)_$(version).orig.tar.gz -a -f ../orig/$(source)_$(version).orig.tar.gz ]; \
	then \
	  ln -s orig/$(source)_$(version).orig.tar.gz ../$(source)_$(version).orig.tar.gz; \
	  touch /tmp/stamp-$(source)-link; \
	fi; \
	cd .. && dpkg-source -b $(source)-$(version)
	if [ -f /tmp/stamp-$(source)-link ]; then \
	  rm ../$(source)_$(version).orig.tar.gz /tmp/stamp-$(source)-link; \
	fi

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