summaryrefslogtreecommitdiff
path: root/support/adobemapping/mapping-resources-pdf/Makefile
blob: bca0b6580cc01ce5c5fa5f158073007cb61fde4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Basic Makefile for (un)installing the files, and creating archives manually.
#
# Supports standard GNU Makefile variables for specifying the paths:
# * prefix
# * datarootdir
# * datadir
# * DESTDIR
#

SHELL        = /bin/bash

AUTHOR       = adobe
PACKAGE      = mapping-resources-pdf
NAME         = $(AUTHOR)-$(PACKAGE)

# So far there's no versioning in place. If there will be any, then we will
# switch to commented line below...
VERSION      =
ARCHIVE_NAME = $(NAME)
#ARCHIVE_NAME = $(NAME)-$(VERSION)

GIT_ARCHIVE_TYPE = tar.gz

prefix       = /usr/local
datarootdir  = $(prefix)/share
datadir      = $(datarootdir)
packagedir   = $(datadir)/$(AUTHOR)/resources/mapping

# Folder names:
PDF_mappings_other = pdf2other
PDF_mappings_unicode = pdf2unicode

# Other related files:
DISTFILES    =                          \
	LICENSE.txt                     \
	Makefile                        \
	README.md                       \

.PHONY: install uninstall

# Create the necessary directories first, and then install all the files:
install:
	install -m 0755 -d $(DESTDIR)$(packagedir)
	install -m 0755 -d $(DESTDIR)$(packagedir)/$(PDF_mappings_other)
	install -m 0755 -d $(DESTDIR)$(packagedir)/$(PDF_mappings_unicode)

	install -m 0644 -p $(PDF_mappings_other)/*   $(DESTDIR)$(packagedir)/$(PDF_mappings_other)/
	install -m 0644 -p $(PDF_mappings_unicode)/* $(DESTDIR)$(packagedir)/$(PDF_mappings_unicode)/

# Other files might be written in $(packagedir), remove only what has been installed:
uninstall:
	rm -rf $(DESTDIR)$(packagedir)/$(PDF_mappings_other)
	rm -rf $(DESTDIR)$(packagedir)/$(PDF_mappings_unicode)

# We are putting the source files into subfolder, same as Github does for its releases:
git-archive:
	git archive -v --format=$(GIT_ARCHIVE_TYPE) --prefix=$(ARCHIVE_NAME)/ HEAD -o $(ARCHIVE_NAME).$(GIT_ARCHIVE_TYPE)

# The --transform option is what will put the source files into a $(ARCHIVE_NAME) subdirectory:
tar.bz2:
	tar --transform="s|^|$(ARCHIVE_NAME)/|" -cjvf $(ARCHIVE_NAME).tar.bz2 $(PDF_mappings_other) $(PDF_mappings_unicode) $(DISTFILES)

tar.gz:
	tar --transform="s|^|$(ARCHIVE_NAME)/|" -czvf $(ARCHIVE_NAME).tar.gz  $(PDF_mappings_other) $(PDF_mappings_unicode) $(DISTFILES)

tar.xz:
	tar --transform="s|^|$(ARCHIVE_NAME)/|" -cJvf $(ARCHIVE_NAME).tar.xz  $(PDF_mappings_other) $(PDF_mappings_unicode) $(DISTFILES)