-
Notifications
You must be signed in to change notification settings - Fork 2
/
rpm.mk.in
60 lines (48 loc) · 2.41 KB
/
rpm.mk.in
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
# -*- makefile -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
# make rules to generate MonetDB RPMs (works on Fedora, only)
rpmtopdir = $(shell cd $(top_builddir) && pwd)/rpmbuild
RPMBUILDARGS = --define="_tmppath /tmp" --define="_topdir $(rpmtopdir)" --define="tmpdir %{_tmppath}" --define="rpmcflags -O2 " --define="packager MonetDB Database System <[email protected]>" --define="_@LIBLAS_RPM@_lidar 1"
$(top_builddir)/$(distdir).tar.bz2:
$(MAKE) $(AM_MAKEFLAGS) dist-bzip2
$(top_builddir)/$(distdir).tar.xz:
$(MAKE) $(AM_MAKEFLAGS) dist-xz
$(rpmtopdir)/rpmmacros:
mkdir -p $(rpmtopdir)/RPMS
mkdir -p $(rpmtopdir)/SRPMS
mkdir -p $(rpmtopdir)/SPECS
mkdir -p $(rpmtopdir)/BUILD
mkdir -p $(rpmtopdir)/INSTALL
rpm: MonetDB.spec $(top_builddir)/$(distdir).tar.bz2 $(rpmtopdir)/rpmmacros
$(RPMBUILD) $(RPMBUILDARGS) --define="dist _@LINUX_DIST@" -ta --target `uname -m` --define="comp_cc @CC@" $(top_builddir)/$(distdir).tar.bz2
srpm: MonetDB.spec $(top_builddir)/$(distdir).tar.bz2 $(rpmtopdir)/rpmmacros
$(RPMBUILD) $(RPMBUILDARGS) --define="dist %{?undefined}" -ts $(top_builddir)/$(distdir).tar.bz2
all: monetdb_hgversion.h
monetdb_hgversion.h: always
if [ -d "$(srcdir)"/.hg ] && hgid=`(cd "$(srcdir)"; hg id -i) 2>/dev/null`; then \
echo "#define MERCURIAL_ID \"$$hgid\"" > monetdb_hgversion.h.new; \
if [ -f monetdb_hgversion.h ] && cmp -s monetdb_hgversion.h monetdb_hgversion.h.new; then \
rm -f monetdb_hgversion.h.new; \
else \
mv -f monetdb_hgversion.h.new monetdb_hgversion.h; \
fi; \
elif [ -d "$(srcdir)"/.git ]; then \
hgid=`(cd "$(srcdir)"; git log -1 | sed -n '/Notes (hg):/,$$p' | grep -v Notes | sed 's/^ \+\(............\).*/\1/') 2>/dev/null`; \
dirty=`(cd "$(srcdir)"; [[ -z $$(git status -s) ]] || echo "+")`; \
if [ -z "$${hgid}" ]; then \
hgid="`(cd "$(srcdir)"; git rev-parse --short HEAD)` (git)"; \
fi; \
echo "#define MERCURIAL_ID \"$$hgid$$dirty\"" > monetdb_hgversion.h.new; \
if [ -f monetdb_hgversion.h ] && cmp -s monetdb_hgversion.h monetdb_hgversion.h.new; then \
rm -f monetdb_hgversion.h.new; \
else \
mv -f monetdb_hgversion.h.new monetdb_hgversion.h; \
fi; \
elif [ ! -f monetdb_hgversion.h ]; then \
touch monetdb_hgversion.h; \
fi
always: