Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
08999a2a
Commit
08999a2a
authored
Aug 01, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #748 from dagwieers/make-rpm
Implement git commit date into RPM release
parents
3ff03d14
6b774f8c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
Makefile
+18
-6
No files found.
Makefile
View file @
08999a2a
...
...
@@ -28,13 +28,21 @@ SITELIB = $(shell python -c "from distutils.sysconfig import get_python_lib; pri
# VERSION file provides one place to update the software version
VERSION
:=
$(
shell
cat
VERSION
)
### Get the branch information from git
ifneq
($(shell
which
git),)
GIT_DATE
:=
$(
shell
git log
-n
1
--format
=
"%ai"
)
endif
DATE
:=
$(
shell
date
--date
=
"
$(GIT_DATE)
"
+%Y%m%d%H%M
)
# RPM build parameters
RPMSPECDIR
=
packaging/rpm
RPMSPEC
=
$(RPMSPECDIR)
/ansible.spec
RPMVERSION
:=
$(
shell
awk
'/Version/{print $$2; exit}'
<
$(RPMSPEC)
| cut
-d
"%"
-f1
)
RPMRELEASE
:=
$(
shell
awk
'/Release/{print $$2; exit}'
<
$(RPMSPEC)
| cut
-d
"%"
-f1
)
RPMDIST
=
$(
shell
rpm
--eval
'%dist'
)
RPMNVR
=
"
$(NAME)
-
$(RPMVERSION)
-
$(RPMRELEASE)$(RPMDIST)
"
RPMRELEASE
=
1
ifeq
($(OFFICIAL),)
RPMRELEASE
=
0.git
$(DATE)
endif
RPMNVR
=
"
$(NAME)
-
$(VERSION)
-
$(RPMRELEASE)$(RPMDIST)
"
########################################################
...
...
@@ -102,6 +110,7 @@ sdist: clean
rpmcommon
:
sdist
@
mkdir
-p
rpm-build
@
cp dist/
*
.gz rpm-build/
@
sed
-e
's#^Version:.*#Version:
$(VERSION)
#'
-e
's#^Release:.*#Release:
$(RPMRELEASE)
%{?dist}#'
$(RPMSPEC)
>
rpm-build/
$(NAME)
.spec
srpm
:
rpmcommon
@
rpmbuild
--define
"_topdir %(pwd)/rpm-build"
\
...
...
@@ -110,7 +119,8 @@ srpm: rpmcommon
--define
"_srcrpmdir %{_topdir}"
\
--define
"_specdir
$(RPMSPECDIR)
"
\
--define
"_sourcedir %{_topdir}"
\
-bs
$(RPMSPEC)
-bs
rpm-build/
$(NAME)
.spec
@
rm
-f
rpm-build/
$(NAME)
.spec
@
echo
"#############################################"
@
echo
"Ansible SRPM is built:"
@
echo
" rpm-build/
$(RPMNVR)
.src.rpm"
...
...
@@ -123,10 +133,12 @@ rpm: rpmcommon
--define
"_srcrpmdir %{_topdir}"
\
--define
"_specdir
$(RPMSPECDIR)
"
\
--define
"_sourcedir %{_topdir}"
\
-ba
$(RPMSPEC)
--define
"_rpmfilename
$(RPMNVR)
.%%{ARCH}.rpm"
\
-ba
rpm-build/
$(NAME)
.spec
@
rm
-f
rpm-build/
$(NAME)
.spec
@
echo
"#############################################"
@
echo
"Ansible RPM is built:"
@
echo
" rpm-build/
noarch/
$(RPMNVR)
.noarch.rpm"
@
echo
" rpm-build/
$(RPMNVR)
.noarch.rpm"
@
echo
"#############################################"
debian
:
sdist
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment