File: rules

package info (click to toggle)
bsign 0.4.4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 420 kB
  • ctags: 647
  • sloc: cpp: 3,019; ansic: 344; makefile: 294; sh: 219
file content (124 lines) | stat: -rwxr-xr-x 3,238 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/usr/bin/make -f
# debian/rules						-*- Makefile -*-
#   $Id: rules,v 1.10 2002/01/28 01:09:07 elf Exp $
#
# written by Oscar Levi
# 11 December 1998
#
# Copyright 1998 The Buici Company
#
# These rules provide the glue between Debian and this ${package}.
# The interesting target is binary which builds the binary package by
# configuring, compiling, and installing it in the debian/tmp
# directory and then invoking the Debian packaging tools.
# 

package=bsign
base=$(package)
version=`cat .version`
RELEASE_PATH=${HOME}/release

build:
	$(checkdir)
	./configure --prefix=/usr
	$(MAKE) 
# CFLAGS=-O2 LDFLAGS=
	touch build

build-release: build
	$(MAKE) $(package).README

clean:
	$(checkdir)
	-rm -f build
	-$(MAKE) -i distclean || $(MAKE) -f Makefile.in distclean
	-rm -rf debian/tmp debian/*~ debian/files* debian/substvars

binary-indep:	checkroot build
	$(checkdir)
# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

binary-arch:	checkroot build build-release
	$(checkdir)
	-rm -rf debian/tmp
	dh_clean
	dh_installdirs
	$(MAKE) CFLAGS=-O2 LDFLAGS=-s INSTALL='install' \
		prefix=`pwd`/debian/tmp/usr install
	dh_installmenu
	dh_installdocs
	dh_installdeb
	mv bsign-$(version).README debian/tmp/usr/share/doc/$(package)/README
	dh_installchangelogs
	dh_compress
	dh_strip
	dh_shlibdeps
	dh_gencontrol
	dh_fixperms
	dpkg --build debian/tmp .. ;\

define checkdir
	test -f $(package).cxx -a -f debian/rules
endef

.PHONY: source
source: 
	-echo === Building $(version)
	$(checkdir)
	-rm -rf debian/$(package)-$(version)
	-rm -rf _source
	cvs -Q export -rHEAD -d _source $(base)
	mv _source debian/$(package)-$(version)
	dpkg-source -b debian/$(package)-$(version)
	-rm -rf debian/$(package)-$(version)
	mv $(package)_*.dsc _dsc
	echo "" >> _dsc
	gpg -a --clearsign --default-key elf --output $(package)_$(version).dsc _dsc
	rm _dsc
	mv $(package)_*.dsc $(package)_*.tar.gz ..

.PHONY: package
package: 
	$(checkdir)
	-rm -rf debian/package
	mkdir debian/package
	cvs -Q export -rHEAD -d debian/package/$(package)-$(version) $(base)
	cd debian/package/$(package)-$(version) ; dpkg-buildpackage -rsudo
	sudo rm -rf debian/package/$(package)-$(version)

# Perform the final staging before releasing the package to the debian
# servers.  (elf target)

.PHONY: prerelease
prerelease:
	dpkg-genchanges > ../$(package)_$(version).changes.orig
	echo "" >> ../$(package)_$(version).changes.orig
	gpg -a --clearsign --default-key elf  --output ../$(package)_$(version).changes ../$(package)_$(version).changes.orig
	rm ../$(package)_$(version).changes.orig
	if test -d ${RELEASE_PATH} ; then \
	  mv ../$(package)_$(version)* ~/release/debian ;\
	fi

# Perform full release build, binary and source and prerelease so that
# we're ready for upload.  (elf target)

.PHONY: fullrelease fullrelease_clean fullrelease_binary
fullrelease: fullrelease_clean fullrelease_binary source prerelease

fullrelease_clean:
	make distclean

fullrelease_binary:
	fakeroot debian/rules binary

# Below here is fairly generic really

binary:		binary-indep binary-arch

checkroot:
	$(checkdir)
	test root = "`whoami`"

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