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