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