forked from patternfly/patternfly-3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (49 loc) · 1.51 KB
/
Makefile
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
PACKAGE_NAME=patternfly
VERSION=2.6.1
MILESTONE=master
ifneq ($(MILESTONE),)
SUFFIX:=_$(MILESTONE)
endif
PACKAGE_VERSION=$(VERSION)$(SUFFIX)
PACKAGE_RPM_VERSION=$(VERSION)
# for milestones
PACKAGE_RPM_RELEASE=0.0.$(MILESTONE)
# for releases
# PACKAGE_RPM_RELEASE=1
ABI=2
PREFIX=/usr/local
DATAROOT_DIR=$(PREFIX)/share
PKG_DATA_DIR=$(DATAROOT_DIR)/$(PACKAGE_NAME)
RESOURCES_DIR=$(DATAROOT_DIR)/patternfly$(ABI)/resources
.SUFFIXES:
.SUFFIXES: .in
all: patternfly.spec
rm -fr build
mkdir -p build/components
cp -r dist/* build
cp -r components/* build/components/
sed -i "s#../../components#../components#g" \
build/css/patternfly*.css \
$(NULL)
clean:
rm -rf build
install: all
install -d -m 0755 "$(DESTDIR)$(RESOURCES_DIR)"
cp -r build/* "$(DESTDIR)$(RESOURCES_DIR)"
find "$(DESTDIR)$(RESOURCES_DIR)" -type d -exec chmod 0755 {} +
find "$(DESTDIR)$(RESOURCES_DIR)" -type f -exec chmod 0644 {} +
.PHONY: patternfly.spec.in
dist: patternfly.spec
TMP="$$(mktemp -d)" && mkdir "$${TMP}/$(PACKAGE_NAME)-$(PACKAGE_VERSION)" && \
git ls-files | \
tar --files-from /proc/self/fd/0 -c patternfly.spec | \
tar -C "$${TMP}/$(PACKAGE_NAME)-$(PACKAGE_VERSION)" -x && \
tar -C "$${TMP}" -czf "$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz" "$(PACKAGE_NAME)-$(PACKAGE_VERSION)"; \
rm -fr "$${TMP}"
.in:
sed \
-e 's/@PACKAGE_NAME@/$(PACKAGE_NAME)/g' \
-e 's/@PACKAGE_VERSION@/$(PACKAGE_VERSION)/g' \
-e 's/@PACKAGE_RPM_VERSION@/$(PACKAGE_RPM_VERSION)/g' \
-e 's/@PACKAGE_RPM_RELEASE@/$(PACKAGE_RPM_RELEASE)/g' \
$< > $@