]> www.wagner.pp.ru Git - oss/btcli.git/blobdiff - Makefile
Added makefile to build Debian package
[oss/btcli.git] / Makefile
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..8f264eb
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,27 @@
+BTPASS_VERSION=1.2
+BTPASS_PKG_VERSION=1
+ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
+export BTPASS_VERSION
+
+PKG=btpasskey_$(BTPASS_VERSION)-$(BTPASS_PKG_VERSION)_$(ARCH).deb
+ORIG=btpasskey_$(BTPASS_VERSION).orig.tar.gz
+BUILDDIR=btpasskey-$(BTPASS_VERSION)
+btpasskey: $(PKG)
+
+$(PKG): $(ORIG) $(BUILDDIR)/debian/rules
+       cd $(BUILDDIR); debuild
+
+$(BUILDDIR)/debian/rules: $(BUILDDIR)/btpasskey.c 
+       -mkdir $(BUILDDIR)/debian
+       -cp -p packaging/btpasskey-debian/* $(BUILDDIR)/debian
+       sed 's!prefix=/usr/local!prefix=/usr!' btpasskey/Makefile > $(BUILDDIR)/Makefile
+$(BUILDDIR)/btpasskey.c: btpasskey/btpasskey.c btpasskey/btpasskey.1 btpasskey/Makefile
+       -mkdir $(BUILDDIR)
+       cp -p $+ $(BUILDDIR)
+
+$(ORIG): $(BUILDDIR)/btpasskey.c
+       tar czf $@ $(BUILDDIR)
+
+clean:
+       rm -rf $(BUILDDIR) btpasskey_$(BTPASS_VERSION)*
+