~ubuntu-branches/ubuntu/natty/liblocale-gettext-perl/natty

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Raphael Hertzog
  • Date: 2003-04-18 16:21:03 UTC
  • Revision ID: james.westby@ubuntu.com-20030418162103-x11u3hm051x68wcn
Tags: 1.01-17
* Corrected typo in man page. Closes: #175421
* Updated section and priority (perl and standard respectively).
* Conform to policy 3.5.9.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
 
3
# Some lines taken from debmake, by Cristoph Lameter.
 
4
 
 
5
# Uncomment this to turn on verbose mode.
 
6
#export DH_VERBOSE=1
 
7
 
 
8
debian_patches = libintl.h morefunctions doc-update
 
9
 
 
10
export DH_COMPAT=4
 
11
 
 
12
TMP = `pwd`/debian/liblocale-gettext-perl
 
13
 
 
14
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
 
15
  CFLAGS = -g
 
16
endif
 
17
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
 
18
CFLAGS += -O0
 
19
else
 
20
CFLAGS += -O2
 
21
endif  
 
22
 
 
23
build: build-stamp
 
24
build-stamp: patched-stamp
 
25
        dh_testdir
 
26
 
 
27
        
 
28
        # Add here commands to compile the package.
 
29
        perl Makefile.PL INSTALLDIRS=vendor 
 
30
        $(MAKE) OPTIMIZE="-Wall $(CFLAGS)"
 
31
 
 
32
        touch build-stamp
 
33
 
 
34
clean:
 
35
        dh_testdir
 
36
        dh_testroot
 
37
        rm -f build-stamp install-stamp
 
38
 
 
39
        # Add here commands to clean up after the build process.
 
40
        -$(MAKE) distclean
 
41
 
 
42
        dh_clean
 
43
        debian/rules reverse-patches
 
44
 
 
45
install: install-stamp
 
46
install-stamp: build-stamp
 
47
        dh_testdir
 
48
        dh_testroot
 
49
        dh_clean -k
 
50
        dh_installdirs
 
51
 
 
52
        # Add here commands to install the package into debian/tmp.
 
53
        $(MAKE) install PREFIX=$(TMP)/usr
 
54
 
 
55
 
 
56
        touch install-stamp
 
57
 
 
58
# Build architecture-independent files here.
 
59
binary-indep: build install
 
60
# We have nothing to do by default.
 
61
 
 
62
# Build architecture-dependent files here.
 
63
binary-arch: build install
 
64
#       dh_testversion
 
65
        dh_testdir
 
66
        dh_testroot
 
67
        dh_installdocs
 
68
        dh_installexamples
 
69
        dh_installmenu
 
70
#       dh_installemacsen
 
71
#       dh_installinit
 
72
        dh_installcron
 
73
        dh_installmanpages
 
74
#       dh_undocumented
 
75
        dh_installchangelogs 
 
76
        dh_strip 
 
77
        dh_compress
 
78
        dh_fixperms
 
79
        dh_installdeb
 
80
        dh_perl -d
 
81
        dh_shlibdeps
 
82
        dh_gencontrol
 
83
#       dh_makeshlibs
 
84
        dh_md5sums
 
85
        dh_builddeb
 
86
 
 
87
source diff:                                                                  
 
88
        @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
 
89
 
 
90
binary: binary-indep binary-arch
 
91
.PHONY: build clean binary-indep binary-arch binary
 
92
 
 
93
# ---------------------------------------------------------------------------
 
94
# various rules to unpack addons and (un)apply patches.
 
95
# borrowed from egcs package
 
96
 
 
97
patch_dir       = debian/patches
 
98
 
 
99
apply-patches: patched-stamp
 
100
reverse-patches:
 
101
        @for stamp in none patched-*; do \
 
102
          case "$$stamp" in none|patched-stamp|patched-\*) continue; esac; \
 
103
          patch=`echo $$stamp | sed -e 's/patched-//'`; \
 
104
          echo "trying to revert patch $$patch ..."; \
 
105
          if [ -x $(patch_dir)/$$patch.dpatch ]; then true; else \
 
106
            chmod +x $(patch_dir)/$$patch.dpatch; fi; \
 
107
          if $(patch_dir)/$$patch.dpatch -unpatch; then \
 
108
            echo "reverted $$patch patch."; \
 
109
            rm -f $$stamp; \
 
110
          else \
 
111
            echo "error in reverting $$patch patch."; \
 
112
            exit 1; \
 
113
          fi; \
 
114
        done
 
115
        rm -f patched-stamp
 
116
 
 
117
patched-%: $(patch_dir)/%.dpatch
 
118
        @if [ -x $< ]; then true; else chmod +x $<; fi
 
119
        @if [ -f $@ ]; then \
 
120
          echo "$* patches already applied."; exit 1; \
 
121
        fi
 
122
        $< -patch
 
123
        @echo "$* patches applied." > $@
 
124
 
 
125
patched-stamp: $(foreach p,$(debian_patches),patched-$(p))
 
126
        @echo -e "\nPatches applied:" >> pxxx
 
127
        @for i in none $(debian_patches); do \
 
128
          if [ -r debian/patches/$$i.dpatch ]; then \
 
129
            echo -e "\n$$i:" >> pxxx; \
 
130
            sed -n 's/^# *DP: */  /p' debian/patches/$$i.dpatch >> pxxx; \
 
131
          fi \
 
132
        done
 
133
        mv -f pxxx patched-stamp
 
134