Blame Makefile

rpm-build 805f55
# Basic Makefile for (un)installing the files, and creating archives manually.
rpm-build 805f55
#
rpm-build 805f55
# Supports standard GNU Makefile variables for specifying the paths:
rpm-build 805f55
# * prefix
rpm-build 805f55
# * datarootdir
rpm-build 805f55
# * datadir
rpm-build 805f55
# * DESTDIR
rpm-build 805f55
#
rpm-build 805f55
rpm-build 805f55
SHELL        = /bin/bash
rpm-build 805f55
rpm-build 805f55
AUTHOR       = adobe
rpm-build 805f55
PACKAGE      = cmap-resources
rpm-build 805f55
NAME         = $(AUTHOR)-$(PACKAGE)
rpm-build 805f55
rpm-build 805f55
# So far there's no versioning in place. If there will be any, then we will
rpm-build 805f55
# switch to commented line below...
rpm-build 805f55
VERSION      =
rpm-build 805f55
ARCHIVE_NAME = $(NAME)
rpm-build 805f55
#ARCHIVE_NAME = $(NAME)-$(VERSION)
rpm-build 805f55
rpm-build 805f55
GIT_ARCHIVE_TYPE = tar.gz
rpm-build 805f55
rpm-build 805f55
prefix       = /usr/local
rpm-build 805f55
datarootdir  = $(prefix)/share
rpm-build 805f55
datadir      = $(datarootdir)
rpm-build 805f55
packagedir   = $(datadir)/$(AUTHOR)/resources/mapping
rpm-build 805f55
rpm-build 805f55
# Source & destination folders:
rpm-build 805f55
CMap_CNS1_source = Adobe-CNS1-7
rpm-build 805f55
CMap_CNS1_dest = CNS1
rpm-build 805f55
rpm-build 805f55
CMap_GB1_source = Adobe-GB1-5
rpm-build 805f55
CMap_GB1_dest = GB1
rpm-build 805f55
rpm-build 805f55
CMap_ID_source = Adobe-Identity-0
rpm-build 805f55
CMap_ID_dest = Identity
rpm-build 805f55
rpm-build 805f55
CMap_Japan1_source = Adobe-Japan1-6
rpm-build 805f55
CMap_Japan1_dest = Japan1
rpm-build 805f55
rpm-build 805f55
CMap_Japan2_source = deprecated/Adobe-Japan2-0
rpm-build 805f55
CMap_Japan2_dest = deprecated/Japan2
rpm-build 805f55
rpm-build 805f55
CMap_Korea1_source = Adobe-Korea1-2
rpm-build 805f55
CMap_Korea1_dest = Korea1
rpm-build 805f55
rpm-build 805f55
# Other related files:
rpm-build 805f55
DISTFILES    =                          \
rpm-build 805f55
	LICENSE.txt                     \
rpm-build 805f55
	Makefile                        \
rpm-build 805f55
	README.md                       \
rpm-build 805f55
	VERSIONS.txt                    \
rpm-build 805f55
rpm-build 805f55
.PHONY: install uninstall
rpm-build 805f55
rpm-build 805f55
# Create the necessary directories first, and then install all the files:
rpm-build 805f55
install:
rpm-build 805f55
	install -m 0755 -d $(DESTDIR)$(packagedir)
rpm-build 805f55
	install -m 0755 -d $(DESTDIR)$(packagedir)/$(CMap_CNS1_dest)/CMap
rpm-build 805f55
	install -m 0755 -d $(DESTDIR)$(packagedir)/$(CMap_GB1_dest)/CMap
rpm-build 805f55
	install -m 0755 -d $(DESTDIR)$(packagedir)/$(CMap_ID_dest)/CMap
rpm-build 805f55
	install -m 0755 -d $(DESTDIR)$(packagedir)/$(CMap_Japan1_dest)/CMap
rpm-build 805f55
	install -m 0755 -d $(DESTDIR)$(packagedir)/$(CMap_Japan2_dest)/CMap
rpm-build 805f55
	install -m 0755 -d $(DESTDIR)$(packagedir)/$(CMap_Korea1_dest)/CMap
rpm-build 805f55
rpm-build 805f55
	install -m 0644 -p   $(CMap_CNS1_source)/cid2code.txt $(DESTDIR)$(packagedir)/$(CMap_CNS1_dest)
rpm-build 805f55
	install -m 0644 -p    $(CMap_GB1_source)/cid2code.txt $(DESTDIR)$(packagedir)/$(CMap_GB1_dest)
