webdist/Makefile
2022-10-02 18:29:41 +02:00

69 lines
1.6 KiB
Makefile

# Makefile for webdist
# Copyright (C) 2022 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
PACKAGE = webdist
include VERSION
prefix = /usr
exec_prefix = ${prefix}
sysconfdir = /etc
sbindir = ${exec_prefix}/sbin
bindir = ${exec_prefix}/bin
datadir = ${prefix}/share
unitdir = ${prefix}/lib/systemd/system
libexecdir = ${prefix}/libexec
mandir = ${prefix}/usr/share/man
sysconfigdir= ${sysconfdir}/sysconfig
localstatedir= /var
cgidir = ${localstatedir}/www/cgi-bin
htmldir = ${localstatedir}/www/html
srcdir = .
DESTDIR =
INSTALL = /usr/bin/install
INSTALL_PROGRAM = ${INSTALL} -m 755
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_DIR = ${INSTALL} -d -m 755
INSTALL_SCRIPT = ${INSTALL_PROGRAM}
pck_datadir = $(datadir)/$(PACKAGE)
pck_statedir = $(localstatedir)/lib/$(PACKAGE)
pck_confdir = $(sysconfdir)/$(PACKAGE)
distdir = $(PACKAGE)-$(VERSION)
dist_archive = $(distdir).tar.bz2
default:
install-dirs:
@$(INSTALL_DIR) $(DESTDIR)$(pck_confdir)
@$(INSTALL_DIR) $(DESTDIR)$(pck_datadir)
@$(INSTALL_DIR) $(DESTDIR)$(pck_statedir)
install-data: install-dirs
cp main.cfg.example $(DESTDIR)$(pck_confdir)/main.cfg
cp -a app $(DESTDIR)$(pck_datadir)/
$(INSTALL_DATA) requirements.txt $(DESTDIR)$(pck_datadir)/requirements.txt
install: \
install-dirs \
install-data
clean:
rm -f $(dist_archive)
dist: clean
@mkdir /tmp/$(distdir)
@cp -a * /tmp/$(distdir)/
@rm -f $(dist_archive);\
tar cf - -C /tmp $(distdir) | bzip2 -9 -c > $(dist_archive)
@rm -rf /tmp/$(distdir)
@echo "file \`$(dist_archive)' created"
dist-rpm: dist
@rpm_sourcedir=`rpm --eval=%{_sourcedir}`;\
mv -f $(dist_archive) $$rpm_sourcedir;\
echo "and saved as \`$$rpm_sourcedir/$(dist_archive)'"