summaryrefslogtreecommitdiffstats
path: root/tqtinterface/qt4/debian/rules
blob: 2c48fb42b404d59fa60a380c8536f57d61f9ae63 (plain)
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
#!/usr/bin/make -f

# build variables
export QTDIR=$(shell pwd)

# re-set $(LD_LIBRARY_PATH)
OLD_LD_LIBRARY_PATH := $(LD_LIBRARY_PATH)
export LD_LIBRARY_PATH=$(QTDIR)/lib:$(OLD_LD_LIBRARY_PATH)

# Set tqt root directory
export TQTDIR=$(QTDIR)

# fix path
OLD_PATH := $(PATH)
export PATH=$(QTDIR)/bin:$(OLD_PATH)

DEB_HOST_ARCH		?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_ARCH_CPU	?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)

ifeq ($(DEB_HOST_ARCH_OS),hurd)
	PLATFORM_ARG = hurd-g++
else #hurd
ifeq ($(DEB_HOST_ARCH),sparc)
	PLATFORM_ARG = linux-g++-sparc
else #sparc
	PLATFORM_ARG = linux-g++
endif #sparc
endif #hurd

# quilt stuff
include /usr/share/quilt/quilt.make

# build variables (directorys)
DEBIAN = $(shell pwd)/debian
P_LIBS = $(DEBIAN)/libqt3-mt
P_DOC = $(DEBIAN)/qt3-doc
P_APPSDEV = $(DEBIAN)/qt3-apps-dev
P_HEADERS = $(DEBIAN)/libqt3-headers
P_QTMTDEV = $(DEBIAN)/libqt3-mt-dev

TMP_INSTALL = $(DEBIAN)/tmp-install

CONFIGURE_OPTS = \
		-thread -debug -stl -system-zlib -system-libpng -system-libmng -system-libjpeg -qt-gif -qt-imgfmt-png -qt-imgfmt-jpeg -plugin-imgfmt-mng -prefix /usr 
		# End of CONFIGURE_OPTS

build: libqt-thread-stamp

	touch build-stamp

libqt-thread-stamp: $(QUILT_STAMPFN)

	@echo "QTDIR is ${QTDIR}"

	dh_testdir

	echo yes | ./configure $(CONFIGURE_OPTS)

	# proceed
	$(MAKE) sub-src sub-plugins sub-tools
	$(MAKE) -C src INSTALL_ROOT=$(TMP_INSTALL) install_target
	$(MAKE) INSTALL_ROOT=$(TMP_INSTALL) install
	$(MAKE) INSTALL_ROOT=$(TMP_INSTALL) plugins-install

	touch libqt-thread-stamp

clean: unpatch

	dh_testdir

	-rm -rf debian/patched
	-rm -rf build-stamp libqt-thread-stamp

	-chmod -R u+w *
	-chmod a-x doc/html/layout?.png

	if [ -f "src/Makefile" ]; then \
		$(MAKE) -C src clean; $(MAKE) -C plugins/src distclean; $(MAKE) -C tools distclean; \
		$(MAKE) -C tools/makeqpf distclean; $(MAKE) -C tools/qconfig distclean; $(MAKE) -C tools/qvfb distclean; \
		$(MAKE) -C tools/msg2qm distclean; $(MAKE) -C tools/mergetr distclean; $(MAKE) -C tools/qembed distclean; \
		$(MAKE) -C tools/designer/tools/conv2ui distclean; $(MAKE) -C tools/designer/tools/createcw distclean; \
		$(MAKE) -C tools/designer/plugins/glade distclean; $(MAKE) -C tools/designer/plugins/qglwidget distclean; \
		$(MAKE) -C config.tests/unix/largefile distclean; $(MAKE) -C qmake distclean; \
	fi

	# delete generated Makefiles but save the toplevel Makefile
	-mv Makefile Makefile.save
	for a in `find . -name 'Makefile'`; do rm -f "$$a"; done
	-mv Makefile.save Makefile

	dh_clean

install: build

	dh_testdir
	dh_testroot

	dh_clean -i
	dh_installdirs

	# fix .prl files
	for a in $(TMP_INSTALL)/usr/lib/*prl; do cat "$$a" | sed \
	"s#$(QTDIR)#/usr/share/qt3#g" > "$$a".new && mv "$$a".new "$$a"; done

	dh_install $(IBASE) --sourcedir=$(TMP_INSTALL)

binary-indep: build install

	# Build architecture-independent files here.
	dh_testdir
	dh_testroot

	dh_installchangelogs -i changes-3.4.0

	# proceed
	dh_compress -i -Xhtml/
	dh_link -i

	dh_fixperms -i
	dh_installdeb -i

	dh_perl -i
	dh_shlibdeps -i

	# fix shlibdeps madness
	for a in `find debian/ -name '*.substvars'`; do cat "$$a" | sed 's/, xlibs (>> 4.1.0)//g' > "$$a".new &&  mv "$$a.new" "$$a"; done

	dh_gencontrol -i
	dh_md5sums -i

	dh_builddeb -i

binary-arch: build install

	dh_testdir
	dh_testroot
	dh_installdirs -a

	# run remaining debhelper scripts
	dh_installdocs -a $(IBASE) -XREADME.Debian
	dh_installmenu -a $(IBASE)

	dh_installchangelogs -a $(IBASE) changes-3.4.0

	dh_link -a $(IBASE)
	dh_strip -a $(IBASE) --dbg-package=libtqtinterface-dbg
	dh_compress -a $(IBASE)
	dh_fixperms -a $(IBASE)

	# run remaining debhelper scripts
	dh_makeshlibs -a $(IBASE) -V
	dh_installdeb -a $(IBASE)
	dh_perl -a $(IBASE)
	dh_shlibdeps -a $(IBASE) -l`pwd`/debian/libtqtinterface/usr/lib

	# fix shlibdeps madness
	for a in `find debian/ -name '*.substvars'`; do cat "$$a" | sed 's/, xlibs (>> 4.1.0)//g' > "$$a".new &&  mv "$$a.new" "$$a"; done

	dh_gencontrol -a $(IBASE)
	dh_md5sums -a $(IBASE)
	dh_builddeb -a $(IBASE)

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