File: rules

package info (click to toggle)
pike7 7.0.361-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 14,876 kB
  • ctags: 12,334
  • sloc: ansic: 142,667; makefile: 1,526; sh: 1,035; lisp: 290; sed: 34; perl: 3
file content (170 lines) | stat: -rwxr-xr-x 5,488 bytes parent folder | download
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
#!/usr/bin/make -f

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

VERSION=$(shell dpkg-parsechangelog | grep ^Version | sed -e 's/Version: //;s/-[0-9]*$$//')
OS=$(shell uname -srm|sed -e 's/ /-/g'|tr '[A-Z]' '[a-z]'|tr '/' '_')
BUILDDIR=build/$(OS)
CFARGS=--without-rtldebug \
       --without-cdebug \
       --without-ssleay \
       --with-poll \
       --with-zlib \
       --with-max-fd=65000 \
       --without-postgres \
       --with-freetype \
       --with-sybase

CFLAGS=-O2 -s
#CC=gcc-3.0
# Temporary workaround for hppa linker issues
ifeq ($(DEB_BUILD_ARCH),hppa)
CFLAGS+=-ffunction-sections
endif

export CFLAGS CC

build: build-stamp
build-stamp:
	dh_testdir
	
	touch build-stamp
	$(MAKE) CONFIGUREARGS="--prefix=/usr $(CFARGS)"

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp install-stamp

        # The following line will prevent distclean from failing when
        # it can't delete src/lib/modules
	- if [ -f src/Makefile ]; then mkdir -p src/lib/modules; fi

	- $(MAKE) cvsclean
	- rm -f `find src -name "make_variables" -print`
	- rm -rf `find -name "CVS" -type d -print`
	- rm -f `find -name ".cvsignore" -type f -print`
	- rm -f `find -name "configure" -type f -print`
	- rm -f `find -name "stamp-h.in" -type f -print`
	- rm -f `find -name "config.h.in" -type f -print`
	- mv src/modules/Gmp/gmp_machine.h.in src/modules/Gmp/gmp_machine.h.in.orig
	- rm -f `find -name "*_machine.h.in" -type f -print`
	- mv src/modules/Gmp/gmp_machine.h.in.orig src/modules/Gmp/gmp_machine.h.in
	- rm -f src/language.h src/machine.h.in src/y.output src/post_modules/GL/auto.c
	- rm -f src/modules/sybase/sybase_config.h.in src/language.c \
	        src/modules/system/add-errnos.h
	
	- rm src/modules/Gmp/prime_table src/modules/Gmp/prime_table.out
	- rm src/share src/pike-module src/dumpmodule.log
	- rm src/modules/Perl/perlxsi.c src/modules/Java/module.pmod.in
	- rm src/smartlink src/treeopt.h src/post_modules/GTK/prototypes.h
	- rm src/pike.tmp src/post_modules/GTK/files_to_compile
	- rm src/post_modules/GTK/sources src/case_info.h
	- rm src/post_modules/GTK/options
	- rm src/post_modules/static_module_makefile
	- rm src/post_modules/dynamic_module_makefile
	- rm src/peep_engine.c
	- rm -rf build/
	dh_clean

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

        # Do the installation...
	$(MAKE) buildroot=`pwd`/debian/tmp \
	        prefix=/usr \
		share_prefix=/usr/lib/pike7/$(VERSION) \
		lib_prefix=/usr/lib/pike7/$(VERSION) \
		INSTALLARGS=--traditional install
	mv debian/tmp/usr/bin/pike debian/tmp/usr/bin/pike7
	rm debian/tmp/usr/bin/hilfe
	mv debian/tmp/usr/man debian/tmp/usr/share
	-rm debian/tmp/usr/share/man/man1/hilfe.1
	mv debian/tmp/usr/share/man/man1/pike.1 debian/tmp/usr/share/man/man1/pike7.1
	
	install -d debian/pike7-lobotomized-crypto/usr/lib/pike7/$(VERSION)/modules/Crypto
	cp -pr debian/tmp/usr/lib/pike7/$(VERSION)/modules/Crypto* \
	      debian/pike7-lobotomized-crypto/usr/lib/pike7/$(VERSION)/modules/
	rm -rf debian/tmp/usr/lib/pike7/$(VERSION)/modules/Crypto*
	ln -sf _Lobotomized_Crypto.so debian/pike7-lobotomized-crypto/usr/lib/pike7/$(VERSION)/modules/_Crypto.so
	
	mkdir -p debian/tmp/usr/lib/pike7/$(VERSION)/include ; \
	mv debian/tmp/usr/include/pike \
	   debian/tmp/usr/include/pike7 ; \
	chmod 644 debian/tmp/usr/include/pike7/*
	
        # Remove some files that shouldn't be there...

	-rm -f debian/tmp/usr/lib/pike7/$(VERSION)/master.pike.in
	-rm -f debian/tmp/usr/bin/pike-module
	-rm -rf debian/tmp/usr/lib/pike7/$(VERSION)/tools

        # Fix permissions

	find debian/tmp/usr/lib/pike7 -type f | xargs chmod -x

        # Fix pike location in scripts

	for f in `find debian/tmp/usr/bin -type f` \
                 `find debian/tmp/usr/lib/pike7 -type f`; \
	do \
	  file $$f | grep "script" >/dev/null \
            && perl -pi -e 's@#\!.*NOMODULE@#\!/usr/bin/pike7@' $$f \
	    && chmod a+x $$f; \
	  file $$f | grep "script" >/dev/null \
            && perl -pi -e 's@#\!.*/usr/local/bin/pike@#\!/usr/bin/pike7@' $$f; \
	done; exit 0

        # Remove disabled modules
	-rm debian/tmp/usr/lib/pike7/$(VERSION)/modules/Ssleay.so
	-rm debian/tmp/usr/lib/pike7/$(VERSION)/modules/*Java*
	
	-rm -f debian/tmp/usr/lib/pike7/$(VERSION)/include/postgres.h
	-rm -f debian/tmp/usr/lib/pike7/$(VERSION)/modules/Postgres.so
	-rm -f debian/tmp/usr/lib/pike7/$(VERSION)/modules/Sql.pmod/postgres*
	
        # msql is non-free
	-rm debian/tmp/usr/lib/pike7/$(VERSION)/include/msql.h
	-rm debian/tmp/usr/lib/pike7/$(VERSION)/modules/Msql.so
	-rm debian/tmp/usr/lib/pike7/$(VERSION)/modules/Sql.pmod/msql.pike
	
	dh_movefiles

	touch install-stamp


# 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_testversion
	dh_testdir
#	dh_testroot
	dh_installdocs README ANNOUNCE src/DISCLAIMER src/BUGS
#	dh_installexamples
	pwd
	dh_installman -ppike7 debian/tmp/usr/share/man/man1/pike7.1
#	dh_undocumented pike7.1
	dh_installchangelogs src/ChangeLog
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_makeshlibs
	dh_md5sums
	dh_builddeb

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

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