Subversion Repositories

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

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

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