summaryrefslogtreecommitdiff
path: root/debian/rules
blob: cdf3dfa5e4225ce7c08b9df3d2b877add374f6c3 (plain)
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
#!/usr/bin/make -f
# -*- makefile -*-

# Order of patches is important. Hideous, huh?

debian_patches =

export DH_COMPAT=3

build: build-stamp
build-stamp: config-stamp
	dh_testdir
	$(MAKE) -j 2
	touch build-stamp

clean: reverse-patches
	dh_testdir
	dh_testroot
	dh_clean *-stamp debian/shlibs.local \
	xml-i18n-extract xml-i18n-merge xml-i18n-update

	[ ! -f Makefile ] || $(MAKE) distclean

config: config-stamp
config-stamp: patched-stamp
	dh_testdir

	srcdir=`pwd` PKG_NAME="gnome-control-center" ./autogen.sh \
	--prefix=/usr --localstatedir=/var/lib --sysconfdir=/etc \
	--mandir=/usr/share/man --datadir=/usr/share

	touch config-stamp

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_installdirs
	$(MAKE) install DESTDIR=`pwd`/debian/gnome-control-center

	touch install-stamp

arrange: arrange-stamp
arrange-stamp: install-stamp
	dh_movefiles --sourcedir=debian/gnome-control-center

# Prune empty directories
	-find debian -type d | sort -r | xargs rmdir --ignore-fail-on-non-empty
	touch arrange-stamp

#	mv debian/gnome-control-center/usr/share/control-center/capplets/Gnome.directory \
#	debian/gnome-control-center/usr/share/control-center/capplets/.directory

binary: binary-stamp
binary-stamp: binary-arch-stamp binary-indep-stamp

binary-arch-stamp: binary-arch
binary-arch: arrange-stamp
	dh_testdir
	dh_testroot
	dh_installdocs
#	dh_installexamples
	dh_installmenu
#	dh_installemacsen
#	dh_installinit
#	dh_installcron
#	dh_installman
	dh_undocumented
	dh_installchangelogs ChangeLog
	rm -rf debian/libconfig-archiver-dev/usr/share/doc/libconfig-archiver-dev
	dh_strip
	dh_link
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_makeshlibs -V 'libconfig-archiver0 (>= 1:1.5.2)'
	dh_shlibdeps -ldebian/libconfig-archiver0/usr/lib
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-indep-stamp: binary-indep
binary-indep: arrange-stamp
	dh_testdir

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

# ---------------------------------------------------------------------------
# various rules to unpack addons and (un)apply patches.
# borrowed from egcs package

patch_dir	= debian/patches

apply-patches: patched-stamp
reverse-patches:
	@for stamp in none patched-*; do \
	  case "$$stamp" in none|patched-stamp|patched-\*) continue; esac; \
	  patch=`echo $$stamp | sed -e 's/patched-//'`; \
	  echo "trying to revert patch $$patch ..."; \
	  if [ -x $(patch_dir)/$$patch.dpatch ]; then true; else \
	    chmod +x $(patch_dir)/$$patch.dpatch; fi; \
	  if $(patch_dir)/$$patch.dpatch -unpatch; then \
	    echo "reverted $$patch patch."; \
	    rm -f $$stamp; \
	  else \
	    echo "error in reverting $$patch patch."; \
	    exit 1; \
	  fi; \
	done
	rm -f patched-stamp

patched-%: $(patch_dir)/%.dpatch
	@if [ -x $< ]; then true; else chmod +x $<; fi
	@if [ -f $@ ]; then \
	  echo "$* patches already applied."; exit 1; \
	fi
	$< -patch
	@echo "$* patches applied." > $@

patched-stamp: $(foreach p,$(debian_patches),patched-$(p))
	@echo -e "\nPatches applied:" >> pxxx
	@for i in none $(debian_patches); do \
	  if [ -r debian/patches/$$i.dpatch ]; then \
	    echo -e "\n$$i:" >> pxxx; \
	    sed -n 's/^# *DP: */  /p' debian/patches/$$i.dpatch >> pxxx; \
	  fi \
	done
	mv -f pxxx patched-stamp