Corrected patching behavior
[onis.git] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 # This file was originally written by Joey Hess and Craig Small.
5 # As a special exception, when this file is copied by dh-make into a
6 # dh-make output file, you may use that output file without restriction.
7 # This special exception was added by Craig Small in version 0.37 of dh-make.
8
9 # Uncomment this to turn on verbose mode.
10 #export DH_VERBOSE=1
11
12
13
14
15 CFLAGS = -Wall -g
16
17 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
18         CFLAGS += -O0
19 else
20         CFLAGS += -O2
21 endif
22
23 configure: configure-stamp
24 configure-stamp:
25         dh_testdir
26         # Add here commands to configure the package.
27
28         find . -type d -name '.svn' | xargs rm -rfv
29
30         if [ ! -e patch-stamp ]; then
31                 patch -p1 <contrib/systemwide-patch/systemwide-patch.diff
32                 touch patch-stamp
33         fi
34
35         touch configure-stamp
36
37
38 build: build-stamp
39
40 build-stamp: configure-stamp 
41         dh_testdir
42
43         pod2man -r "$(egrep '^\$VERSION' onis | cut -d \' -f 2)" onis >onis.1
44
45         touch build-stamp
46
47 clean:
48         dh_testdir
49         dh_testroot
50         rm -f build-stamp configure-stamp
51
52         [ -e onis.1 ] && rm -f onis.1
53
54         if [ -e patch-stamp ]; then
55                 patch -p1 -R <contrib/systemwide-patch/systemwide-patch.diff
56                 rm -f patch-stamp
57         fi
58
59         dh_clean 
60
61 install: build
62         dh_testdir
63         dh_testroot
64         dh_clean -k 
65         dh_installdirs
66         # Add here commands to install the package into debian/onis.
67         #$(MAKE) install DESTDIR=$(CURDIR)/debian/onis
68         dh_install onis.conf users.conf etc/onis/
69         dh_install onis usr/bin/
70         dh_install lib/Onis usr/lib/perl5/
71         dh_install lang themes usr/share/onis/
72         dh_install reports/*-theme usr/share/onis/themes/
73         dh_installman onis.1
74
75 # Build architecture-independent files here.
76 binary-indep: build install
77         dh_testdir
78         dh_testroot
79         dh_installchangelogs CHANGELOG
80         dh_installdocs
81         dh_installexamples
82 #       dh_install
83 #       dh_installmenu
84 #       dh_installdebconf       
85 #       dh_installlogrotate
86 #       dh_installemacsen
87 #       dh_installpam
88 #       dh_installmime
89 #       dh_installinit
90 #       dh_installcron
91 #       dh_installinfo
92         dh_installman
93         dh_link
94         dh_strip
95         dh_compress
96         dh_fixperms
97         dh_perl
98 #       dh_python
99 #       dh_makeshlibs
100         dh_installdeb
101         dh_shlibdeps
102         dh_gencontrol
103         dh_md5sums
104         dh_builddeb
105
106 # Build architecture-dependent files here.
107 binary-arch: build install
108 # We have nothing to do by default.
109
110 binary: binary-indep binary-arch
111 .PHONY: build clean binary-indep binary-arch binary install configure