-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.am
152 lines (126 loc) · 5.44 KB
/
Makefile.am
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# vim:noexpandtab:autoindent:tabstop=8:shiftwidth=8:filetype=make:nocindent:tw=0:
AUTOMAKE_OPTIONS = subdir-objects
SUBDIRS =
# dont move these 5 lines, as this is how we override the autoconf version and package name
RELEASE_NAME=@RELEASE_NAME@
RELEASE_MAJOR=@RELEASE_MAJOR@
RELEASE_MINOR=@RELEASE_MINOR@
RELEASE_SUBLEVEL=@RELEASE_SUBLEVEL@
RELEASE_EXTRALEVEL=@RELEASE_EXTRALEVEL@
RELEASE_VERSION = $(RELEASE_MAJOR).$(RELEASE_MINOR).$(RELEASE_SUBLEVEL)$(RELEASE_EXTRALEVEL)
RELEASE_STRING = $(RELEASE_NAME)-$(RELEASE_VERSION)
VERSION = $(RELEASE_VERSION)
PACKAGE = $(RELEASE_NAME)
CLEANFILES=mock-*.tar.gz mock-*.tar.bz2 mock-*.rpm _buildtemp version tests/daemontest
DISTCLEANFILES=*~ mock-unit-test/* x86_64/* noarch/* i386/*
TESTS=./tests/runtests.sh
$(TESTS): srpm
EXTRA_DIST = contrib
bin_PROGRAMS=
CLEANFILES += $(EXTRA_PROGRAMS)
mocketcdir = $(sysconfdir)/mock
mocketc_DATA = $(wildcard $(top_srcdir)/etc/mock/epel*.cfg) \
$(wildcard $(top_srcdir)/etc/mock/fedora*.cfg) \
$(top_srcdir)/etc/mock/site-defaults.cfg \
$(top_srcdir)/etc/mock/logging.ini
mockgpgdir = $(sysconfdir)/pki/mock
mockgpg_DATA = $(wildcard $(top_srcdir)/etc/pki/RPM-GPG-KEY-*)
EXTRA_DIST += docs etc
dist_sbin_SCRIPTS = py/mock.py py/mockchain.py
man_MANS = docs/mock.1 docs/mockchain.1
pamdir = $(sysconfdir)/pam.d/
pam_DATA = etc/pam/mock
consoledir = $(sysconfdir)/security/console.apps/
console_DATA = etc/consolehelper/mock
bashcompdir = @BASHCOMPDIR@
bashcomp_DATA = etc/bash_completion.d/mock
pluginsdir = $(pythondir)/mockbuild/plugins
plugins_PYTHON = \
py/mockbuild/plugins/bind_mount.py \
py/mockbuild/plugins/ccache.py \
py/mockbuild/plugins/compress_logs.py \
py/mockbuild/plugins/package_state.py \
py/mockbuild/plugins/root_cache.py \
py/mockbuild/plugins/tmpfs.py \
py/mockbuild/plugins/yum_cache.py \
py/mockbuild/plugins/selinux.py \
py/mockbuild/plugins/mount.py \
py/mockbuild/plugins/chroot_scan.py \
py/mockbuild/plugins/pm_request.py \
py/mockbuild/plugins/lvm_root.py \
py/mockbuild/plugins/sign.py
mockbuilddir = $(pythondir)/mockbuild
mockbuild_PYTHON = \
py/mockbuild/__init__.py \
py/mockbuild/exception.py \
py/mockbuild/util.py \
py/mockbuild/buildroot.py \
py/mockbuild/package_manager.py \
py/mockbuild/state.py \
py/mockbuild/plugin.py \
py/mockbuild/backend.py \
py/mockbuild/trace_decorator.py \
py/mockbuild/uid.py \
py/mockbuild/scm.py \
py/mockbuild/mounts.py
CLEANFILES += py/*.pyc py/mockbuild/*.pyc py/mockbuild/plugins/*.pyc
dist: ChangeLog AUTHORS
ChangeLog:
(GIT_DIR=.git git log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
AUTHORS:
(GIT_DIR=.git git log | grep ^Author | sort |uniq > .authors.tmp && mv .authors.tmp AUTHORS; rm -f .authors.tmp) || (touch AUTHORS; echo 'git directory not found: installing possibly empty AUTHORS.' >&2)
REPLACE_VARS_ON_INSTALL=$(sbindir)/mock.py $(sbindir)/mockchain.py
install-exec-hook:
for i in $(REPLACE_VARS_ON_INSTALL); do \
file=$(DESTDIR)/$$i ;\
perl -p -i -e 's|^__VERSION__\s*=.*|__VERSION__="$(RELEASE_VERSION)"|' $$file ;\
perl -p -i -e 's|^SYSCONFDIR\s*=.*|SYSCONFDIR="$(sysconfdir)"|' $$file ;\
perl -p -i -e 's|^PYTHONDIR\s*=.*|PYTHONDIR="$(pythondir)"|' $$file ;\
perl -p -i -e 's|^PKGPYTHONDIR\s*=.*|PKGPYTHONDIR="$(mockbuilddir)"|' $$file ;\
perl -p -i -e 's|^PKGDATADIR\s*=.*|PKGDATADIR="$(pkgdatadir)"|' $$file ;\
perl -p -i -e 's|^LIBDIR\s*=.*|LIBDIR="$(libdir)"|' $$file ;\
done
mv $(DESTDIR)/$(sbindir)/mock.py $(DESTDIR)/$(sbindir)/mock
[ -d $(DESTDIR)/$(bindir) ] || mkdir $(DESTDIR)/$(bindir)
mv $(DESTDIR)/$(sbindir)/mockchain.py $(DESTDIR)/$(bindir)/mockchain
install-data-hook:
perl -p -i -e 's|[@]VERSION@|$(RELEASE_VERSION)|' \
$(DESTDIR)$(mandir)/man1/mock.1
perl -p -i -e 's|[@]VERSION@|$(RELEASE_VERSION)|' \
$(DESTDIR)$(mandir)/man1/mockchain.1
perl -p -i -e 's|(=\s*)/etc/mock\b|$$1$(mocketcdir)|' \
$(DESTDIR)$(bashcompdir)/mock
[ ! "@HAVE_BASHCOMP2@" ] || ln -sf mock $(DESTDIR)$(bashcompdir)/mockchain
TOPDIR := $(shell cd $(top_builddir);pwd)
BUILDDIR = $(TOPDIR)/_rpmbuild
RPMDIR = $(TOPDIR)
SOURCEDIR = $(TOPDIR)
SPECDIR = $(TOPDIR)
SRCRPMDIR = $(TOPDIR)
RPM_DEFINES = --define "_topdir $(TOPDIR)" \
--define "_builddir $(BUILDDIR)" \
--define "_rpmdir $(RPMDIR)" \
--define "_sourcedir $(SOURCEDIR)" \
--define "_specdir $(SPECDIR)" \
--define "_srcrpmdir $(SRCRPMDIR)"
RPMBUILD := $(shell if [ -e /usr/bin/rpmbuild-md5 ]; then echo rpmbuild-md5; else echo rpmbuild; fi)
.PHONY: rpm srpm help install-devel-packages
rpm: dist
mkdir -p $(BUILDDIR)
$(RPMBUILD) $(RPM_DEFINES) -ba --nodeps $(PACKAGE_NAME).spec
rm -rf $(BUILDDIR)
srpm: dist
mkdir -p $(BUILDDIR)
$(RPMBUILD) $(RPM_DEFINES) -bs --nodeps $(PACKAGE_NAME).spec
rm -rf $(BUILDDIR)
install-devel-packages:
yum --disablerepo='beaker*' install mock rpm-build fedora-packager vim-enhanced git-all
help:
@echo
@echo "Mock Makefile targets:"
@echo " dist - generate Changelog and Authors file"
@echo " rpm - build binary RPM"
@echo " srpm - build source RPM"
@echo " help - print this message"
@echo "Additionally, all standard automake targets are supported"
@echo