Skip to content

Instantly share code, notes, and snippets.

@bracki
Created January 31, 2014 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bracki/8742743 to your computer and use it in GitHub Desktop.
Save bracki/8742743 to your computer and use it in GitHub Desktop.
Generic Makefile for PECL debian packages
TOP := $(CURDIR)
PKGDIR = $(TOP)/pkg
all: build
$(PKGDIR):
mkdir -p $(PKGDIR)
clean:
rm -rf $(PKGDIR)
build: $(PKGDIR)
cd $(PKGDIR); \
dh-make-pecl $(if $(DEPS),--depends $(DEPS)) $(if $(BUILD_DEPS),--build-depends $(BUILD_DEPS)) $(NAME)-$(VERSION)
cd $(PKGDIR)/php-$(NAME)-$(VERSION); \
dch -l ".foo" "Foo build"; \
cd $(PKGDIR)/php-$(NAME)-$(VERSION); \
[ ! -f $(TOP)/$(NAME).patch ] || patch -p0 -i $(TOP)/$(NAME).patch
cd $(PKGDIR); \
dpkg-source -b php-$(NAME)-$(VERSION); \
sudo mk-build-deps -i *.dsc -t "apt-get -y --no-install-recommends"; \
sudo rm *build-deps*;
cd $(PKGDIR)/php-$(NAME)-$(VERSION); \
dpkg-buildpackage -rfakeroot -tc;
.PHONY: clean all build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment