File: rules

package info (click to toggle)
buici-clock 0.4.2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 688 kB
  • ctags: 840
  • sloc: cpp: 4,573; makefile: 422; sh: 225; yacc: 175; lex: 127
file content (128 lines) | stat: -rwxr-xr-x 3,344 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
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
125
126
127
128
#!/usr/bin/make -f
# debian/rules						-*- Makefile -*-
#   $Id: rules,v 1.27 2001/09/06 23:11:18 elf Exp $
#
# written by Marc Singer
# 13 October 1998
#
# Copyright 1998 Marc Singer
#
# 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=buici-clock
base=buici
version=`cat .version`
prefix=/usr/X11R6
doc=/usr/share/doc
RELEASE_PATH=${HOME}/release/debian

build:
	$(checkdir)
	./configure --prefix=$(prefix)
	$(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$(prefix) install
	dh_installmenu
	dh_installdocs
	dh_installdeb
	mv $(package)-$(version).README debian/tmp$(doc)/$(package)/README
	dh_installchangelogs
	dh_compress
	dh_strip
	dh_shlibdeps
	dh_gencontrol
	dh_fixperms
#	if test -d ${RELEASE_PATH} ; then \
#	  dpkg --build debian/tmp ${RELEASE_PATH} ;\
#	else \

	  dpkg --build debian/tmp .. ;\

#	fi

define checkdir
	test -f $(base).xbm -a -f debian/rules
endef

.PHONY: source
source: 
	$(checkdir)
	-rm -rf debian/$(package)-$(version)
	-rm -rf _source
	cvs -Q export -rHEAD -d _source $(base)
	mv _source debian/$(package)-$(version)
	cvs -Q export -rHEAD -d _source xo
	mv _source debian/$(package)-$(version)/xo
	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)
	mkdir debian/package
	cvs -Q co -d debian/package/$(package)-$(version) $(base)
	cvs -Q co -d debian/package/$(package)-$(version)/xo xo
	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 \
	  chmod 0644 ../$(package)_$(version)* ;\
	  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: binary source prerelease

# Below here is fairly generic really

binary:		binary-indep binary-arch

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

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