Subversion Repositories

?revision_form?Rev ?revision_input??revision_submit??revision_endform?

Rev 8 | Rev 13 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8 Rev 9
1
#!/usr/bin/make -f
1
#!/usr/bin/make -f
2
# debian/rules file for libraries
2
# debian/rules file for libraries
3
#
3
#
4
# To build the packages, run `dpkg-buildpackage' or `debuild' from the
4
# To build the packages, run `dpkg-buildpackage' or `debuild' from the
5
# parent directory of this file. (You may need to specify the `-rfakeroot'
5
# parent directory of this file. (You may need to specify the `-rfakeroot'
6
# option if you are using dpkg-buildpackage and are not running as root)
6
# option if you are using dpkg-buildpackage and are not running as root)
7
#
7
#
8
# $Id: rules,v 1.8 2003/04/30 07:45:50 timshel Exp $
8
# $Id: rules,v 1.8 2003/04/30 07:45:50 timshel Exp $
9
#
9
#
10
# Copyright (C) 1999, 2000, 2001, 2002  Timshel Knoll <timshel@debian.org>
10
# Copyright (C) 1999, 2000, 2001, 2002  Timshel Knoll <timshel@debian.org>
11
# Licensed under the terms of the GNU General Public License
11
# Licensed under the terms of the GNU General Public License
12
#
12
#
13
# Based originally on Sample debian/rules that uses debhelper, from dh-make,
13
# Based originally on Sample debian/rules that uses debhelper, from dh-make,
14
# GNU copyright 1997 to 1999 by Joey Hess.
14
# GNU copyright 1997 to 1999 by Joey Hess.
15
15
16
# Uncomment this to turn on verbose mode.
16
# Uncomment this to turn on verbose mode.
17
#export DH_VERBOSE=1
17
#export DH_VERBOSE=1
18
18
19
include /usr/share/dpatch/dpatch.make
19
include /usr/share/dpatch/dpatch.make
20
20
21
# These are used for cross-compiling and for saving the configure script
21
# These are used for cross-compiling and for saving the configure script
22
# from having to guess our platform (since we know it already)
22
# from having to guess our platform (since we know it already)
23
DEB_HOST_GNU_TYPE       ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
23
DEB_HOST_GNU_TYPE       ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
24
DEB_BUILD_GNU_TYPE      ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
24
DEB_BUILD_GNU_TYPE      ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
25
25
26
26
27
CFLAGS += -g
27
CFLAGS += -g
28
ifeq (, $(findstring noopt, $(DEB_BUILD_OPTIONS)))
28
ifeq (, $(findstring noopt, $(DEB_BUILD_OPTIONS)))
29
	CFLAGS += -O2
29
	CFLAGS += -O2
30
else
30
else
31
	CFLAGS += -O0
31
	CFLAGS += -O0
32
endif
32
endif
33
33
34
34
35
# The name of the library - this is the base name of the packages that
35
# The name of the library - this is the base name of the packages that
36
# will be built
36
# will be built
37
LIBRARY = liboop
37
LIBRARY = liboop
38
38
39
# This is the soname of the package being built - we have to know this
39
# This is the soname of the package being built - we have to know this
40
# before the start of the build because changing the control file half
40
# before the start of the build because changing the control file half
41
# way though the build probably isn't a good idea, and this would also
41
# way though the build probably isn't a good idea, and this would also
42
# mean renaming the $(LIBRARY)$(SONAME).{files,docs,...} files
42
# mean renaming the $(LIBRARY)$(SONAME).{files,docs,...} files
43
SONAME = 4
43
SONAME = 4
44
44
45
# A list of variables to substitute when generating files from .in files
45
# A list of variables to substitute when generating files from .in files
46
# If you put an 'x' here, then all @x@'s in .in files will be substituted
46
# If you put an 'x' here, then all @x@'s in .in files will be substituted
47
# with the value of $(x) in the output file
47
# with the value of $(x) in the output file
48
SUBSTS = SONAME
48
SUBSTS = SONAME
49
49
50
GENFILES = debian/control \
50
GENFILES = debian/control \
51
	debian/$(LIBRARY)$(SONAME).files \
51
	debian/$(LIBRARY)$(SONAME).files \
52
	debian/$(LIBRARY)$(SONAME).dirs
52
	debian/$(LIBRARY)$(SONAME).dirs
53
53
54
# We can't use these until after the package has been built ... otherwise
54
# We can't use these until after the package has been built ... otherwise
55
# they will fail because no .libs/lib*.so.* exists
55
# they will fail because no .libs/lib*.so.* exists
56
version = $(shell ls .libs/lib*.so.* | \
56
version = $(shell ls .libs/lib*.so.* | \
57
	    awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) \
57
	    awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) \
58
	         print substr($$0,RSTART)}')
58
	         print substr($$0,RSTART)}')
59
major = $(shell ls .libs/lib*.so.* | \
59
major = $(shell ls .libs/lib*.so.* | \
60
	  awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}')
60
	  awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}')
61
61
62
# This builds a substitution list for sed based on the SUBSTS variable
62
# This builds a substitution list for sed based on the SUBSTS variable
63
# and the variables whose names SUBSTS contains ...
63
# and the variables whose names SUBSTS contains ...
64
SUBSTLIST = $(foreach subst, $(SUBSTS),s/@$(subst)@/$($(subst))/g;)
64
SUBSTLIST = $(foreach subst, $(SUBSTS),s/@$(subst)@/$($(subst))/g;)
65
65
66
# A sane default rule 
66
# A sane default rule 
67
default:
67
default:
68
	@echo "Try: debian/rules [configure|build|clean|install|binary|binary-arch|binary-indep]"
68
	@echo "Try: debian/rules [configure|build|clean|install|binary|binary-arch|binary-indep]"
69
	@echo "Vars:"
69
	@echo "Vars:"
70
	@echo "	SUBSTLIST:	$(SUBSTLIST)"
70
	@echo "	SUBSTLIST:	$(SUBSTLIST)"
71
	@echo "	SONAME:		$(SONAME)"
71
	@echo "	SONAME:		$(SONAME)"
72
72
73
# Pattern rules:
73
# Pattern rules:
74
74
75
# How to generate files from .in's
75
# How to generate files from .in's
76
debian/%: debian/%.in debian/rules
76
debian/%: debian/%.in debian/rules
77
	sed -e '$(SUBSTLIST)' < $< > $@
77
	sed -e '$(SUBSTLIST)' < $< > $@
78
78
79
# This puts the $(LIBRARY)* packaging files in their right places
79
# This puts the $(LIBRARY)* packaging files in their right places
80
# Could I / should I use ln?
80
# Could I / should I use ln?
81
debian/$(LIBRARY)$(SONAME).%: debian/$(LIBRARY).%
81
debian/$(LIBRARY)$(SONAME).%: debian/$(LIBRARY).%
82
	cp $< $@
82
	cp $< $@
83
83
84
# Do the substitution/moving stuff
84
# Do the substitution/moving stuff
85
packaging-files: $(GENFILES)
85
packaging-files: $(GENFILES)
86
86
87
configure: packaging-files configure-stamp
87
configure: packaging-files configure-stamp
88
configure-stamp:
88
configure-stamp: $(DPATCH_STAMPFN)
89
	dh_testdir
89
	dh_testdir
90
90
91
	env CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \
91
	env CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \
92
		--build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr
92
		--build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr
93
93
94
	touch $@
94
	touch $@
95
95
96
build: configure-stamp build-stamp
96
build: configure-stamp build-stamp
97
build-stamp:
97
build-stamp:
98
	dh_testdir
98
	dh_testdir
99
99
100
	$(MAKE)
100
	$(MAKE)
101
101
102
	touch $@
102
	touch $@
103
103
104
clean:
104
clean: clean-patched unpatch
105
	dh_testdir
105
	dh_testdir
106
	dh_testroot
106
	dh_testroot
107
	rm -f build-stamp configure-stamp
107
	rm -f build-stamp configure-stamp
108
108
109
	[ ! -f Makefile ] || $(MAKE) distclean
109
	[ ! -f Makefile ] || $(MAKE) distclean
110
	[ ! -f liboop.org/Makefile ] || $(MAKE) -C liboop.org distclean
