Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
100 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# make -f .copr/Makefile srpm outdir="/tmp/coprtest" spec="<spec_path>" | ||
outdir = | ||
spec = | ||
|
||
srpm: | ||
yum install -y git || dnf install -y git | ||
$(MAKE) srpm RPM_OUTDIR=$(outdir) RPM_SPEC=$(spec) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
RPM_NAME = vmango | ||
RPM_VERSION = $(VERSION) | ||
RPM_DIST = $(shell rpm --eval '%{dist}') | ||
RPM_TOPDIR = $(shell rpm --eval '%{_topdir}') | ||
RPM_ARCH = $(shell rpm --eval '%{_arch}') | ||
RPM_RELEASE = $(shell git describe --tags 2>/dev/null | awk -F- '{print $$2"."$$3}') | ||
RPM_OUTDIR = . | ||
RPM_SPEC = $(RPM_NAME).spec | ||
|
||
ifeq ($(RPM_RELEASE),.) | ||
RPM_RELEASE = 1 | ||
endif | ||
|
||
ifeq ($(RPM_RELEASE),) | ||
RPM_RELEASE = 1 | ||
endif | ||
|
||
|
||
spec: $(RPM_SPEC) | ||
$(RPM_SPEC): $(RPM_NAME)-$(RPM_VERSION)-$(RPM_RELEASE).spec | ||
cp $(RPM_NAME)-$(RPM_VERSION)-$(RPM_RELEASE).spec $(RPM_SPEC) | ||
$(RPM_NAME)-$(RPM_VERSION)-$(RPM_RELEASE).spec: $(RPM_NAME).spec.in | ||
sed -e "s/@@_VERSION_@@/$(RPM_VERSION)/g" -e "s/@@_RELEASE_@@/$(RPM_RELEASE)/g" $(RPM_NAME).spec.in > $(RPM_NAME)-$(RPM_VERSION)-$(RPM_RELEASE).spec | ||
|
||
srpm: $(RPM_OUTDIR)/$(RPM_NAME)-$(RPM_VERSION)-$(RPM_RELEASE)$(RPM_DIST).src.rpm | ||
$(RPM_OUTDIR)/$(RPM_NAME)-$(RPM_VERSION)-$(RPM_RELEASE)$(RPM_DIST).src.rpm: $(RPM_SPEC) $(RPM_NAME)-$(RPM_VERSION).tar.gz | ||
mkdir -p $(RPM_OUTDIR) | ||
cp $(RPM_NAME)-$(RPM_VERSION).tar.gz $(RPM_TOPDIR)/SOURCES | ||
rpmbuild -bs $(RPM_SPEC) | ||
mv $(RPM_TOPDIR)/SRPMS/$(RPM_NAME)-$(RPM_VERSION)-$(RPM_RELEASE)$(RPM_DIST).src.rpm $(RPM_OUTDIR) | ||
|
||
rpm: $(RPM_OUTDIR)/$(RPM_NAME)-$(RPM_VERSION)-$(RPM_RELEASE)$(RPM_DIST).$(RPM_ARCH).rpm | ||
$(RPM_OUTDIR)/$(RPM_NAME)-$(RPM_VERSION)-$(RPM_RELEASE)$(RPM_DIST).$(RPM_ARCH).rpm: $(RPM_OUTDIR)/$(RPM_NAME)-$(RPM_VERSION)-$(RPM_RELEASE)$(RPM_DIST).src.rpm | ||
mkdir -p $(RPM_OUTDIR) | ||
yum-builddep -y $(RPM_OUTDIR)/$(RPM_NAME)-$(RPM_VERSION)-$(RPM_RELEASE)$(RPM_DIST).src.rpm | ||
rpmbuild --rebuild $(RPM_OUTDIR)/$(RPM_NAME)-$(RPM_VERSION)-$(RPM_RELEASE)$(RPM_DIST).src.rpm | ||
mv $(RPM_TOPDIR)/RPMS/$(RPM_ARCH)/$(RPM_NAME)-$(RPM_VERSION)-$(RPM_RELEASE)$(RPM_DIST).$(RPM_ARCH).rpm $(RPM_OUTDIR)/ | ||
|
||
.PHONY: docker-rpm | ||
docker-rpm: | ||
./dockerbuild.sh centos-7 rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
USAGE="Usage: $0 [centos-7] <make args...>" | ||
CACHE_DIR=/tmp/rpmbuild-cache | ||
|
||
case "$1" in | ||
"centos-7") | ||
DOCKER_IMAGE=vmango:build_centos7 | ||
YUM_CONFIG=`pwd`/dockerbuild/centos7.yum.conf | ||
if [[ "Y$(docker images -q $DOCKER_IMAGE)" == "Y" ]]; then | ||
docker build -t $DOCKER_IMAGE -f dockerbuild/centos7.dockerfile . | ||
fi | ||
;; | ||
*) | ||
echo $USAGE | ||
exit 1 | ||
esac | ||
shift | ||
|
||
mkdir -p $CACHE_DIR | ||
|
||
exec docker run --rm -it \ | ||
-v `pwd`:/source \ | ||
-v $CACHE_DIR:/cache \ | ||
-v $YUM_CONFIG:/etc/yum.conf \ | ||
-w /source \ | ||
$DOCKER_IMAGE $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM centos:7 | ||
|
||
RUN yum install -y rpmdevtools make epel-release git | ||
RUN echo '%_topdir /tmp/buildd' > ~/.rpmmacros && rpmdev-setuptree |
File renamed without changes.