-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
57 lines (45 loc) · 1.52 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
ARCH=x86_64
VERSION=$(shell grep version Makefile.PL | cut -d\' -f2)
SPECFILE=$(shell find -maxdepth 1 -name \*.spec -exec basename {} \; )
REPOURL=git+ssh://git@gitlab.cern.ch:7999
# gitlab group
REPOPREFIX=/db
# Get all the package infos from the spec file
PKGVERSION=$(shell awk '/Version:/ { print $$2 }' ${SPECFILE})
PKGRELEASE=$(shell awk '/Release:/ { print $$2 }' ${SPECFILE} | sed -e 's/\%{?dist}//')
PKGNAME=$(shell awk '/Name:/ { print $$2 }' ${SPECFILE})
PKGID=$(PKGNAME)-$(PKGVERSION)
TARFILE=$(PKGID).tar.gz
# This is Koji required and must generate a suitable tarball
#
# If we have the tarball tracked on Git the tar pre-step can
# be removed.
#
# Executing this steps overwrites the Makefile with the one
# generated on the compile: target
gen-sources:
perl Makefile.PL
make
make dist
git checkout Makefile
sources:
tar xvzf DBOD-$(VERSION).tar.gz
cp -r bin DBOD-$(VERSION)
cp -r profile.d DBOD-$(VERSION)
cp -r resources DBOD-$(VERSION)
tar cvzf DBOD-$(VERSION).tar.gz DBOD-$(VERSION)
clean:
rm -f DBOD-*.tar.gz
all: sources
srpm: all
rpmbuild -bs --define "_topdir ${PWD}" --define "_sourcedir $(PWD)" ${SPECFILE}
rpm: all
rpmbuild -ba --define "_topdir ${PWD}" --define "_sourcedir $(PWD)" ${SPECFILE}
scratch:
koji build db7 --nowait --scratch ${REPOURL}${REPOPREFIX}/${PKGNAME}.git#master
build:
koji build db7 --nowait ${REPOURL}${REPOPREFIX}/${PKGNAME}.git#master
tag-qa:
koji tag-build db7-qa $(PKGID)-$(PKGRELEASE).el7.cern
tag-stable:
koji tag-build db7-stable $(PKGID)-$(PKGRELEASE).el7.cern