|
rpm-build |
133ac4 |
# Basic Makefile for compiling & installing the files.
|
|
rpm-build |
133ac4 |
#
|
|
rpm-build |
133ac4 |
# Supports standard GNU Makefile variables for specifying the paths:
|
|
rpm-build |
133ac4 |
# * prefix
|
|
rpm-build |
133ac4 |
# * exec_prefix
|
|
rpm-build |
133ac4 |
# * bindir
|
|
rpm-build |
133ac4 |
# * sbindir
|
|
rpm-build |
133ac4 |
# * libdir
|
|
rpm-build |
133ac4 |
# * datarootdir
|
|
rpm-build |
133ac4 |
# * datadir
|
|
rpm-build |
133ac4 |
# * mandir
|
|
rpm-build |
133ac4 |
# * sysconfdir
|
|
rpm-build |
133ac4 |
# * localstatedir
|
|
rpm-build |
133ac4 |
# * DESTDIR
|
|
rpm-build |
133ac4 |
#
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
SHELL = /bin/bash
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# Normally /usr/local is used. However, it does not make sense for us to use it
|
|
rpm-build |
133ac4 |
# here, as it just complicates things even further.
|
|
rpm-build |
133ac4 |
prefix = /usr
|
|
rpm-build |
133ac4 |
exec_prefix = $(prefix)
|
|
rpm-build |
133ac4 |
bindir = $(prefix)/bin
|
|
rpm-build |
133ac4 |
sbindir = $(prefix)/sbin
|
|
rpm-build |
133ac4 |
libdir = $(prefix)/lib
|
|
rpm-build |
133ac4 |
libexecdir = $(exec_prefix)/libexec
|
|
rpm-build |
133ac4 |
datarootdir = $(prefix)/share
|
|
rpm-build |
133ac4 |
datadir = $(datarootdir)
|
|
rpm-build |
133ac4 |
mandir = $(datadir)/man
|
|
rpm-build |
133ac4 |
sysconfdir = /etc
|
|
rpm-build |
133ac4 |
localstatedir = /var
|
|
rpm-build |
133ac4 |
sharedstatedir = $(localstatedir)/lib
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
VERSION := $(shell gawk '/Version:/ { print $$2 }' initscripts.spec)
|
|
rpm-build |
133ac4 |
NEXT_VERSION := $(shell sed -nr 's/Version:[ ]*([0-9]*)\.([0-9]*)\.([0-9]*)/echo "\1\.\2\.$$((\3+1))"/gep' initscripts.spec)
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
all: make-binaries make-translations
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
make-binaries:
|
|
rpm-build |
133ac4 |
$(MAKE) -C src
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
make-translations:
|
|
rpm-build |
133ac4 |
$(MAKE) -C po PYTHON=$(PYTHON)
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# NOTE: We are no longer installing into /usr/sbin directory, because this is
|
|
rpm-build |
133ac4 |
# just a symlink to /usr/bin, thanks to UsrMove change. Instead, we just
|
|
rpm-build |
133ac4 |
# use virtual provides for /usr/sbin/<utility> in specfile (for backward
|
|
rpm-build |
133ac4 |
# compatibility).
|
|
rpm-build |
133ac4 |
install: install-binaries install-translations install-etc install-usr install-network-scripts install-man install-post
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
install-binaries:
|
|
rpm-build |
133ac4 |
$(MAKE) install -C src DESTDIR=$(DESTDIR) prefix=$(prefix) bindir=$(bindir) libdir=$(libdir)
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
install-translations:
|
|
rpm-build |
133ac4 |
$(MAKE) install -C po DESTDIR=$(DESTDIR) prefix=$(prefix) bindir=$(bindir) libdir=$(libdir) \
|
|
rpm-build |
133ac4 |
datarootdir=$(datarootdir) datadir=$(datadir) sysconfdir=$(sysconfdir)
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# NOTE: We are removing auxiliary symlink at the beginning.
|
|
rpm-build |
133ac4 |
install-etc:
|
|
rpm-build |
133ac4 |
rm -f etc/sysconfig/network-scripts
|
|
rpm-build |
133ac4 |
install -m 0755 -d $(DESTDIR)$(sysconfdir)
|
|
rpm-build |
133ac4 |
cp -a etc/* $(DESTDIR)$(sysconfdir)/
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
install-usr:
|
|
rpm-build |
133ac4 |
install -m 0755 -d $(DESTDIR)$(prefix)
|
|
rpm-build |
133ac4 |
cp -a usr/* $(DESTDIR)$(prefix)/
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
install-network-scripts: install-usr install-etc
|
|
rpm-build |
133ac4 |
install -m 0755 -d $(DESTDIR)$(sysconfdir)/sysconfig/network-scripts
|
|
rpm-build |
133ac4 |
cp -a network-scripts/* $(DESTDIR)$(sysconfdir)/sysconfig/network-scripts/
|
|
rpm-build |
133ac4 |
ln -srf $(DESTDIR)$(sysconfdir)/sysconfig/network-scripts/{ifup-ippp,ifup-isdn}
|
|
rpm-build |
133ac4 |
ln -srf $(DESTDIR)$(sysconfdir)/sysconfig/network-scripts/{ifdown-ippp,ifdown-isdn}
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
install-man: install-usr
|
|
rpm-build |
133ac4 |
install -m 0755 -d $(DESTDIR)$(mandir)/man1
|
|
rpm-build |
133ac4 |
install -m 0755 -d $(DESTDIR)$(mandir)/man8
|
|
rpm-build |
133ac4 |
install -m 0644 man/*.1 $(DESTDIR)$(mandir)/man1
|
|
rpm-build |
133ac4 |
install -m 0644 man/*.8 $(DESTDIR)$(mandir)/man8
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
# Initscripts still ship some empty directories necessary for system to function
|
|
rpm-build |
133ac4 |
# correctly...
|
|
rpm-build |
133ac4 |
install-post: install-etc
|
|
rpm-build |
133ac4 |
install -m 0755 -d $(DESTDIR)$(sysconfdir)/sysconfig/console
|
|
rpm-build |
133ac4 |
install -m 0755 -d $(DESTDIR)$(sysconfdir)/sysconfig/modules
|
|
rpm-build |
133ac4 |
install -m 0755 -d $(DESTDIR)$(sharedstatedir)/stateless/state
|
|
rpm-build |
133ac4 |
install -m 0755 -d $(DESTDIR)$(sharedstatedir)/stateless/writable
|
|
rpm-build |
133ac4 |
install -m 0755 -d $(DESTDIR)$(libexecdir)/initscripts/legacy-actions
|
|
rpm-build |
133ac4 |
for idx in {0..6}; do \
|
|
rpm-build |
133ac4 |
dir=$(DESTDIR)$(sysconfdir)/rc.d/rc$$idx.d; \
|
|
rpm-build |
133ac4 |
install -m 0755 -d $$dir; \
|
|
rpm-build |
133ac4 |
ln -srf $(DESTDIR)$(sysconfdir)/rc.d/rc$$idx.d $(DESTDIR)$(sysconfdir)/; \
|
|
rpm-build |
133ac4 |
done
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
clean:
|
|
rpm-build |
133ac4 |
$(MAKE) clean -C src
|
|
rpm-build |
133ac4 |
$(MAKE) clean -C po
|
|
rpm-build |
133ac4 |
@find . -name "*~" -exec rm -v -f {} \;
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
tag:
|
|
rpm-build |
133ac4 |
@git tag -a -f -m "Tag as $(VERSION)" $(VERSION)
|
|
rpm-build |
133ac4 |
@echo "Tagged as $(VERSION)"
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
release-commit:
|
|
rpm-build |
133ac4 |
@git log --decorate=no --format="- %s" $(VERSION)..HEAD > .changelog.tmp
|
|
Packit Service |
8029ae |
@rpmdev-bumpspec -D -n $(NEXT_VERSION) -f .changelog.tmp initscripts.spec
|
|
rpm-build |
133ac4 |
@rm -f .changelog.tmp
|
|
rpm-build |
133ac4 |
@git add initscripts.spec
|
|
rpm-build |
133ac4 |
@git commit --message="$(NEXT_VERSION)"
|
|
rpm-build |
133ac4 |
@git tag -a -f -m "Tag as $(NEXT_VERSION)" $(NEXT_VERSION)
|
|
rpm-build |
133ac4 |
@echo -e "\n New release commit ($(NEXT_VERSION)) created:\n"
|
|
rpm-build |
133ac4 |
@git show
|
|
rpm-build |
133ac4 |
|
|
rpm-build |
133ac4 |
archive: clean
|
|
rpm-build |
133ac4 |
@git archive --format=tar --prefix=initscripts-$(VERSION)/ HEAD > initscripts-$(VERSION).tar
|
|
rpm-build |
133ac4 |
@mkdir -p initscripts-$(VERSION)/
|
|
rpm-build |
133ac4 |
@tar --append -f initscripts-$(VERSION).tar initscripts-$(VERSION)
|
|
rpm-build |
133ac4 |
@gzip -f initscripts-$(VERSION).tar
|
|
rpm-build |
133ac4 |
@rm -rf initscripts-$(VERSION)
|
|
rpm-build |
133ac4 |
@echo "The archive is at initscripts-$(VERSION).tar.gz"
|