File: rules

package info (click to toggle)
sope 5.12.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,588 kB
  • sloc: objc: 169,223; sh: 3,823; ansic: 3,409; javascript: 446; python: 318; makefile: 185
file content (175 lines) | stat: -rwxr-xr-x 5,317 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

CFLAGS = -Wall -g
#WARN: doesn't compile/package if HAS_LIBRARY_* options not present (since we use configure now)
MAKE_FLAGS = messages=yes OPTFLAG=-O2 HAS_LIBRARY_ldap=yes HAS_LIBRARY_pq=yes HAS_LIBRARY_xml2=yes

GNUSTEP_SETUP=/usr/share/GNUstep/Makefiles/GNUstep.sh

include Version
SOPEVER=$(MAJOR_VERSION).$(MINOR_VERSION)

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

controlfiles: controlfiles-stamp debian/control
controlfiles-stamp: debian/rules clean-controlfiles
	for f in debian/*_SOPEVER_*; do \
		newname=$$(echo $$f | sed s/_SOPEVER_/$(SOPEVER)/ ); \
		cp $$f $$newname; \
		echo $$newname >> controlfiles.tmp; \
	done

	mv controlfiles.tmp controlfiles-stamp

clean-controlfiles:
	if [ -f controlfiles-stamp ]; then \
		for f in $$(cat controlfiles-stamp); do \
			rm $$f; \
		done; \
		rm controlfiles-stamp; \
	fi
	if [ -f controlfiles.tmp ]; then \
		for f in $$(cat controlfiles-stamp); do \
			rm $$f; \
		done; \
		rm controlfiles.tmp; \
	fi

debian/control: debian/control.in debian/rules
	sed -e s/_SOPEVER_/$(SOPEVER)/g < debian/control.in > debian/control

config.make:
	dh_testdir
	CFLAGS="$(CFLAGS)" . $(GNUSTEP_SETUP); \
		./configure --with-gnustep --enable-debug --disable-strip

build: config.make build-stamp controlfiles
build-stamp: config.make
	dh_testdir

	-mv sope-core/NGStreams/config.guess sope-core/NGStreams/config.guess.upstream
	-mv sope-core/NGStreams/config.sub sope-core/NGStreams/config.sub.upstream
	ln -s /usr/share/misc/config.guess sope-core/NGStreams/config.guess
	ln -s /usr/share/misc/config.sub sope-core/NGStreams/config.sub

	CFLAGS="$(CFLAGS)" . $(GNUSTEP_SETUP); \
		$(MAKE) $(MAKE_FLAGS) all

#	cp -R sope-appserver/mod_ngobjweb sope-appserver/mod_ngobjweb-apache2

#	CFLAGS="$(CFLAGS)" . $(GNUSTEP_SETUP); \
#		$(MAKE) $(MAKE_FLAGS) APXS=/usr/bin/apxs -C sope-appserver/mod_ngobjweb all

#	CFLAGS="$(CFLAGS)" . $(GNUSTEP_SETUP); \
#		$(MAKE) $(MAKE_FLAGS) APXS="/usr/bin/apxs2" APXS_INCLUDE_DIRS="$(shell apxs2 -q EXTRA_INCLUDES)"\
#		-C sope-appserver/mod_ngobjweb-apache2 all

	touch build-stamp

clean: clean-controlfiles
	dh_testdir
	dh_testroot
	rm -f configure-stamp
	rm -f build-stamp
	rm -f config-NSStreams.log
	rm -rf sope-appserver/mod_ngobjweb-apache2
	rm -rf sope-core/NGStreams/x86_64

	if [ -L sope-core/NGStreams/config.guess ]; then \
		rm sope-core/NGStreams/config.guess; \
	fi
	if [ -L sope-core/NGStreams/config.sub ]; then \
		rm sope-core/NGStreams/config.sub; \
	fi
	if [ -f sope-core/NGStreams/config.guess.upstream ]; then \
		mv sope-core/NGStreams/config.guess.upstream sope-core/NGStreams/config.guess; \
	fi
	if [ -f sope-core/NGStreams/config.sub.upstream ]; then \
		mv sope-core/NGStreams/config.sub.upstream sope-core/NGStreams/config.sub; \
	fi

#	-. $(GNUSTEP_SETUP); $(MAKE) -C sope-appserver/mod_ngobjweb clean
#	-. $(GNUSTEP_SETUP); $(MAKE) -C sope-appserver/mod_ngobjweb distclean

	-. $(GNUSTEP_SETUP); $(MAKE) clean
	-. $(GNUSTEP_SETUP); $(MAKE) distclean

	dh_clean 

install: build
	dh_testdir
	dh_testroot
	dh_clean -k 
	dh_installdirs

#	Add here commands to install the package into debian/tmp
	CFLAGS="$(CFLAGS)" . $(GNUSTEP_SETUP); \
		$(MAKE) $(MAKE_FLAGS) install \
		DESTDIR=$(CURDIR)/debian/tmp GNUSTEP_INSTALLATION_DOMAIN=SYSTEM
#		INSTALL_ROOT_DIR=$(CURDIR)/debian/tmp\
		FHS_INSTALL_ROOT=$(CURDIR)/debian/tmp/usr \
		FHS_LIB_DIR=$(CURDIR)/debian/tmp/usr/lib/ #WARN: <- trailing slash unbroke build/packages?!

#	CFLAGS="$(CFLGAS)" . $(GNUSTEP_SETUP); \
		$(MAKE) $(MAKE_FLAGS) -C sope-appserver/mod_ngobjweb install \
		GNUSTEP_INSTALLATION_DOMAIN=$(CURDIR)/debian/tmp/usr/lib/apache/1.3

#	CFLAGS="$(CFLGAS)" . $(GNUSTEP_SETUP); \
		$(MAKE) $(MAKE_FLAGS) -C sope-appserver/mod_ngobjweb-apache2 install \
		GNUSTEP_INSTALLATION_DOMAIN=$(CURDIR)/debian/tmp/usr/lib/apache2/modules

#	install -m 644 debian/500mod_ngobjweb.info $(CURDIR)/debian/libapache-mod-ngobjweb/usr/lib/apache/1.3
#	install -m 644 debian/ngobjweb.load $(CURDIR)/debian/libapache2-mod-ngobjweb/etc/apache2/mods-available

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs 
	dh_installdocs
	dh_installexamples
	dh_install --sourcedir=debian/tmp
#	dh_installmenu
#	dh_installdebconf	
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_installinit
#	dh_installcron
#	dh_installinfo
	dh_installman
	dh_link
	dh_strip --dbg-package=sope$(SOPEVER)-dbg
	dh_compress
	dh_fixperms
#	dh_perl
#	dh_python
	dh_makeshlibs -V
	dh_installdeb
	dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info -L libsope-appserver$(SOPEVER) -L libsope-xml$(SOPEVER) -L libsope-mime$(SOPEVER) \
		-L libsope-ldap$(SOPEVER) -L libsope-gdl1-$(SOPEVER) \
		-l debian/tmp/usr/lib
	dh_gencontrol
	dh_md5sums
	dh_builddeb -- -Zgzip

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure