Subversion Repositories

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

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

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