More work on getting packaging working
This commit is contained in:
16
Makefile
16
Makefile
@@ -1,13 +1,15 @@
|
||||
PACKAGE_NAME := pgmon
|
||||
VERSION := 1.0
|
||||
|
||||
BUILD_DIR := build
|
||||
|
||||
DEB_IMAGE := debian-package-builder
|
||||
RPM_IMAGE := rpm-package-builder
|
||||
|
||||
SCRIPT := src/$(PACKAGE_NAME).py
|
||||
|
||||
# Top-level targets
|
||||
.PHONY: all clean deb rpm
|
||||
.PHONY: all clean deb rpm test
|
||||
|
||||
all: deb rpm
|
||||
|
||||
@@ -28,6 +30,8 @@ rpm:
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR)
|
||||
|
||||
test:
|
||||
cd src ; python3 -m unittest
|
||||
|
||||
# Container targets
|
||||
.PHONY: docker deb-package-image rpm-package-image
|
||||
@@ -56,22 +60,22 @@ package-rpm:
|
||||
cp RPM/$(PACKAGE_NAME).spec /output/SPECS/
|
||||
rpmbuild --define '_topdir /output' \
|
||||
--define 'version $(VERSION)' \
|
||||
-ba /output/SPECS/$(PACKAGE_NAME).spec
|
||||
cp /output/rpm/RPMS/x86_64/*.rpm /output/
|
||||
-bb /output/SPECS/$(PACKAGE_NAME).spec
|
||||
cp /output/RPMS/x86_64/*.rpm /output/
|
||||
|
||||
# Install into the specified destination directory (used inside the packaging systems)
|
||||
.PHONY: install
|
||||
|
||||
install:
|
||||
# Set up directories
|
||||
mkdir -p $(DESTDIR)/usr/bin
|
||||
mkdir -p $(DESTDIR)/usr/local/bin
|
||||
mkdir -p $(DESTDIR)/usr/share/man/man1
|
||||
mkdir -p $(DESTDIR)/etc/$(PACKAGE_NAME)
|
||||
mkdir -p $(DESTDIR)/lib/systemd/system
|
||||
|
||||
# Install script
|
||||
cp script.py $(DESTDIR)/usr/bin/$(PACKAGE_NAME)
|
||||
chmod 755 $(DESTDIR)/usr/bin/$(PACKAGE_NAME)
|
||||
cp $(SCRIPT) $(DESTDIR)/usr/local/bin/$(PACKAGE_NAME)
|
||||
chmod 755 $(DESTDIR)/usr/local/bin/$(PACKAGE_NAME)
|
||||
|
||||
# Install manpage
|
||||
cp manpages/* $(DESTDIR)/usr/share/man/man1/
|
||||
|
||||
Reference in New Issue
Block a user