133 lines
5.9 KiB
Makefile
133 lines
5.9 KiB
Makefile
# Makefile for autodist
|
|
# Copyright (C) 2006-2009 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
|
#
|
|
PACKAGE = autodist
|
|
|
|
include VERSION
|
|
|
|
prefix = /usr
|
|
exec_prefix = ${prefix}
|
|
sysconfdir = /etc
|
|
sbindir = ${exec_prefix}/sbin
|
|
bindir = ${exec_prefix}/bin
|
|
datadir = ${prefix}/share
|
|
initrddir = ${sysconfdir}/rc.d/init.d
|
|
libexecdir = ${prefix}/libexec
|
|
mandir = ${prefix}/usr/share/man
|
|
sysconfigdir= ${sysconfdir}/sysconfig
|
|
configdir = ${sysconfdir}/autodist
|
|
localstatedir= /var
|
|
piddir= ${localstatedir}/run/autodist
|
|
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)/$(PACKAGE)
|
|
pck_logdir = $(localstatedir)/$(PACKAGE)/log
|
|
|
|
distdir = $(PACKAGE)-$(VERSION)
|
|
dist_archive = $(distdir).tar.bz2
|
|
|
|
default:
|
|
@sed -i "s|^VERSION=.*|VERSION=$(VERSION)|" autodist autoport
|
|
|
|
install-dirs:
|
|
@$(INSTALL_DIR) $(DESTDIR)$(configdir)/scripts
|
|
@$(INSTALL_DIR) $(DESTDIR)$(configdir)/distdb.d
|
|
@$(INSTALL_DIR) $(DESTDIR)$(sysconfdir)/sudoers.d
|
|
@$(INSTALL_DIR) $(DESTDIR)$(sysconfdir)/cron.hourly
|
|
@$(INSTALL_DIR) $(DESTDIR)$(sysconfdir)/cron.daily
|
|
@$(INSTALL_DIR) $(DESTDIR)$(sysconfdir)/sysconfig
|
|
@$(INSTALL_DIR) $(DESTDIR)$(bindir)
|
|
@$(INSTALL_DIR) $(DESTDIR)$(sbindir)
|
|
@$(INSTALL_DIR) $(DESTDIR)$(cgidir)
|
|
@$(INSTALL_DIR) $(DESTDIR)$(htmldir)
|
|
@$(INSTALL_DIR) $(DESTDIR)$(pck_datadir)
|
|
@$(INSTALL_DIR) $(DESTDIR)$(pck_statedir)
|
|
@$(INSTALL_DIR) $(DESTDIR)$(pck_statedir)/template/autoupdate/spec-patches-build/old
|
|
@$(INSTALL_DIR) $(DESTDIR)$(pck_statedir)/template/autoupdate/spec-patches-update/old
|
|
@$(INSTALL_DIR) $(DESTDIR)$(pck_logdir)/prepare/{ok,failed}
|
|
@$(INSTALL_DIR) $(DESTDIR)$(pck_logdir)/update/{ok,failed}
|
|
@$(INSTALL_DIR) $(DESTDIR)$(pck_logdir)/build/{ok,failed}
|
|
@$(INSTALL_DIR) $(DESTDIR)$(pck_logdir)/install/{ok,failed}
|
|
@$(INSTALL_DIR) $(DESTDIR)$(pck_logdir)/send/{ok,failed}
|
|
@$(INSTALL_DIR) $(DESTDIR)$(pck_statedir)/RPM/{SPECS,SRPMS,BUILD,SOURCES,RPMS/{noarch,i586,ppc,x86_64,arm}}
|
|
@$(INSTALL_DIR) $(DESTDIR)$(piddir)
|
|
@$(INSTALL_DIR) $(DESTDIR)$(libexecdir)
|
|
@$(INSTALL_DIR) $(DESTDIR)$(localstatedir)/webbuild/{cache,home,notes,tmp,users}
|
|
|
|
install-programs:
|
|
@$(INSTALL_SCRIPT) autodist $(DESTDIR)$(bindir)/autodist
|
|
@$(INSTALL_SCRIPT) autodist-tool $(DESTDIR)$(bindir)/autodist-tool
|
|
@$(INSTALL_SCRIPT) autoport $(DESTDIR)$(bindir)/autoport
|
|
@$(INSTALL_SCRIPT) autoport-chroot $(DESTDIR)$(sbindir)/autoport-chroot
|
|
@$(INSTALL_SCRIPT) autodist-upstream-updates $(DESTDIR)$(sbindir)/autodist-upstream-updates
|
|
@$(INSTALL_SCRIPT) autoport-fix-environment $(DESTDIR)$(bindir)/autoport-fix-environment
|
|
@$(INSTALL_SCRIPT) etc/autodist/scripts/* $(DESTDIR)$(configdir)/scripts/
|
|
@$(INSTALL_SCRIPT) autodist-cgi $(DESTDIR)$(cgidir)/autodist
|
|
@$(INSTALL_SCRIPT) webbuild/webbuild-cgi $(DESTDIR)$(cgidir)/webbuild
|
|
@$(INSTALL_SCRIPT) webbuild/webbuild-sudo $(DESTDIR)$(libexecdir)/webbuild-sudo
|
|
@$(INSTALL_SCRIPT) webbuild/webbuild-checkpassword $(DESTDIR)$(libexecdir)/webbuild-checkpassword
|
|
@$(INSTALL_SCRIPT) webbuild/webbuild-functions $(DESTDIR)$(pck_datadir)/webbuild-functions
|
|
@$(INSTALL_SCRIPT) webbuild/webbuild-functions-private $(DESTDIR)$(pck_datadir)/webbuild-functions-private
|
|
@cp -a webbuild/html/* $(DESTDIR)$(htmldir)
|
|
|
|
install-data:
|
|
@$(INSTALL_DATA) etc/autodist/config $(DESTDIR)$(configdir)/config
|
|
@$(INSTALL_DATA) etc/autodist/distdb $(DESTDIR)$(configdir)/distdb
|
|
@$(INSTALL_DATA) etc/autodist/distdb.i586 $(DESTDIR)$(configdir)/distdb.i586
|
|
@$(INSTALL_DATA) etc/autodist/distdb.arm $(DESTDIR)$(configdir)/distdb.arm
|
|
@$(INSTALL_DATA) etc/autodist/distdb.x86_64 $(DESTDIR)$(configdir)/distdb.x86_64
|
|
@$(INSTALL_DATA) etc/autodist/distdb.ppc $(DESTDIR)$(configdir)/distdb.ppc
|
|
@$(INSTALL_DATA) etc/autodist/legacy $(DESTDIR)$(configdir)/legacy
|
|
@$(INSTALL_DATA) etc/autodist/unstage $(DESTDIR)$(configdir)/unstage
|
|
@$(INSTALL_DATA) etc/autodist/unstage.i586 $(DESTDIR)$(configdir)/unstage.i586
|
|
@$(INSTALL_DATA) etc/autodist/unstage.arm $(DESTDIR)$(configdir)/unstage.arm
|
|
@$(INSTALL_DATA) etc/autodist/unstage.x86_64 $(DESTDIR)$(configdir)/unstage.x86_64
|
|
@$(INSTALL_DATA) etc/autodist/unstage.ppc $(DESTDIR)$(configdir)/unstage.ppc
|
|
@$(INSTALL_DATA) etc/autodist/distdb.d/*.db $(DESTDIR)$(configdir)/distdb.d/
|
|
@$(INSTALL_DATA) etc/autodist/blacklist $(DESTDIR)$(configdir)/blacklist
|
|
@$(INSTALL_DATA) etc/autodist/distdb.d/* $(DESTDIR)$(configdir)/distdb.d/
|
|
@$(INSTALL_DATA) etc/sudoers.d/autoport $(DESTDIR)$(sysconfdir)/sudoers.d/autoport
|
|
@$(INSTALL_DATA) webbuild/webbuild-sudoers $(DESTDIR)$(sysconfdir)/sudoers.d/webbuild
|
|
@$(INSTALL_SCRIPT) etc/sysconfig/autoport $(DESTDIR)$(sysconfdir)/sysconfig/autoport
|
|
@$(INSTALL_SCRIPT) etc/cron.hourly/60-autodist-update $(DESTDIR)$(sysconfdir)/cron.hourly/
|
|
@$(INSTALL_SCRIPT) etc/cron.hourly/65-autoport-native $(DESTDIR)$(sysconfdir)/cron.hourly/
|
|
@$(INSTALL_SCRIPT) etc/cron.hourly/66-autoport-chroot $(DESTDIR)$(sysconfdir)/cron.hourly/
|
|
@$(INSTALL_SCRIPT) etc/cron.daily/40-autodist-cleanold $(DESTDIR)$(sysconfdir)/cron.daily/
|
|
@$(INSTALL_SCRIPT) etc/cron.daily/40-autodist-upstream-updates $(DESTDIR)$(sysconfdir)/cron.daily/
|
|
@$(INSTALL_DATA) autospec-conf $(DESTDIR)$(pck_statedir)/.autospec
|
|
@touch $(DESTDIR)$(pck_statedir)/template/autoupdate/auto.success
|
|
@touch $(DESTDIR)$(pck_statedir)/template/autoupdate/auto.skip
|
|
|
|
install: \
|
|
install-dirs \
|
|
install-programs \
|
|
install-data
|
|
|
|
clean:
|
|
rm -f $(dist_archive)
|
|
|
|
dist: clean default
|
|
@git log > ChangeLog.git
|
|
@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)'"
|