~ubuntu-branches/ubuntu/lucid/openssl/lucid-proposed

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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
#!/usr/bin/make -f
# Sample debian.rules file - for GNU Hello (1.3).
# Copyright 1994,1995 by Ian Jackson.
# I hereby give you perpetual unlimited permission to copy,
# modify and relicense this file, provided that you do not remove
# my name from the file itself.  (I assert my moral right of
# paternity under the Copyright, Designs and Patents Act 1988.)
# This file may have to be extensively modified
#
# Modified to be a prototype for debmake by Christoph Lameter <clameter@debian.org>
SHELL=/bin/bash

package=openssl

# For generating the manpages
export VERSION=$(shell dpkg-parsechangelog | grep '^Version:' | sed -e 's/^.*://' -e 's/-.*//')

# The binary architeture
DEB_HOST_ARCH = $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_ARCH_OS = $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)

DEB_HOST_GNU_TYPE=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
CROSS=CC=$(DEB_HOST_GNU_TYPE)-gcc
MAKE_TEST=:
else
CROSS=CC=$(CC)
MAKE_TEST=make test
endif

CONFARGS  = --prefix=/usr --openssldir=/usr/lib/ssl no-idea no-mdc2 no-rc5 zlib  enable-tlsext no-sslv2
OPT_alpha = ev4 ev5
OPT_i386  = i486 i586 i686/cmov
OPT_sparc = v8 v9
ARCHOPTS  = OPT_$(DEB_HOST_ARCH)
OPTS      = $($(ARCHOPTS))
WANTED_LIBC_VERSION = 2.3.1-10

patch: patch-stamp
patch-stamp:
	QUILT_PATCHES=debian/patches quilt push -a || test $$? = 2
	touch patch-stamp

unpatch:
	QUILT_PATCHES=debian/patches quilt pop -a || test $$? = 2
	rm -rf patch-stamp debian/patched

build: build-stamp
build-stamp: patch-stamp
	dh_testdir
	perl util/perlpath.pl /usr/bin
#	perl util/ssldir.pl /usr/lib/ssl
#	chmod +x debian/libtool
	./Configure no-shared $(CONFARGS) debian-$(DEB_HOST_ARCH)
	make $(CROSS) -f Makefile all
	$(MAKE_TEST)
	mv libcrypto.a libcrypto.static
	mv libssl.a libssl.static
	make -f Makefile clean
	test -z "$(OPTS)" || for opt in $(OPTS); \
	do \
		set -xe; \
		./Configure shared $(CONFARGS) debian-$(DEB_HOST_ARCH)-$$opt; \
		make $(CROSS) -f Makefile all; \
		$(MAKE_TEST); \
		mkdir -p $$opt; \
		mv libcrypto.so* libssl.so* $$opt/; \
		make -f Makefile clean; \
	done
	./Configure shared $(CONFARGS) debian-$(DEB_HOST_ARCH)
	#make $(CROSS) -f Makefile depend
	ln -sf apps/openssl.pod crypto/crypto.pod ssl/ssl.pod doc/
#	make $(CROSS) -f Makefile linux-shared
	make $(CROSS) -f Makefile all
	$(MAKE_TEST)
#	strip apps/openssl
#	make -f Makefile clean
#	./Configure --prefix=/usr --openssldir=/usr/lib/ssl no-idea no-mdc2 no-rc5 debian-$(DEB_HOST_ARCH)
#	make $(CROSS) -f Makefile all
	touch build

clean: clean-patched unpatch
clean-patched: patch-stamp
	dh_testdir
	dh_testroot
	dh_clean
	-rm -f build
	-perl util/perlpath.pl /usr/bin
	-./Configure $(CONFARGS) debian-$(DEB_HOST_ARCH)
	[ ! -f Makefile ] || make -f Makefile  clean clean-shared
	#-make -f Makefile  dclean
	-perl util/perlpath.pl /usr/local/bin/perl
#	perl util/ssldir.pl /usr/local/ssl
	-rm -f test/.rnd test/testkey.pem test/testreq.pem test/certCA.srl
	-rm -f util/mk1mf.bak Makefile.bak `find . -name Makefile.save` 
	-rm -f crypto/pem/ctx_size
	-rm -f `find . -name "*~"`
	-rm -f `find . -name "*.orig" -o -name "*.rej"`
	-rm -f certs/*.0 certs/*.1
#	-rm -rf debian/tmp debian/files* core `find debian/* -type d`
	-rm -rf core $(OPTS)
	-rm doc/*.pod
	-rm -f libcrypto.* libssl.*
	-cd test && rm -f .rnd tmp.bntest tmp.bctest *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff bntest ectest  ecdsatest ecdhtest ideatest md2test  md4test md5test hmactest rc2test rc4test rc5test destest shatest sha1test sha256t sha512t mdc2test rmdtest randtest dhtest enginetest bftest casttest ssltest exptest dsatest rsa_test evp_test *.ss *.srl log dummytest newkey.pem igetest

binary-indep:	build
	dh_testdir
	dh_testroot
# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

binary-arch:	build
	dh_testdir
	dh_testroot
	dh_clean
#	-rm -rf debian/tmp `find debian/* -type d`
	install -d debian/tmp debian/libssl0.9.8 debian/libssl-dev
#	cd debian/tmp && install -d `cat ../dirs`
#	cd debian/libssl09 && install -d `cat ../libssl09.dirs`
#	cd debian/libssl09-dev && install -d `cat ../libssl09-dev.dirs`
	dh_installdirs
#openssl install
	make -f Makefile  install INSTALL_PREFIX=`pwd`/debian/tmp
#	rm debian/tmp/usr/share/man/man1/openssl.1
#	rm debian/tmp/usr/share/man/man3/crypto.3
#	rm debian/tmp/usr/share/man/man3/ssl.3
#	rm debian/tmp/usr/lib/libcrypto.a
#	rm debian/tmp/usr/lib/libssl.a
	# pic static libraries, nobody should need them
#	mv debian/tmp/usr/lib/libcrypto.a debian/tmp/usr/lib/libcrypto_pic.a
#	mv debian/tmp/usr/lib/libssl.a debian/tmp/usr/lib/libssl_pic.a
	cp -pf libcrypto.static debian/tmp/usr/lib/libcrypto.a
	cp -pf libssl.static debian/tmp/usr/lib/libssl.a
#	mv debian/tmp/usr/lib/ssl/bin debian/tmp/usr/bin/ssl
#	(cd debian/tmp/usr/lib/ssl; ln -s /usr/bin/ssl bin)
#	mv debian/tmp/usr/lib/ssl/include debian/tmp/usr/include/ssl
#	(cd debian/tmp/usr/lib/ssl; ln -s /usr/include/ssl include)
#	chmod -x debian/tmp/usr/lib/*.so.*
#	mv debian/tmp/usr/lib/*.a debian/libssl09-dev/usr/lib/
#	mv debian/tmp/usr/lib/*.so debian/libssl09-dev/usr/lib/
#	mv debian/tmp/usr/lib/*.so.*.*.* debian/libssl09/usr/lib/
#	mv debian/tmp/usr/lib/*.la debian/libssl09-dev/usr/lib/
#	mv debian/tmp/usr/include debian/libssl09-dev/usr/
	# move runtime libraries to /lib
	install -d debian/tmp/lib
	mv debian/tmp/usr/lib/lib*.so.* debian/tmp/lib/
	ln -sf /lib/$$(readlink debian/tmp/usr/lib/libcrypto.so) debian/tmp/usr/lib/libcrypto.so
	ln -sf /lib/$$(readlink debian/tmp/usr/lib/libssl.so) debian/tmp/usr/lib/libssl.so
ifneq ($(DEB_HOST_ARCH_OS),hurd)
	# leave symlinks behind due to rpath in old versions
	for x in debian/tmp/lib/lib*.so.*; do ln -s /lib/$$(basename $$x) debian/tmp/usr/lib/$$(basename $$x); done
endif
	mkdir -p debian/tmp/etc/ssl
	mv debian/tmp/usr/lib/ssl/{certs,openssl.cnf,private} debian/tmp/etc/ssl/
	ln -s /etc/ssl/{certs,openssl.cnf,private} debian/tmp/usr/lib/ssl/
	cp -pf debian/tmp/lib/libcrypto.so.* debian/libcrypto0.9.8-udeb/lib/
	cp -pf debian/tmp/lib/libssl.so.* debian/libssl0.9.8-udeb/lib/
	for opt in $(OPTS); do set -xe; mkdir -p debian/tmp/lib/$$opt; cp -auv $$opt/lib*.so* debian/tmp/lib/$$opt/; done
	install debian/copyright debian/libssl0.9.8/usr/share/doc/libssl0.9.8/
	install debian/changelog debian/libssl0.9.8/usr/share/doc/libssl0.9.8/changelog.Debian
	install debian/copyright debian/libssl-dev/usr/share/doc/libssl-dev/
	install debian/changelog debian/libssl-dev/usr/share/doc/libssl-dev/changelog.Debian
#	(cd debian/tmp/usr/doc/openssl/doc; for f in *.doc*; do mv "$$f" "$$(echo $$f | sed -e 's/doc/txt/')";done)
#	(cd doc; for f in *; do install "$$f" ../debian/tmp/usr/share/doc/openssl/doc/"$$(echo $$f | sed -e 's/doc/txt/')";done)
#	debstd -u CHANGES* LICENSE README NEWS

	dh_installdocs CHANGES.SSLeay README NEWS debian/README.optimization
	dh_installexamples
	dh_installchangelogs CHANGES
#	dh_installmenu
#	dh_installcron
	dh_installman -popenssl
	dh_installdebconf
#	dh_undocumented c_rehash.1
	dh_movefiles
#	rmdir debian/tmp/usr/lib/ssl/lib
#	rmdir debian/tmp/usr/include/openssl
#	rmdir debian/tmp/usr/include
#	for opt in $(OPTS); do set -xe; rm -fr debian/tmp/lib/$$opt; done
	dh_compress
# symlink doc files
	for p in openssl libssl-dev; do \
	  for f in changelog.Debian.gz changelog.gz copyright; do \
	    ln -sf ../libssl0.9.8/$$f debian/$$p/usr/share/doc/$$p/$$f; \
	  done; \
	done
	chmod 700 debian/openssl/etc/ssl/private
	dh_fixperms -X etc/ssl/private
	dh_strip --dbg-package=libssl0.9.8
	dh_perl -d
#	dh_suidregister
	dh_makeshlibs -V "libssl0.9.8 (>= 0.9.8k-1)" --add-udeb="libcrypto0.9.8-udeb"
	sed -i '/^udeb: libssl/s/libcrypto0.9.8-udeb/libssl0.9.8-udeb/' debian/libssl0.9.8/DEBIAN/shlibs
	dh_shlibdeps -L libssl0.9.8 -l debian/libssl0.9.8/lib
	dh_gencontrol
	dh_installdeb
	dh_md5sums
	dh_builddeb
	echo -en "\a"

# Below here is fairly generic really

binary:		binary-indep binary-arch

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

.PHONY: binary binary-arch binary-indep clean patch