]> err.no Git - sope/blob - debian/rules
fixed compilation on MacOSX
[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 include Version
18 SOPEVER=$(MAJOR_VERSION).$(MINOR_VERSION)
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 debian/control
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
37         mv controlfiles.tmp controlfiles-stamp
38
39 clean-controlfiles:
40         if [ -f controlfiles-stamp ]; then \
41                 for f in $$(cat controlfiles-stamp); do \
42                         rm $$f; \
43                 done; \
44                 rm controlfiles-stamp; \
45         fi
46         if [ -f controlfiles.tmp ]; then \
47                 for f in $$(cat controlfiles-stamp); do \
48                         rm $$f; \
49                 done; \
50                 rm controlfiles.tmp; \
51         fi
52         
53 debian/control: debian/control.in debian/rules
54         sed -e s/_SOPEVER_/$(SOPEVER)/g < debian/control.in > debian/control
55         
56 build: build-stamp controlfiles
57 build-stamp: patch-stamp
58         dh_testdir
59
60         -mv sope-core/NGStreams/config.guess sope-core/NGStreams/config.guess.upstream
61         -mv sope-core/NGStreams/config.sub sope-core/NGStreams/config.sub.upstream
62         ln -s /usr/share/automake/config.guess sope-core/NGStreams/config.guess
63         ln -s /usr/share/automake/config.sub sope-core/NGStreams/config.sub
64
65         CFLAGS="$(CFLAGS)" . $(GNUSTEP_SETUP); \
66                 $(MAKE) $(MAKE_FLAGS) all
67
68         cp -R sope-appserver/mod_ngobjweb sope-appserver/mod_ngobjweb-apache2
69
70         CFLAGS="$(CFLAGS)" . $(GNUSTEP_SETUP); \
71                 $(MAKE) $(MAKE_FLAGS) APXS=/usr/bin/apxs -C sope-appserver/mod_ngobjweb all
72         
73         CFLAGS="$(CFLAGS)" . $(GNUSTEP_SETUP); \
74                 $(MAKE) $(MAKE_FLAGS) APXS="/usr/bin/apxs2" APXS_INCLUDE_DIRS="$(shell apxs2 -q EXTRA_INCLUDES)"\
75                 -C sope-appserver/mod_ngobjweb-apache2 all
76
77         touch build-stamp
78
79 clean: unpatch clean-controlfiles
80         dh_testdir
81         dh_testroot
82         rm -f configure-stamp
83         rm -f build-stamp
84         rm -rf sope-appserver/mod_ngobjweb-apache2
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
120         CFLAGS="$(CFLGAS)" . $(GNUSTEP_SETUP); \
121                 $(MAKE) $(MAKE_FLAGS) -C sope-appserver/mod_ngobjweb install \
122                 GNUSTEP_INSTALLATION_DIR=$(CURDIR)/debian/tmp/usr/lib/apache/1.3
123
124         CFLAGS="$(CFLGAS)" . $(GNUSTEP_SETUP); \
125                 $(MAKE) $(MAKE_FLAGS) -C sope-appserver/mod_ngobjweb-apache2 install \
126                 GNUSTEP_INSTALLATION_DIR=$(CURDIR)/debian/tmp/usr/lib/apache2/modules
127
128         install -m 644 debian/500mod_ngobjweb.info $(CURDIR)/debian/libapache-mod-ngobjweb/usr/lib/apache/1.3
129         install -m 644 debian/ngobjweb.load $(CURDIR)/debian/libapache2-mod-ngobjweb/etc/apache2/mods-available
130
131 # Build architecture-independent files here.
132 binary-indep: build install
133 # We have nothing to do by default.
134
135 # Build architecture-dependent files here.
136 binary-arch: build install
137         dh_testdir
138         dh_testroot
139         dh_installchangelogs 
140         dh_installdocs
141         dh_installexamples
142         dh_install --sourcedir=debian/tmp
143 #       dh_installmenu
144 #       dh_installdebconf       
145 #       dh_installlogrotate
146 #       dh_installemacsen
147 #       dh_installpam
148 #       dh_installmime
149 #       dh_installinit
150 #       dh_installcron
151 #       dh_installinfo
152         dh_installman
153         dh_link
154         dh_strip
155         dh_compress
156         dh_fixperms
157 #       dh_perl
158 #       dh_python
159         dh_makeshlibs -V
160         dh_installdeb
161         dh_shlibdeps -L libsope-appserver$(SOPEVER) -L libsope-xml$(SOPEVER) -L libsope-mime$(SOPEVER) \
162                 -L libsope-ical$(SOPEVER) -L libsope-ldap$(SOPEVER) -L libsope-gdl1-$(SOPEVER) \
163                 -l debian/tmp/usr/lib
164         dh_gencontrol
165         dh_md5sums
166         dh_builddeb
167
168 binary: binary-indep binary-arch
169 .PHONY: build clean binary-indep binary-arch binary install configure