110
	[ ! -f liboop.org/Makefile ] || $(MAKE) -C liboop.org distclean
111
111
112
	-test -r /usr/share/misc/config.sub && \
-
 
113
	   cp -f /usr/share/misc/config.sub config.sub
-
 
114
	-test -r /usr/share/misc/config.guess && \
-
 
115
	   cp -f /usr/share/misc/config.guess config.guess
-
 
116
-
 
117
	dh_clean
112
	dh_clean
118
113
119
install-indep:
114
install-indep:
120
	dh_testdir
115
	dh_testdir
121
	dh_testroot
116
	dh_testroot
122
	dh_clean -k
117
	dh_clean -k
123
	dh_installdirs -i
118
	dh_installdirs -i
124
119
125
	$(MAKE) -C liboop.org install \
120
	$(MAKE) -C liboop.org install \
126
		DESTDIR=$(CURDIR)/debian/tmp/usr/share/doc/liboop-doc/html
121
		DESTDIR=$(CURDIR)/debian/tmp/usr/share/doc/liboop-doc/html
127
122
128
install-arch: build
123
install-arch: build
129
	dh_testdir
124
	dh_testdir
130
	dh_testroot
125
	dh_testroot
131
	dh_clean -k
126
	dh_clean -k
132
	dh_installdirs -a
127
	dh_installdirs -a
133
128
134
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
129
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
135
130
136
binary-indep: install-indep
131
binary-indep: install-indep
137
	dh_testdir
132
	dh_testdir
138
	dh_testroot
133
	dh_testroot
139
	dh_movefiles -i
134
	dh_movefiles -i
140
135
141
	dh_installdocs -i
136
	dh_installdocs -i
142
	dh_installman -i
137
	dh_installman -i
143
	dh_installinfo -i
138
	dh_installinfo -i
144
	dh_installchangelogs -i
139
	dh_installchangelogs -i
145
	dh_link -i
140
	dh_link -i
146
	dh_compress -i -Xliboop-doc/html
141
	dh_compress -i -Xliboop-doc/html
147
	dh_fixperms -i
142
	dh_fixperms -i
148
	dh_installdeb -i
143
	dh_installdeb -i
149
	dh_gencontrol -i
144
	dh_gencontrol -i
150
	dh_md5sums -i
145
	dh_md5sums -i
151
	dh_builddeb -i
146
	dh_builddeb -i
152
147
153
binary-arch: install-arch
148
binary-arch: install-arch
154
	dh_testdir
149
	dh_testdir
155
	dh_testroot
150
	dh_testroot
156
	dh_movefiles -a
151
	dh_movefiles -a
157
152
158
	dh_installdocs -a
153
	dh_installdocs -a
159
	dh_installman -a
154
	dh_installman -a
160
	dh_installinfo -a
155
	dh_installinfo -a
161
	dh_installchangelogs -a
156
	dh_installchangelogs -a
162
	dh_link -a
157
	dh_link -a
163
	dh_strip -a
158
	dh_strip -a
164
	dh_compress -a -Xliboop-doc/html
159
	dh_compress -a -Xliboop-doc/html
165
	dh_fixperms -a
160
	dh_fixperms -a
166
	dh_makeshlibs -a
161
	dh_makeshlibs -a
167
	dh_installdeb -a
162
	dh_installdeb -a
168
#	 Don't add the depends for adapter libraries - programs which link
163
#	 Don't add the depends for adapter libraries - programs which link
169
#	 with them will also link with the appropriate library
164
#	 with them will also link with the appropriate library
170
	dh_shlibdeps -a -Xliboop-
165
	dh_shlibdeps -a -Xliboop-
171
	dh_gencontrol -a
166
	dh_gencontrol -a
172
	dh_md5sums -a
167
	dh_md5sums -a
173
	dh_builddeb -a
168
	dh_builddeb -a
174
169
175
binary: binary-indep binary-arch
170
binary: binary-indep binary-arch
176
171
177
.PHONY: packaging-files configure build install
172
.PHONY: packaging-files configure build install
178
.PHONY: binary-indep binary-arch binary clean
173
.PHONY: binary-indep binary-arch binary clean