5
0
mirror of git://git.proxmox.com/git/pve-ha-manager.git synced 2025-08-26 05:49:21 +03:00

create debian package

This commit is contained in:
Dietmar Maurer
2015-02-18 11:30:48 +01:00
parent 07d29067ab
commit 6cbcb5f7f5
8 changed files with 126 additions and 7 deletions

View File

@ -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
#ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
ARCH=all
GITVERSION:=$(shell cat .git/refs/heads/master)
DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
all: ${DEB}
all: test
.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}/ <control.in >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

5
PVE/HA/Env/Makefile Normal file
View File

@ -0,0 +1,5 @@
.PHONY: install
install:
install -m 0644 PVE2.pm ${DESTDIR}${PERLDIR}/PVE/HA/Env

View File

@ -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";

8
PVE/HA/Makefile Normal file
View File

@ -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

5
PVE/Makefile Normal file
View File

@ -0,0 +1,5 @@
.PHONY: install
install:
install -d -m 0755 ${DESTDIR}${PERLDIR}/PVE
make -C HA install

6
changelog.Debian Normal file
View File

@ -0,0 +1,6 @@
pve-ha-manager (0.1-1) unstable; urgency=low
* first package
-- Proxmox Support Team <support@proxmox.com> Wed, 18 Feb 2015 11:30:21 +0100

9
control.in Normal file
View File

@ -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 <support@proxmox.com>
Description: Proxmox VE HA Manager
HA Manager Proxmox VE.

16
copyright Normal file
View File

@ -0,0 +1,16 @@
Copyright (C) 2015 Proxmox Server Solutions GmbH
This software is written by Proxmox Server Solutions GmbH <support@proxmox.com>
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 <http://www.gnu.org/licenses/>.