Rev 42 | Rev 63 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 42 | Rev 43 | ||
|---|---|---|---|
| Line 2... | Line 2... | ||
| 2 | # |
2 | # |
| 3 | # To build the packages, run `dpkg-buildpackage' or `debuild' from the |
3 | # To build the packages, run `dpkg-buildpackage' or `debuild' from the |
| 4 | # 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' |
| 5 | # 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) |
| 6 | # |
6 | # |
| 7 | # Copyright (C) 1999, 2000, 2001, 2002 Timshel Knoll <timshel@debian.org> |
7 | # Copyright © 1999, 2000, 2001, 2002 Timshel Knoll <timshel@debian.org> |
| - | 8 | # Copyright © 2008, 2009, 2010, 2012 Magnus Holmgren <holmgren@debian.org> |
|
| 8 | # Licensed under the terms of the GNU General Public License |
9 | # Licensed under the terms of the GNU General Public License |
| 9 | # |
10 | # |
| 10 | # Based originally on Sample debian/rules that uses debhelper, from dh-make, |
11 | # Based originally on Sample debian/rules that uses debhelper, from dh-make, |
| 11 | # GNU copyright 1997 to 1999 by Joey Hess. |
12 | # GNU copyright 1997 to 1999 by Joey Hess. |
| 12 | 13 | ||
| Line 24... | Line 25... | ||
| 24 | buildflags := --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) |
25 | buildflags := --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) |
| 25 | endif |
26 | endif |
| 26 | 27 | ||
| 27 | buildflags += $(shell dpkg-buildflags --export=configure) |
28 | buildflags += $(shell dpkg-buildflags --export=configure) |
| 28 | 29 | ||
| 29 | # The name of the library - this is the base name of the packages that |
- | |
| 30 | # will be built |
- | |
| 31 | LIBRARY = liboop |
- | |
| 32 | - | ||
| 33 | # This is the soname of the package being built - we have to know this |
- | |
| 34 | # before the start of the build because changing the control file half |
- | |
| 35 | # way though the build probably isn't a good idea, and this would also |
- | |
| 36 | # mean renaming the $(LIBRARY)$(SONAME).{files,docs,...} files
|
- | |
| 37 | SONAME = 4 |
- | |
| 38 | - | ||
| 39 | # A list of variables to substitute when generating files from .in files |
- | |
| 40 | # If you put an 'x' here, then all @x@'s in .in files will be substituted |
- | |
| 41 | # with the value of $(x) in the output file |
- | |
| 42 | SUBSTS = SONAME |
- | |
| 43 | - | ||
| 44 | GENFILES = debian/control \ |
- | |
| 45 | debian/$(LIBRARY)$(SONAME).install \ |
- | |
| 46 | debian/$(LIBRARY)$(SONAME).dirs |
- | |
| 47 | - | ||
| 48 | # We can't use these until after the package has been built ... otherwise |
- | |
| 49 | # they will fail because no .libs/lib*.so.* exists |
- | |
| 50 | version = $(shell ls .libs/lib*.so.* | \ |
- | |
| 51 | awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) \
|
- | |
| 52 | print substr($$0,RSTART)}') |
- | |
| 53 | major = $(shell ls .libs/lib*.so.* | \ |
- | |
| 54 | awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}')
|
- | |
| 55 | - | ||
| 56 | # This builds a substitution list for sed based on the SUBSTS variable |
- | |
| 57 | # and the variables whose names SUBSTS contains ... |
- | |
| 58 | SUBSTLIST = $(foreach subst, $(SUBSTS),s/@$(subst)@/$($(subst))/g;) |
- | |
| 59 | - | ||
| 60 | # A sane default rule |
- | |
| 61 | default: |
- | |
| 62 | @echo "Try: debian/rules [configure|build|clean|install|binary|binary-arch|binary-indep]" |
- | |
| 63 | @echo "Vars:" |
- | |
| 64 | @echo " SUBSTLIST: $(SUBSTLIST)" |
- | |
| 65 | @echo " SONAME: $(SONAME)" |
- | |
| 66 | - | ||
| 67 | # Pattern rules: |
- | |
| 68 | - | ||
| 69 | # How to generate files from .in's |
- | |
| 70 | debian/%: debian/%.in debian/rules |
- | |
| 71 | sed -e '$(SUBSTLIST)' < $< > $@ |
- | |
| 72 | - | ||
| 73 | # This puts the $(LIBRARY)* packaging files in their right places |
- | |
| 74 | # Could I / should I use ln? |
- | |
| 75 | debian/$(LIBRARY)$(SONAME).%: debian/$(LIBRARY).% |
- | |
| 76 | cp $< $@ |
- | |
| 77 | - | ||
| 78 | # Do the substitution/moving stuff |
- | |
| 79 | packaging-files: $(GENFILES) |
- | |
| 80 | - | ||
| 81 | configure: packaging-files configure-stamp |
30 | configure: configure-stamp |
| 82 | configure-stamp: |
31 | configure-stamp: |
| 83 | dh_testdir |
32 | dh_testdir |
| 84 | 33 | ||
| 85 | [ -f debian/autoreconf.before ] || dh_autoreconf |
34 | [ -f debian/autoreconf.before ] || dh_autoreconf |
| 86 | 35 | ||
| Line 104... | Line 53... | ||
| 104 | rm -f build-stamp configure-stamp |
53 | rm -f build-stamp configure-stamp |
| 105 | 54 | ||
| 106 | [ ! -f Makefile ] || $(MAKE) distclean |
55 | [ ! -f Makefile ] || $(MAKE) distclean |
| 107 | 56 | ||
| 108 | dh_autoreconf_clean |
57 | dh_autoreconf_clean |
| 109 | dh_clean libtool configure |
58 | dh_clean |
| 110 | 59 | ||
| 111 | install: build |
60 | install: build |
| 112 | dh_testdir |
61 | dh_testdir |
| 113 | dh_testroot |
62 | dh_testroot |
| 114 | dh_prep |
63 | dh_prep |
| Line 154... | Line 103... | ||
| 154 | dh_md5sums -a |
103 | dh_md5sums -a |
| 155 | dh_builddeb -a |
104 | dh_builddeb -a |
| 156 | 105 | ||
| 157 | binary: binary-indep binary-arch |
106 | binary: binary-indep binary-arch |
| 158 | 107 | ||
| 159 | .PHONY: packaging-files configure build install |
108 | .PHONY: configure build build-arch build-indep install |
| 160 | .PHONY: binary-indep binary-arch binary clean |
109 | .PHONY: binary-indep binary-arch binary clean |