]> err.no Git - sope/blob - debian/rules
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@181 e4a50df8-12e2-0310-a44c-efbce...
[sope] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 # GNU copyright 1997 to 1999 by Joey Hess.
5
6 # Uncomment this to turn on verbose mode.
7 #export DH_VERBOSE=1
8
9 # Include dpatch stuff.
10 include /usr/share/dpatch/dpatch.make
11
12 CFLAGS = -Wall -g
13 MAKE_FLAGS = messages=yes OPTFLAG=-O0
14
15 GNUSTEP_SETUP=/usr/lib/opengroupware.org/System/Library/Makefiles/GNUstep.sh
16
17 SOPEVER=4.3
18 GNUSTEPDBVER=1.1
19
20 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
21         CFLAGS += -O0
22 else
23         CFLAGS += -O2
24 endif
25 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
26         INSTALL_PROGRAM += -s
27 endif
28
29 controlfiles: controlfiles-stamp
30 controlfiles-stamp: debian/rules clean-controlfiles
31         for f in debian/*_SOPEVER_*; do \
32                 newname=$$(echo $$f | sed s/_SOPEVER_/$(SOPEVER)/ ); \
33                 cp $$f $$newname; \
34                 echo $$newname >> controlfiles.tmp; \
35         done
36         for f in debian/*_GNUSTEPDBVER_*; do \
37                 newname=$$(echo $$f | sed s/_GNUSTEPDBVER_/$(GNUSTEPDBVER)/ ); \
38                 cp $$f $$newname; \
39                 echo $$newname >> controlfiles.tmp; \
40         done
41
42         mv controlfiles.tmp controlfiles-stamp
43
44 clean-controlfiles:
45         if [ -f controlfiles-stamp ]; then \
46                 for f in $$(cat controlfiles-stamp); do \
47                         rm $$f; \
48                 done; \
49                 rm controlfiles-stamp; \
50         fi
51         if [ -f controlfiles.tmp ]; then \
52                 for f in $$(cat controlfiles-stamp); do \
53                         rm $$f; \
54                 done; \
55                 rm controlfiles.tmp; \
56         fi
57         
58 debian/control: debian/control.in debian/rules
59         sed -e s/_SOPEVER_/$(SOPEVER)/g -e s/_GNUSTEPDBVER_/$(GNUSTEPDBVER)/g < debian/control.in > debian/control
60         
61 build: build-stamp debian/control controlfiles
62 build-stamp: patch-stamp
63         dh_testdir
64
65         -mv sope-core/NGStreams/config.guess sope-core/NGStreams/config.guess.upstream
66         -mv sope-core/NGStreams/config.sub sope-core/NGStreams/config.sub.upstream
67         ln -s /usr/share/automake/config.guess sope-core/NGStreams/config.guess
68         ln -s /usr/share/automake/config.sub sope-core/NGStreams/config.sub
69
70         CFLAGS="$(CFLAGS)" . $(GNUSTEP_SETUP); \
71                 $(MAKE) $(MAKE_FLAGS) all
72
73         CFLAGS="$(CFLGAS)" . $(GNUSTEP_SETUP); \
74                 $(MAKE) $(MAKE_FLAGS) -C sope-appserver/mod_ngobjweb all
75
76         touch build-stamp
77
78 clean: unpatch clean-controlfiles
79         dh_testdir
80         dh_testroot
81         rm -f configure-stamp
82         rm -f build-stamp
83
84         -rm sope-core/NGStreams/config.guess
85         -rm sope-core/NGStreams/config.sub
86         -mv sope-core/NGStreams/config.guess.upstream sope-core/NGStreams/config.guess
87         -mv sope-core/NGStreams/config.sub.upstream sope-core/NGStreams/config.sub
88
89         -. $(GNUSTEP_SETUP); $(MAKE) -C sope-appserver/mod_ngobjweb clean
90         -. $(GNUSTEP_SETUP); $(MAKE) -C sope-appserver/mod_ngobjweb distclean
91
92         -. $(GNUSTEP_SETUP); $(MAKE) clean
93         -. $(GNUSTEP_SETUP); $(MAKE) distclean
94
95         dh_clean 
96
97 install: build
98         dh_testdir
99         dh_testroot
100         dh_clean -k 
101         dh_installdirs
102
103         # Add here commands to install the package into debian/tmp
104         CFLAGS="$(CFLAGS)" . $(GNUSTEP_SETUP); \
105                 $(MAKE) $(MAKE_FLAGS) install \
106                 GNUSTEP_INSTALLATION_DIR=$(CURDIR)/debian/tmp/$$GNUSTEP_SYSTEM_ROOT\
107                 INSTALL_ROOT_DIR=$(CURDIR)/debian/tmp\
108                 FHS_INSTALL_ROOT=$(CURDIR)/debian/tmp/usr
109
110         CFLAGS="$(CFLGAS)" . $(GNUSTEP_SETUP); \
111                 $(MAKE) $(MAKE_FLAGS) -C sope-appserver/mod_ngobjweb install \
112                 GNUSTEP_INSTALLATION_DIR=$(CURDIR)/debian/tmp/usr/lib/apache/1.3
113
114         install -m 644 debian/500mod_ngobjweb.info $(CURDIR)/debian/libapache-mod-ngobjweb/usr/lib/apache/1.3
115         install -m 644 debian/mod_ngobjweb.conf $(CURDIR)/debian/libapache-mod-ngobjweb/usr/share/opengroupware.org/mod_ngobjweb
116
117 # Build architecture-independent files here.
118 binary-indep: build install
119 # We have nothing to do by default.
120
121 # Build architecture-dependent files here.
122 binary-arch: build install
123         dh_testdir
124         dh_testroot
125         dh_installchangelogs 
126         dh_installdocs
127         dh_installexamples
128         dh_install --sourcedir=debian/tmp
129 #       dh_installmenu
130 #       dh_installdebconf       
131 #       dh_installlogrotate
132 #       dh_installemacsen
133 #       dh_installpam
134 #       dh_installmime
135 #       dh_installinit
136 #       dh_installcron
137 #       dh_installinfo
138         dh_installman
139         dh_link
140         dh_strip
141         dh_compress
142         dh_fixperms
143 #       dh_perl
144 #       dh_python
145         dh_makeshlibs -V
146         dh_installdeb
147         dh_shlibdeps -L libsope-appserver$(SOPEVER) -L libsope-xml$(SOPEVER) -L libsope-mime$(SOPEVER) \
148                 -L libsope-ical$(SOPEVER) -L libsope-ldap$(SOPEVER) -L libsope-gnustep-db$(GNUSTEPDBVER) \
149                 -l debian/tmp/usr/lib
150         dh_gencontrol
151         dh_md5sums
152         dh_builddeb
153
154 binary: binary-indep binary-arch
155 .PHONY: build clean binary-indep binary-arch binary install configure