]> err.no Git - sope/blob - debian/rules
41a05e1f8668e8c41bd790b89745e65a5bd4af79
[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 #WARN: doesn't compile/package if HAS_LIBRARY_* options not present (since we use configure now)
14 MAKE_FLAGS = messages=yes OPTFLAG=-O0 HAS_LIBRARY_ldap=yes HAS_LIBRARY_pq=yes HAS_LIBRARY_xml2=yes
15
16 GNUSTEP_SETUP=/usr/lib/opengroupware.org/System/Library/Makefiles/GNUstep.sh
17
18 include Version
19 SOPEVER=$(MAJOR_VERSION).$(MINOR_VERSION)
20
21 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
22         CFLAGS += -O0
23 else
24         CFLAGS += -O2
25 endif
26 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
27         INSTALL_PROGRAM += -s
28 endif
29
30 controlfiles: controlfiles-stamp debian/control
31 controlfiles-stamp: debian/rules clean-controlfiles
32         for f in debian/*_SOPEVER_*; do \
33                 newname=$$(echo $$f | sed s/_SOPEVER_/$(SOPEVER)/ ); \
34                 cp $$f $$newname; \
35                 echo $$newname >> controlfiles.tmp; \
36         done
37
38         mv controlfiles.tmp controlfiles-stamp
39
40 clean-controlfiles:
41         if [ -f controlfiles-stamp ]; then \
42                 for f in $$(cat controlfiles-stamp); do \
43                         rm $$f; \
44                 done; \
45                 rm controlfiles-stamp; \
46         fi
47         if [ -f controlfiles.tmp ]; then \
48                 for f in $$(cat controlfiles-stamp); do \
49                         rm $$f; \
50                 done; \
51                 rm controlfiles.tmp; \
52         fi
53         
54 debian/control: debian/control.in debian/rules
55         sed -e s/_SOPEVER_/$(SOPEVER)/g < debian/control.in > debian/control
56
57 config.status: configure
58         dh_testdir
59         CFLAGS="$(CFLAGS)" . $(GNUSTEP_SETUP); \
60                 ./configure
61         
62 build: build-stamp controlfiles
63 build-stamp: patch-stamp
64         dh_testdir
65
66         -mv sope-core/NGStreams/config.guess sope-core/NGStreams/config.guess.upstream
67         -mv sope-core/NGStreams/config.sub sope-core/NGStreams/config.sub.upstream
68         ln -s /usr/share/misc/config.guess sope-core/NGStreams/config.guess
69         ln -s /usr/share/misc/config.sub sope-core/NGStreams/config.sub
70
71         CFLAGS="$(CFLAGS)" . $(GNUSTEP_SETUP); \
72                 $(MAKE) $(MAKE_FLAGS) all
73
74         CFLAGS="$(CFLAGS)" . $(GNUSTEP_SETUP); \
75                 $(MAKE) $(MAKE_FLAGS) APXS="/usr/bin/apxs2" APXS_INCLUDE_DIRS="$(shell apxs2 -q EXTRA_INCLUDES)" \
76                 -C sope-appserver/mod_ngobjweb all
77         
78         touch build-stamp
79
80 clean: unpatch clean-controlfiles
81         dh_testdir
82         dh_testroot
83         rm -f configure-stamp
84         rm -f build-stamp
85
86         if [ -l sope-core/NGStreams/config.guess ]; then \
87                 rm sope-core/NGStreams/config.guess; \
88         fi
89         if [ -l sope-core/NGStreams/config.sub ]; then \
90                 rm sope-core/NGStreams/config.sub; \
91         fi
92         if [ -f sope-core/NGStreams/config.guess.upstream ]; then \
93                 mv sope-core/NGStreams/config.guess.upstream sope-core/NGStreams/config.guess; \
94         fi
95         if [ -f sope-core/NGStreams/config.sub.upstream ]; then \
96                 mv sope-core/NGStreams/config.sub.upstream sope-core/NGStreams/config.sub; \
97         fi
98
99         -. $(GNUSTEP_SETUP); $(MAKE) -C sope-appserver/mod_ngobjweb clean
100         -. $(GNUSTEP_SETUP); $(MAKE) -C sope-appserver/mod_ngobjweb distclean
101
102         -. $(GNUSTEP_SETUP); $(MAKE) clean
103         -. $(GNUSTEP_SETUP); $(MAKE) distclean
104
105         dh_clean 
106
107 install: build
108         dh_testdir
109         dh_testroot
110         dh_clean -k 
111         dh_installdirs
112
113         # Add here commands to install the package into debian/tmp
114         CFLAGS="$(CFLAGS)" . $(GNUSTEP_SETUP); \
115                 $(MAKE) $(MAKE_FLAGS) install \
116                 GNUSTEP_INSTALLATION_DIR=$(CURDIR)/debian/tmp/$$GNUSTEP_SYSTEM_ROOT\
117                 INSTALL_ROOT_DIR=$(CURDIR)/debian/tmp\
118                 FHS_INSTALL_ROOT=$(CURDIR)/debian/tmp/usr \
119                 FHS_LIB_DIR=$(CURDIR)/debian/tmp/usr/lib/ #WARN: <- trailing slash unbroke build/packages?!
120
121         CFLAGS="$(CFLGAS)" . $(GNUSTEP_SETUP); \
122                 $(MAKE) $(MAKE_FLAGS) -C sope-appserver/mod_ngobjweb install \
123                 GNUSTEP_INSTALLATION_DIR=$(CURDIR)/debian/tmp/usr/lib/apache/1.3
124
125         CFLAGS="$(CFLGAS)" . $(GNUSTEP_SETUP); \
126                 $(MAKE) $(MAKE_FLAGS) -C sope-appserver/mod_ngobjweb-apache2 install \
127                 GNUSTEP_INSTALLATION_DIR=$(CURDIR)/debian/tmp/usr/lib/apache2/modules
128
129         install -m 644 debian/500mod_ngobjweb.info $(CURDIR)/debian/libapache-mod-ngobjweb/usr/lib/apache/1.3
130         install -m 644 debian/ngobjweb.load $(CURDIR)/debian/libapache2-mod-ngobjweb/etc/apache2/mods-available
131
132 # Build architecture-independent files here.
133 binary-indep: build install
134 # We have nothing to do by default.
135
136 # Build architecture-dependent files here.
137 binary-arch: build install
138         dh_testdir
139         dh_testroot
140         dh_installchangelogs 
141         dh_installdocs
142         dh_installexamples
143         dh_install --sourcedir=debian/tmp
144 #       dh_installmenu
145 #       dh_installdebconf       
146 #       dh_installlogrotate
147 #       dh_installemacsen
148 #       dh_installpam
149 #       dh_installmime
150 #       dh_installinit
151 #       dh_installcron
152 #       dh_installinfo
153         dh_installman
154         dh_link
155         dh_strip
156         dh_compress
157         dh_fixperms
158 #       dh_perl
159 #       dh_python
160         dh_makeshlibs -V
161         dh_installdeb
162         dh_shlibdeps -L libsope-appserver$(SOPEVER) -L libsope-xml$(SOPEVER) -L libsope-mime$(SOPEVER) \
163                 -L libsope-ical$(SOPEVER) -L libsope-ldap$(SOPEVER) -L libsope-gdl1-$(SOPEVER) \
164                 -l debian/tmp/usr/lib
165         dh_gencontrol
166         dh_md5sums
167         dh_builddeb
168
169 binary: binary-indep binary-arch
170 .PHONY: build clean binary-indep binary-arch binary install configure