File: rules

package info (click to toggle)
goobox 2.0.0-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,204 kB
  • ctags: 2,288
  • sloc: ansic: 21,658; sh: 9,217; xml: 1,643; cpp: 372; makefile: 358
file content (152 lines) | stat: -rwxr-xr-x 3,790 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#!/usr/bin/make -f

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

include /usr/share/quilt/quilt.make

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

CFLAGS = -Wall -g
 

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

DATE=$(shell date +%Y%m%d)
TMPDIR=/tmp
MANDIR=debian/manpage
SVNNAME=goobox_svn$(DATE)
SVNBDIR=$(TMPDIR)/$(SVNNAME)

svnupstream-checkout:
	# Needs: svn 

	# Getting sources
	cd $(TMPDIR) && \
        svn co svn://svn.gnome.org/svn/goobox/trunk goobox && \
        mv goobox $(SVNBDIR)

	# Mark it
	touch $@

svnupstream: svnupstream-checkout
	# Needs: autoconf automake libtool

	# Bootstrapping
	-cd $(SVNBDIR) && \
        ./autogen.sh && \
        rm -f config.log config.status

	#cd $(SVNBDIR) && \
	#libtoolize -c -f && \
	#aclocal && \
	#autoconf

	# Removing unused files
	-find $(SVNBDIR) -name .svn -exec rm -rf "{}" ";"
	-rm -r $(SVNBDIR)/autom4te.cache/
	-rm -r $(SVNBDIR)/rm *_bak
	
	# Creating tarball
	cd $(SVNBDIR)/.. && \
	tar cfz $(SVNNAME).orig.tar.gz $(SVNNAME)
	mv -i $(SVNBDIR)/../$(SVNNAME).orig.tar.gz ..

	# Remove mark
	rm svnupstream-checkout

config.status: configure
	dh_testdir

	# Configuring package
	#-./autogen.sh
	$(MAKE) -f debian/rules patch
	CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --sysconfdir=/etc --disable-scrollkeeper

build: build-stamp
build-stamp: config.status
	dh_testdir

	# Building package
	$(MAKE)

	touch $@

clean: 
	dh_testdir
	dh_testroot
	rm -f build-stamp 

	# Cleaning package
	cp -p gnome-doc-utils.make gnome-doc-utils.make.save
#-$(MAKE) clean
	[ ! -f Makefile ] || $(MAKE) distclean
	mv -f gnome-doc-utils.make.save gnome-doc-utils.make

ifneq "$(wildcard /usr/share/misc/config.sub)" ""
	cp -f /usr/share/misc/config.sub config.sub
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
	cp -f /usr/share/misc/config.guess config.guess
endif
	$(MAKE) -f debian/rules unpatch
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Installing package
	$(MAKE) install DESTDIR=$(CURDIR)/debian/goobox

	# Installing manpages
	install -d -m 0755 debian/goobox/usr/share/man/man1
	docbook-to-man $(MANDIR)/goobox.en.sgml > debian/goobox/usr/share/man/man1/goobox.1
	install -d -m 0755 debian/goobox/usr/share/man/de/man1
	cd $(MANDIR) && po4a-updatepo -f sgml -m goobox.en.sgml -p goobox.de.po
	cd $(MANDIR) && po4a-translate -k 20 -f sgml -m goobox.en.sgml -p goobox.de.po -a goobox.de.add -l goobox.de.sgml
	# po4a-translate is broken, c.f. #280882
	# cd $(MANDIR) && patch -p0 < goobox.de.sgml.patch
	perl -i -p -e 's#  <refentrytitle>\&dhucpackage;#\&dhucpackage;#ms' $(MANDIR)/goobox.de.sgml
	perl -i -p -e 's#^\s*</refentrytitle>##' $(MANDIR)/goobox.de.sgml
	docbook-to-man $(MANDIR)/goobox.de.sgml > debian/goobox/usr/share/man/de/man1/goobox.1

	# Installing pixmap
	install -D -m 0644 debian/pixmap/goobox.xpm debian/goobox/usr/share/pixmaps/goobox.xpm

	# Moving icon
	install -d -m 0755 debian/goobox/usr/share/icons
	#mv debian/goobox/usr/share/pixmaps/goobox.png debian/goobox/usr/share/icons

binary-indep: build install

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs ChangeLog
	dh_installdocs
	dh_install
	dh_installmenu
	dh_gconf
	dh_icons
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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