forked from Sednai/pg-strom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (58 loc) · 2.49 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
57
58
59
60
61
62
63
64
65
66
# ----------------------------------------
#
# Makefile for packaging
#
# ----------------------------------------
include Makefile.common
__PGSTROM_TGZ := pg_strom-$(PGSTROM_VERSION)
PGSTROM_TGZ := $(__PGSTROM_TGZ).tar.gz
__SOURCEDIR = $(shell rpmbuild -E %{_sourcedir})
__SPECDIR = $(shell rpmbuild -E %{_specdir})
rpm: rpm-pg_strom
all: rpm-pg_strom rpm-mysql2arrow rpm-pcap2arrow
tarball:
git archive --format=tar.gz \
--prefix=$(__PGSTROM_TGZ)/ \
-o $(PGSTROM_TGZ) $(GITHASH) \
LICENSE Makefile Makefile.common \
src arrow-tools test/ssbm
rpm-pg_strom: tarball
cp -f $(PGSTROM_TGZ) $(__SOURCEDIR) || exit 1
git show --format=raw $(GITHASH):files/systemd-pg_strom.conf > \
$(__SOURCEDIR)/systemd-pg_strom.conf || exit 1
(git show --format=raw $(GITHASH):files/pg_strom.spec.in | \
sed -e "s/@@STROM_VERSION@@/$(VERSION)/g" \
-e "s/@@STROM_RELEASE@@/$(RELEASE)/g" \
-e "s/@@STROM_TARBALL@@/$(__PGSTROM_TGZ)/g" \
-e "s/@@PGSTROM_GITHASH@@/$(GITHASH)/g" \
-e "s/@@PGSQL_VERSION@@/$(PG_MAJORVERSION)/g";\
git show --format=raw $(GITHASH):CHANGELOG) > \
$(__SPECDIR)/pg_strom-PG$(PG_MAJORVERSION).spec
rpmbuild -ba $(__SPECDIR)/pg_strom-PG$(PG_MAJORVERSION).spec \
--undefine=_debugsource_packages
rpm-mysql2arrow: tarball
cp -f $(PGSTROM_TGZ) $(__SOURCEDIR) || exit 1
git show --format=raw $(GITHASH):files/mysql2arrow.spec.in | \
sed -e "s/@@STROM_VERSION@@/$(VERSION)/g" \
-e "s/@@STROM_RELEASE@@/$(RELEASE)/g" \
-e "s/@@STROM_TARBALL@@/$(__PGSTROM_TGZ)/g" \
-e "s/@@PGSTROM_GITHASH@@/$(GITHASH)/g" > \
$(__SPECDIR)/mysql2arrow.spec
git show --format=raw $(GITHASH):files/pg_strom.spec.in | \
awk 'BEGIN {flag=0;} /^%changelog$$/{flag=1; next;} { if (flag>0) print; }' >> \
$(__SPECDIR)/mysql2arrow.spec
rpmbuild -ba $(__SPECDIR)/mysql2arrow.spec \
--undefine=_debugsource_packages
rpm-pcap2arrow: tarball
cp -f $(PGSTROM_TGZ) $(__SOURCEDIR) || exit 1
git show --format=raw $(GITHASH):files/pcap2arrow.spec.in | \
sed -e "s/@@STROM_VERSION@@/$(VERSION)/g" \
-e "s/@@STROM_RELEASE@@/$(RELEASE)/g" \
-e "s/@@STROM_TARBALL@@/$(__PGSTROM_TGZ)/g" \
-e "s/@@PGSTROM_GITHASH@@/$(GITHASH)/g" > \
$(__SPECDIR)/pcap2arrow.spec
git show --format=raw $(GITHASH):files/pg_strom.spec.in | \
awk 'BEGIN {flag=0;} /^%changelog$$/{flag=1; next;} { if (flag>0) print; }' >> \
$(__SPECDIR)/mysql2arrow.spec
rpmbuild -ba $(__SPECDIR)/pcap2arrow.spec \
--undefine=_debugsource_packages