]> git.proxmox.com Git - libpve-u2f-server-perl.git/blame - Makefile
bump version to 1.2.0
[libpve-u2f-server-perl.git] / Makefile
CommitLineData
b8adb2d5
WB
1include /usr/share/dpkg/pkg-info.mk
2include /usr/share/dpkg/architecture.mk
3
4PACKAGE=libpve-u2f-server-perl
5
5b0ce036 6BUILDDIR := $(PACKAGE)-$(DEB_VERSION)
b8adb2d5
WB
7
8DESTDIR=
9PREFIX=/usr
10LIBDIR=$(PREFIX)/lib
11DOCDIR=$(PREFIX)/share/doc/$(PACKAGE)
12PERLDIR=$(PREFIX)/share/perl5
13
14PERL_ARCHLIB != perl -MConfig -e 'print $$Config{archlib};'
15PERL_INSTALLVENDORARCH != perl -MConfig -e 'print $$Config{installvendorarch};'
16PERL_APIVER != perl -MConfig -e 'print $$Config{debian_abi}//$$Config{version};'
17PERL_CC != perl -MConfig -e 'print $$Config{cc};'
18PERLSODIR=$(PERL_INSTALLVENDORARCH)/auto
19CFLAGS := -shared -fPIC -O2 -Werror -Wtype-limits -Wall -Wl,-z,relro \
20 -D_FORTIFY_SOURCE=2 -I$(PERL_ARCHLIB)/CORE -DXS_VERSION=\"1.0\"
21
22CFLAGS += `pkg-config --cflags u2f-server`
23LIBS += `pkg-config --libs u2f-server`
24
f2450f4c
TL
25DEB=$(PACKAGE)_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
26DSC=$(PACKAGE)_$(DEB_VERSION).dsc
b8adb2d5
WB
27
28GITVERSION:=$(shell git rev-parse HEAD)
29
30all:
31
32ppport.h:
33 perl -MDevel::PPPort -e 'Devel::PPPort::WriteFile();'
34
35U2F.c: U2F.xs
36 xsubpp U2F.xs > U2F.xsc
37 mv U2F.xsc U2F.c
38
39U2F.so: U2F.c ppport.h
40 $(PERL_CC) $(CFLAGS) -o U2F.so U2F.c $(LIBS)
41
42.PHONY: dinstall
43dinstall: deb
44 dpkg -i $(DEB)
45
46.PHONY: install
47install: PVE/U2F.pm U2F.so
48 install -D -m 0644 PVE/U2F.pm $(DESTDIR)$(PERLDIR)/PVE/U2F.pm
49 install -D -m 0644 -s U2F.so $(DESTDIR)$(PERLSODIR)/PVE/U2F/U2F.so
50
5b0ce036 51$(BUILDDIR):
53ce2b3d
TL
52 rm -rf $@ $@.tmp
53 mkdir $@.tmp
54 cp -a debian Makefile PVE U2F.xs base64.h $@.tmp/
55 echo "git clone git://git.proxmox.com/git/libpve-u2f-server-perl.git\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE
56 mv $@.tmp $@
b8adb2d5
WB
57
58.PHONY: deb
59deb: $(DEB)
5b0ce036
TL
60$(DEB): $(BUILDDIR)
61 cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
b8adb2d5
WB
62 lintian $(DEB)
63
64.PHONY: dsc
65dsc: $(DSC)
457b762d
TL
66 rm -rf $(BUILDDIR) $(DSC)
67 $(MAKE) $(DSC)
68 lintian $(DSC)
69
5b0ce036 70$(DSC): $(BUILDDIR)
522866f6 71 cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
457b762d
TL
72
73sbuild: $(DSC)
74 sbuild $(DSC)
b8adb2d5
WB
75
76.PHONY: clean
77clean:
000ca5fa 78 rm -rf *~ $(PACKAGE)-[0-9]*/ *.deb *.changes *.buildinfo *.build *.dsc $(PACKAGE)*.tar*
b8adb2d5
WB
79
80.PHONY: distclean
81distclean: clean
82
83
84.PHONY: upload
c6526cd9 85upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
78c5c503 86upload: $(DEB)
c6526cd9 87 tar cf - $(DEB) | ssh repoman@repo.proxmox.com -- upload --product pve --dist $(UPLOAD_DIST) --arch $(DEB_HOST_ARCH)