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