From 6cbcb5f7f5d1c0a098242e1582f59125e5e21b96 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 18 Feb 2015 11:30:48 +0100 Subject: [PATCH] create debian package --- Makefile | 76 +++++++++++++++++++++++++++++++++++++++++++-- PVE/HA/Env/Makefile | 5 +++ PVE/HA/Env/PVE2.pm | 8 ++--- PVE/HA/Makefile | 8 +++++ PVE/Makefile | 5 +++ changelog.Debian | 6 ++++ control.in | 9 ++++++ copyright | 16 ++++++++++ 8 files changed, 126 insertions(+), 7 deletions(-) create mode 100644 PVE/HA/Env/Makefile create mode 100644 PVE/HA/Makefile create mode 100644 PVE/Makefile create mode 100644 changelog.Debian create mode 100644 control.in create mode 100644 copyright diff --git a/Makefile b/Makefile index a3ac30a..1e5ced7 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,73 @@ +RELEASE=4.0 +VERSION=0.1 +PACKAGE=pve-ha-manager +PKGREL=1 +DESTDIR= +PREFIX=/usr +BINDIR=${PREFIX}/bin +SBINDIR=${PREFIX}/sbin +MANDIR=${PREFIX}/share/man +DOCDIR=${PREFIX}/share/doc/${PACKAGE} +PODDIR=${DOCDIR}/pod +MAN1DIR=${MANDIR}/man1/ +export PERLDIR=${PREFIX}/share/perl5 -all: test +#ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH) +ARCH=all +GITVERSION:=$(shell cat .git/refs/heads/master) + +DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb + + +all: ${DEB} + +.PHONY: dinstall +dinstall: deb + dpkg -i ${DEB} + +%.1.gz: %.1.pod + rm -f $@ + cat $<|pod2man -n $* -s 1 -r ${VERSION} -c "Proxmox Documentation"|gzip -c9 >$@ + +pve-ha-crm.1.pod: pve-ha-crm + perl -I. ./pve-ha-crm printmanpod >$@ + +pve-ha-lrm.1.pod: pve-ha-lrm + perl -I. ./pve-ha-lrm printmanpod >$@ + +.PHONY: install +install: pve-ha-crm pve-ha-lrm pve-ha-crm.1.pod pve-ha-crm.1.gz pve-ha-lrm.1.pod pve-ha-lrm.1.gz + install -d ${DESTDIR}${SBINDIR} + install -m 0755 pve-ha-crm ${DESTDIR}${SBINDIR} + install -m 0755 pve-ha-lrm ${DESTDIR}${SBINDIR} + make -C PVE install + install -d ${DESTDIR}/usr/share/man/man1 + install -d ${DESTDIR}${PODDIR} + install -m 0644 pve-ha-crm.1.gz ${DESTDIR}/usr/share/man/man1/ + install -m 0644 pve-ha-crm.1.pod ${DESTDIR}/${PODDIR} + install -m 0644 pve-ha-lrm.1.gz ${DESTDIR}/usr/share/man/man1/ + install -m 0644 pve-ha-lrm.1.pod ${DESTDIR}/${PODDIR} + + +.PHONY: deb ${DEB} +deb ${DEB}: + rm -rf build + mkdir build + make DESTDIR=${CURDIR}/build install + perl -I. ./pve-ha-crm verifyapi + perl -I. ./pve-ha-lrm verifyapi + install -d -m 0755 build/DEBIAN + sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/ build/DEBIAN/control + install -D -m 0644 copyright build/${DOCDIR}/copyright + install -m 0644 changelog.Debian build/${DOCDIR}/ + gzip -9 build/${DOCDIR}/changelog.Debian + echo "git clone git://git.proxmox.com/git/pve-storage.git\\ngit checkout ${GITVERSION}" > build/${DOCDIR}/SOURCE + dpkg-deb --build build + mv build.deb ${DEB} + rm -rf debian + lintian ${DEB} .PHONY: test @@ -9,7 +75,11 @@ test: make -C test test .PHONY: clean -clean: +clean: make -C test clean - rm -rf *~ + rm -rf build *.deb ${PACKAGE}-*.tar.gz dist *.1.pod *.1.gz + find . -name '*~' -exec rm {} ';' + +.PHONY: distclean +distclean: clean diff --git a/PVE/HA/Env/Makefile b/PVE/HA/Env/Makefile new file mode 100644 index 0000000..a4829d6 --- /dev/null +++ b/PVE/HA/Env/Makefile @@ -0,0 +1,5 @@ + + +.PHONY: install +install: + install -m 0644 PVE2.pm ${DESTDIR}${PERLDIR}/PVE/HA/Env diff --git a/PVE/HA/Env/PVE2.pm b/PVE/HA/Env/PVE2.pm index b4e7599..09a1f64 100644 --- a/PVE/HA/Env/PVE2.pm +++ b/PVE/HA/Env/PVE2.pm @@ -14,9 +14,9 @@ use PVE::HA::Groups; my $manager_status_filename = "/etc/pve/manager_status"; my $ha_groups_config = "ha/groups.cfg"; -cfs_register_file($ha_groups_config, - sub { PVE::HA::Groups->parse_config(@_); }, - sub { PVE::HA::Groups->write_config(@_); }); +#cfs_register_file($ha_groups_config, +# sub { PVE::HA::Groups->parse_config(@_); }, +# sub { PVE::HA::Groups->write_config(@_); }); sub new { my ($this, $nodename) = @_; @@ -67,7 +67,7 @@ sub read_lrm_status { sub write_lrm_status { my ($self, $status_obj) = @_; - $node = $self->{nodename}; + my $node = $self->{nodename}; my $filename = "/etc/pve/nodes/$node/lrm_status"; diff --git a/PVE/HA/Makefile b/PVE/HA/Makefile new file mode 100644 index 0000000..773a4f9 --- /dev/null +++ b/PVE/HA/Makefile @@ -0,0 +1,8 @@ +SOURCES=CRM.pm Env.pm Groups.pm LRM.pm Manager.pm NodeStatus.pm Tools.pm + +.PHONY: install +install: + install -d -m 0755 ${DESTDIR}${PERLDIR}/PVE/HA + for i in ${SOURCES}; do install -D -m 0644 $$i ${DESTDIR}${PERLDIR}/PVE/HA/$$i; done + make -C Env install + make -C Sim install diff --git a/PVE/Makefile b/PVE/Makefile new file mode 100644 index 0000000..713fabc --- /dev/null +++ b/PVE/Makefile @@ -0,0 +1,5 @@ + +.PHONY: install +install: + install -d -m 0755 ${DESTDIR}${PERLDIR}/PVE + make -C HA install diff --git a/changelog.Debian b/changelog.Debian new file mode 100644 index 0000000..f8889b8 --- /dev/null +++ b/changelog.Debian @@ -0,0 +1,6 @@ +pve-ha-manager (0.1-1) unstable; urgency=low + + * first package + + -- Proxmox Support Team Wed, 18 Feb 2015 11:30:21 +0100 + diff --git a/control.in b/control.in new file mode 100644 index 0000000..e54f437 --- /dev/null +++ b/control.in @@ -0,0 +1,9 @@ +Package: pve-ha-manager +Version: @@VERSION@@-@@PKGRELEASE@@ +Section: perl +Priority: optional +Architecture: @@ARCH@@ +Depends: perl (>= 5.6.0-16), libpve-common-perl +Maintainer: Proxmox Support Team +Description: Proxmox VE HA Manager + HA Manager Proxmox VE. diff --git a/copyright b/copyright new file mode 100644 index 0000000..3ef2e85 --- /dev/null +++ b/copyright @@ -0,0 +1,16 @@ +Copyright (C) 2015 Proxmox Server Solutions GmbH + +This software is written by Proxmox Server Solutions GmbH + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . -- 2.39.5