]> git.proxmox.com Git - libpve-u2f-server-perl.git/blob - Makefile
bump version to 1.2.0
[libpve-u2f-server-perl.git] / Makefile
1 include /usr/share/dpkg/pkg-info.mk
2 include /usr/share/dpkg/architecture.mk
3
4 PACKAGE=libpve-u2f-server-perl
5
6 BUILDSRC := $(PACKAGE)-$(DEB_VERSION_EPOCH_UPSTREAM)
7
8 DESTDIR=
9 PREFIX=/usr
10 LIBDIR=$(PREFIX)/lib
11 DOCDIR=$(PREFIX)/share/doc/$(PACKAGE)
12 PERLDIR=$(PREFIX)/share/perl5
13
14 PERL_ARCHLIB != perl -MConfig -e 'print $$Config{archlib};'
15 PERL_INSTALLVENDORARCH != perl -MConfig -e 'print $$Config{installvendorarch};'
16 PERL_APIVER != perl -MConfig -e 'print $$Config{debian_abi}//$$Config{version};'
17 PERL_CC != perl -MConfig -e 'print $$Config{cc};'
18 PERLSODIR=$(PERL_INSTALLVENDORARCH)/auto
19 CFLAGS := -shared -fPIC -O2 -Werror -Wtype-limits -Wall -Wl,-z,relro \
20 -D_FORTIFY_SOURCE=2 -I$(PERL_ARCHLIB)/CORE -DXS_VERSION=\"1.0\"
21
22 CFLAGS += `pkg-config --cflags u2f-server`
23 LIBS += `pkg-config --libs u2f-server`
24
25 DEB=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_ARCH).deb
26 DSC=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc
27
28 GITVERSION:=$(shell git rev-parse HEAD)
29
30 all:
31
32 ppport.h:
33 perl -MDevel::PPPort -e 'Devel::PPPort::WriteFile();'
34
35 U2F.c: U2F.xs
36 xsubpp U2F.xs > U2F.xsc
37 mv U2F.xsc U2F.c
38
39 U2F.so: U2F.c ppport.h
40 $(PERL_CC) $(CFLAGS) -o U2F.so U2F.c $(LIBS)
41
42 .PHONY: dinstall
43 dinstall: deb
44 dpkg -i $(DEB)
45
46 .PHONY: install
47 install: 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
51 .PHONY: $(BUILDSRC)
52 $(BUILDSRC):
53 rm -rf $(BUILDSRC)
54 mkdir $(BUILDSRC)
55 rsync -a debian Makefile PVE U2F.xs base64.h $(BUILDSRC)/
56 echo "git clone git://git.proxmox.com/git/libpve-u2f-server-perl.git\\ngit checkout $(GITVERSION)" > $(BUILDSRC)/debian/SOURCE
57
58 .PHONY: deb
59 deb: $(DEB)
60 $(DEB): $(BUILDSRC)
61 cd $(BUILDSRC); dpkg-buildpackage -b -us -uc
62 lintian $(DEB)
63
64 .PHONY: dsc
65 dsc: $(DSC)
66 $(DSC): $(BUILDSRC)
67 cd $(BUILDSRC); dpkg-buildpackage -S -us -uc -d -nc
68 lintian $(DSC)
69
70 .PHONY: clean
71 clean:
72 rm -rf *~ ${BUILDSRC} *.deb *.changes *.buildinfo *.dsc *.tar.gz
73 find . -name '*~' -exec rm {} ';'
74
75 .PHONY: distclean
76 distclean: clean
77
78
79 .PHONY: upload
80 upload: $$DEB)
81 tar cf - $(DEB) | ssh repoman@repo.proxmox.com -- upload --product pve --dist buster --arch $(DEB_BUILD_ARCH)