| 4,7 → 4,8 |
| # parent directory of this file. (You may need to specify the `-rfakeroot' |
| # option if you are using dpkg-buildpackage and are not running as root) |
| # |
| # Copyright (C) 1999, 2000, 2001, 2002 Timshel Knoll <timshel@debian.org> |
| # Copyright © 1999, 2000, 2001, 2002 Timshel Knoll <timshel@debian.org> |
| # Copyright © 2008, 2009, 2010, 2012 Magnus Holmgren <holmgren@debian.org> |
| # Licensed under the terms of the GNU General Public License |
| # |
| # Based originally on Sample debian/rules that uses debhelper, from dh-make, |
| 26,59 → 27,7 |
| |
| buildflags += $(shell dpkg-buildflags --export=configure) |
| |
| # The name of the library - this is the base name of the packages that |
| # will be built |
| LIBRARY = liboop |
| |
| # This is the soname of the package being built - we have to know this |
| # before the start of the build because changing the control file half |
| # way though the build probably isn't a good idea, and this would also |
| # mean renaming the $(LIBRARY)$(SONAME).{files,docs,...} files |
| SONAME = 4 |
| |
| # A list of variables to substitute when generating files from .in files |
| # If you put an 'x' here, then all @x@'s in .in files will be substituted |
| # with the value of $(x) in the output file |
| SUBSTS = SONAME |
| |
| GENFILES = debian/control \ |
| debian/$(LIBRARY)$(SONAME).install \ |
| debian/$(LIBRARY)$(SONAME).dirs |
| |
| # We can't use these until after the package has been built ... otherwise |
| # they will fail because no .libs/lib*.so.* exists |
| version = $(shell ls .libs/lib*.so.* | \ |
| awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) \ |
| print substr($$0,RSTART)}') |
| major = $(shell ls .libs/lib*.so.* | \ |
| awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}') |
| |
| # This builds a substitution list for sed based on the SUBSTS variable |
| # and the variables whose names SUBSTS contains ... |
| SUBSTLIST = $(foreach subst, $(SUBSTS),s/@$(subst)@/$($(subst))/g;) |
| |
| # A sane default rule |
| default: |
| @echo "Try: debian/rules [configure|build|clean|install|binary|binary-arch|binary-indep]" |
| @echo "Vars:" |
| @echo " SUBSTLIST: $(SUBSTLIST)" |
| @echo " SONAME: $(SONAME)" |
| |
| # Pattern rules: |
| |
| # How to generate files from .in's |
| debian/%: debian/%.in debian/rules |
| sed -e '$(SUBSTLIST)' < $< > $@ |
| |
| # This puts the $(LIBRARY)* packaging files in their right places |
| # Could I / should I use ln? |
| debian/$(LIBRARY)$(SONAME).%: debian/$(LIBRARY).% |
| cp $< $@ |
| |
| # Do the substitution/moving stuff |
| packaging-files: $(GENFILES) |
| |
| configure: packaging-files configure-stamp |
| configure: configure-stamp |
| configure-stamp: |
| dh_testdir |
| |
| 106,7 → 55,7 |
| [ ! -f Makefile ] || $(MAKE) distclean |
| |
| dh_autoreconf_clean |
| dh_clean libtool configure |
| dh_clean |
| |
| install: build |
| dh_testdir |
| 156,5 → 105,5 |
| |
| binary: binary-indep binary-arch |
| |
| .PHONY: packaging-files configure build install |
| .PHONY: configure build build-arch build-indep install |
| .PHONY: binary-indep binary-arch binary clean |