3 # Sample debian/rules that uses debhelper.
4 # GNU copyright 1997 to 1999 by Joey Hess.
6 # Uncomment this to turn on verbose mode.
9 # Include dpatch stuff.
10 include /usr/share/dpatch/dpatch.make
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
16 GNUSTEP_SETUP=/usr/lib/opengroupware.org/System/Library/Makefiles/GNUstep.sh
19 SOPEVER=$(MAJOR_VERSION).$(MINOR_VERSION)
21 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
26 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
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)/ ); \
35 echo $$newname >> controlfiles.tmp; \
38 mv controlfiles.tmp controlfiles-stamp
41 if [ -f controlfiles-stamp ]; then \
42 for f in $$(cat controlfiles-stamp); do \
45 rm controlfiles-stamp; \
47 if [ -f controlfiles.tmp ]; then \
48 for f in $$(cat controlfiles-stamp); do \
51 rm controlfiles.tmp; \
54 debian/control: debian/control.in debian/rules
55 sed -e s/_SOPEVER_/$(SOPEVER)/g < debian/control.in > debian/control
57 config.status: configure
59 CFLAGS="$(CFLAGS)" . $(GNUSTEP_SETUP); \
62 build: build-stamp controlfiles
63 build-stamp: patch-stamp
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
71 CFLAGS="$(CFLAGS)" . $(GNUSTEP_SETUP); \
72 $(MAKE) $(MAKE_FLAGS) all
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
80 clean: unpatch clean-controlfiles
86 if [ -l sope-core/NGStreams/config.guess ]; then \
87 rm sope-core/NGStreams/config.guess; \
89 if [ -l sope-core/NGStreams/config.sub ]; then \
90 rm sope-core/NGStreams/config.sub; \
92 if [ -f sope-core/NGStreams/config.guess.upstream ]; then \
93 mv sope-core/NGStreams/config.guess.upstream sope-core/NGStreams/config.guess; \
95 if [ -f sope-core/NGStreams/config.sub.upstream ]; then \
96 mv sope-core/NGStreams/config.sub.upstream sope-core/NGStreams/config.sub; \
99 -. $(GNUSTEP_SETUP); $(MAKE) -C sope-appserver/mod_ngobjweb clean
100 -. $(GNUSTEP_SETUP); $(MAKE) -C sope-appserver/mod_ngobjweb distclean
102 -. $(GNUSTEP_SETUP); $(MAKE) clean
103 -. $(GNUSTEP_SETUP); $(MAKE) distclean
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?!
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
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
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
132 # Build architecture-independent files here.
133 binary-indep: build install
134 # We have nothing to do by default.
136 # Build architecture-dependent files here.
137 binary-arch: build install
143 dh_install --sourcedir=debian/tmp
146 # dh_installlogrotate
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
169 binary: binary-indep binary-arch
170 .PHONY: build clean binary-indep binary-arch binary install configure