rpm-build 805f55
	install -m 0644 -p $(CMap_Japan1_source)/cid2code.txt $(DESTDIR)$(packagedir)/$(CMap_Japan1_dest)
rpm-build 805f55
	install -m 0644 -p $(CMap_Japan2_source)/cid2code.txt $(DESTDIR)$(packagedir)/$(CMap_Japan2_dest)
rpm-build 805f55
	install -m 0644 -p $(CMap_Korea1_source)/cid2code.txt $(DESTDIR)$(packagedir)/$(CMap_Korea1_dest)
rpm-build 805f55
rpm-build 805f55
	install -m 0644 -p   $(CMap_CNS1_source)/CMap/* $(DESTDIR)$(packagedir)/$(CMap_CNS1_dest)/CMap
rpm-build 805f55
	install -m 0644 -p    $(CMap_GB1_source)/CMap/* $(DESTDIR)$(packagedir)/$(CMap_GB1_dest)/CMap
rpm-build 805f55
	install -m 0644 -p     $(CMap_ID_source)/CMap/* $(DESTDIR)$(packagedir)/$(CMap_ID_dest)/CMap
rpm-build 805f55
	install -m 0644 -p $(CMap_Japan1_source)/CMap/* $(DESTDIR)$(packagedir)/$(CMap_Japan1_dest)/CMap
rpm-build 805f55
	install -m 0644 -p $(CMap_Japan2_source)/CMap/* $(DESTDIR)$(packagedir)/$(CMap_Japan2_dest)/CMap
rpm-build 805f55
	install -m 0644 -p $(CMap_Korea1_source)/CMap/* $(DESTDIR)$(packagedir)/$(CMap_Korea1_dest)/CMap
rpm-build 805f55
rpm-build 805f55
# Other files might be written in $(packagedir), remove only what has been installed:
rpm-build 805f55
uninstall:
rpm-build 805f55
	rm -rf $(DESTDIR)$(packagedir)/$(CMap_CNS1_dest)
rpm-build 805f55
	rm -rf $(DESTDIR)$(packagedir)/$(CMap_GB1_dest)
rpm-build 805f55
	rm -rf $(DESTDIR)$(packagedir)/$(CMap_ID_dest)
rpm-build 805f55
	rm -rf $(DESTDIR)$(packagedir)/$(CMap_Japan1_dest)
rpm-build 805f55
	rm -rf $(DESTDIR)$(packagedir)/$(CMap_Japan2_dest)
rpm-build 805f55
	rm -rf $(DESTDIR)$(packagedir)/$(CMap_Korea1_dest)
rpm-build 805f55
rpm-build 805f55
# We are putting the source files into subfolder, same as Github does for its releases:
rpm-build 805f55
git-archive:
rpm-build 805f55
	git archive -v --format=$(GIT_ARCHIVE_TYPE) --prefix=$(ARCHIVE_NAME)/ HEAD -o $(ARCHIVE_NAME).$(GIT_ARCHIVE_TYPE)
rpm-build 805f55
rpm-build 805f55
# The --transform option is what will put the source files into a $(ARCHIVE_NAME) subdirectory:
rpm-build 805f55
tar.bz2:
rpm-build 805f55
	tar --transform="s|^|$(ARCHIVE_NAME)/|" -cjvf $(ARCHIVE_NAME).tar.bz2 $(CMap_CNS1_source) $(CMap_GB1_source) $(CMap_ID_source) $(CMap_Japan1_source) $(CMap_Japan2_source) $(CMap_Korea1_source) $(DISTFILES)
rpm-build 805f55
rpm-build 805f55
tar.gz:
rpm-build 805f55
	tar --transform="s|^|$(ARCHIVE_NAME)/|" -czvf $(ARCHIVE_NAME).tar.gz  $(CMap_CNS1_source) $(CMap_GB1_source) $(CMap_ID_source) $(CMap_Japan1_source) $(CMap_Japan2_source) $(CMap_Korea1_source) $(DISTFILES)
rpm-build 805f55
rpm-build 805f55
tar.xz:
rpm-build 805f55
	tar --transform="s|^|$(ARCHIVE_NAME)/|" -cJvf $(ARCHIVE_NAME).tar.xz  $(CMap_CNS1_source) $(CMap_GB1_source) $(CMap_ID_source) $(CMap_Japan1_source) $(CMap_Japan2_source) $(CMap_Korea1_source) $(DISTFILES)