diff options
author | Olav Vitters <olav@vitters.nl> | 2020-07-30 22:10:35 +0200 |
---|---|---|
committer | Olav Vitters <olav@vitters.nl> | 2020-07-30 22:10:35 +0200 |
commit | a5c52c00c16be69e14360222520129d30f76e042 (patch) | |
tree | d44ff9f87b2985ead827c72c55b5aaee23c5dd10 /Makefile | |
parent | 817ca842f086f7290f183720539834263c2f1afe (diff) | |
download | initscripts-a5c52c00c16be69e14360222520129d30f76e042.tar initscripts-a5c52c00c16be69e14360222520129d30f76e042.tar.gz initscripts-a5c52c00c16be69e14360222520129d30f76e042.tar.bz2 initscripts-a5c52c00c16be69e14360222520129d30f76e042.tar.xz initscripts-a5c52c00c16be69e14360222520129d30f76e042.zip |
Align Makefile and tree structure with upstream tree structure
Instead of placing the custom files with the upstream files it seems
clearer to have them mostly separated. This makes it easier to see which
parts are custom and which parts are more or less upstream.
As a result the upstream Makefile only needed minor changes to
accomodate this. The Makefile is NOT bug free, unfortunately it doesn't
always do the right thing, this due to inexperience.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 32 |
1 files changed, 26 insertions, 6 deletions
@@ -34,6 +34,12 @@ sharedstatedir = $(localstatedir)/lib VERSION := $(shell gawk '/Version:/ { print $$2 }' initscripts.spec) NEXT_VERSION := $(shell gawk '/Version:/ { print $$2 + 0.01}' initscripts.spec) +Mageia_DIR := mageia +Mageia_FILES := $(shell cd $(Mageia_DIR); find etc network-scripts usr -type f \! -name .keep) +Mageia_SUBDIRS := $(shell cd $(Mageia_DIR); find -type d -links 2) +PO := po-mageia +Mageia_MANDIR := man-mageia + all: make-binaries make-translations @@ -42,7 +48,7 @@ make-binaries: $(MAKE) -C src make-translations: - $(MAKE) -C po PYTHON=$(PYTHON) + $(MAKE) -C $(PO) PYTHON=$(PYTHON) # NOTE: We are no longer installing into /usr/sbin directory, because this is @@ -51,12 +57,19 @@ make-translations: # compatibility). install: install-binaries install-translations install-etc install-usr install-network-scripts install-man install-post +install-mageia: + # Ensure the directories used by Mageia exist in the main directory + @for i in $(Mageia_SUBDIRS); do mkdir -p $$i; echo "$$i";done + # Now copy over the various files to the main directory. This allows + # the standard logic of this Makefile to work + @for i in $(Mageia_FILES);do cp -a $(Mageia_DIR)/$$i $$i;done + install-binaries: $(MAKE) install -C src DESTDIR=$(DESTDIR) prefix=$(prefix) bindir=$(bindir) libdir=$(libdir) install-translations: - $(MAKE) install -C po DESTDIR=$(DESTDIR) prefix=$(prefix) bindir=$(bindir) libdir=$(libdir) \ + $(MAKE) install -C $(PO) DESTDIR=$(DESTDIR) prefix=$(prefix) bindir=$(bindir) libdir=$(libdir) \ datarootdir=$(datarootdir) datadir=$(datadir) sysconfdir=$(sysconfdir) @@ -80,8 +93,9 @@ install-man: install-usr install -m 0644 man/*.1 $(DESTDIR)$(mandir)/man1 install -m 0644 man/*.8 $(DESTDIR)$(mandir)/man8 # install translated man pages - for j in 1 3 8 ; do \ - for i in man/??* ; do \ + for j in 1 8 ; do \ + for i in $(Mageia_MANDIR)/??* ; do \ + install -d $(DESTDIR)$(mandir)/`basename $$i`/man$$j ; \ install -m 644 $$i/*.$$j $(DESTDIR)$(mandir)/`basename $$i`/man$$j ; \ done ; \ done @@ -102,11 +116,17 @@ install-post: install-etc done ln -srf $(DESTDIR)$(sysconfdir)/rc.d/init.d $(DESTDIR)$(sysconfdir)/init.d -clean: +clean: clean-mageia $(MAKE) clean -C src - $(MAKE) clean -C po + $(MAKE) clean -C $(PO) @find . -name "*~" -exec rm -v -f {} \; +clean-mageia: + # Remove the files we've added + @for i in $(Mageia_FILES);do rm -f $$i;done + # Try to remove any empty directories caused by the files we've removed + @for i in $(Mageia_SUBDIRS);do [ -d "$$1" ] && [ ! -h "$$1" ] && rmdir "$$1" 2> /dev/null;done + tag: @git tag -a -f -m "$(VERSION) release" $(VERSION) @echo "Tagged as $(VERSION)" |