diff options
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)" |