-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
247 lines (216 loc) · 7.38 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
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
#
# Makefile - build wrapper for Samba 4 on RHEL 6
#
# git clone RHEL 6 SRPM building tools from
# https://github.com/nkadel/[package] into designated
# SAMBAPKGS below
#
# Set up local
REPOBASE=file://$(PWD)
#SAMBAPKGS+=python-iso86001-srpm
SAMBAPKGS+=python-pyasn1-srpm
#SAMBAPKGS+=python-nose-srpm
## Compiled directly into Samba package to avoid conflict with sssd
#SAMBAPKGS+=libtalloc-srpm
#SAMBAPKGS+=libtdb-srpm
## Requires libtalloc
#SAMBAPKGS+=libtevent-srpm
## Requires libtalloc,libtdb,libtevent
#SAMBAPKGS+=libldb-srpm
## Current samba release
# Now builds internal libraries rather than:
# libtalloc, libtdb, libtevent, libldb
# Internal libraries avoids conflict with sssd dependencies
SAMBAPKGS+=samba-srpm
REPOS+=samba4repo/el/8
REPOS+=samba4repo/el/9
REPOS+=samba4repo/el/10
REPOS+=samba4repo/fedora/40
REPOS+=samba4repo/amazon/2023
REPODIRS := $(patsubst %,%/x86_64/repodata,$(REPOS)) $(patsubst %,%/SRPMS/repodata,$(REPOS))
CFGS+=samba4repo-8-x86_64.cfg
CFGS+=samba4repo-9-x86_64.cfg
CFGS+=samba4repo-10-x86_64.cfg
CFGS+=samba4repo-f40-x86_64.cfg
# Amazon 2 config
CFGS+=samba4repo-amz2023-x86_64.cfg
# /et/cmock version lacks EPEL
# Link from /etc/mock
MOCKCFGS+=alma+epel-8-x86_64.cfg
MOCKCFGS+=alma+epel-9-x86_64.cfg
MOCKCFGS+=alma+epel-10-x86_64.cfg
MOCKCFGS+=fedora-40-x86_64.cfg
MOCKCFGS+=amazonlinux-2023-x86_64.cfg
all:: install
install:: $(CFGS)
install:: $(MOCKCFGS)
install:: $(REPODIRS)
install:: $(SAMBAPKGS)
# Actually put all the modules in the local repo
.PHONY: install clean getsrc build srpm src.rpm
install clean getsrc build srpm src.rpm::
@for name in $(SAMBAPKGS); do \
(cd $$name && $(MAKE) $(MFLAGS) $@); \
done
# Git submodule checkout operation
# For more recent versions of git, use "git checkout --recurse-submodules"
#*-srpm::
# @[ -d $@/.git ] || \
# git submodule update --init $@
# Samba rellies on all the othe components
# Actually build in directories
.PHONY: $(SAMBAPKGS)
$(SAMBAPKGS)::
(cd $@ && $(MAKE) $(MLAGS) install)
repodirs: $(REPOS) $(REPODIRS)
repos: $(REPOS) $(REPODIRS)
$(REPOS):
install -d -m 755 $@
.PHONY: $(REPODIRS)
$(REPODIRS): $(REPOS)
@install -d -m 755 `dirname $@`
/usr/bin/createrepo -q `dirname $@`
.PHONY: cfg
cfg:: cfgs
.PHONY: cfgs
cfgs: $(CFGS) $(MOCKCFGS)
$(MOCKCFGS)::
@echo Generating $@ from /etc/mock/$@
@echo "include('/etc/mock/$@')" | tee $@
@echo "config_opts['dnf_vars'] = { 'best': 'False' }" | tee -a $@
samba4repo-8-x86_64.cfg: /etc/mock/alma+epel-8-x86_64.cfg
@echo Generating $@ from $?
@echo "include('$?')" | tee $@
@echo "config_opts['dnf_vars'] = { 'best': 'False' }" | tee -a $@
@echo | tee -a $@
@echo Resetting root directory
@echo "config_opts['root'] = 'samba4repo-{{ releasever }}-{{ target_arch }}'" | tee -a $@
@echo "config_opts['dnf.conf'] += \"\"\"" | tee -a $@
@echo '[samba4repo]' | tee -a $@
@echo 'name=samba4repo' | tee -a $@
@echo 'enabled=1' | tee -a $@
@echo 'baseurl=$(REPOBASE)/samba4repo/el/8/x86_64/' | tee -a $@
@echo 'skip_if_unavailable=False' | tee -a $@
@echo 'metadata_expire=0' | tee -a $@
@echo 'gpgcheck=0' | tee -a $@
@echo 'priority=20' | tee -a $@
@echo '"""' | tee -a $@
samba4repo-9-x86_64.cfg: /etc/mock/alma+epel-9-x86_64.cfg
@echo Generating $@ from $?
@echo "include('$?')" | tee $@
@echo "config_opts['dnf_vars'] = { 'best': 'False' }" | tee -a $@
@echo Resetting root directory
@echo "config_opts['root'] = 'samba4repo-{{ releasever }}-{{ target_arch }}'" | tee -a $@
@echo "config_opts['dnf.conf'] += \"\"\"" | tee -a $@
@echo '[samba4repo]' | tee -a $@
@echo 'name=samba4repo' | tee -a $@
@echo 'enabled=1' | tee -a $@
@echo 'baseurl=$(REPOBASE)/samba4repo/el/9/x86_64/' | tee -a $@
@echo 'skip_if_unavailable=False' | tee -a $@
@echo 'metadata_expire=0' | tee -a $@
@echo 'gpgcheck=0' >> $@
@echo 'priority=20' >> $@
@echo '"""' >> $@
samba4repo-10-x86_64.cfg: /etc/mock/alma+epel-10-x86_64.cfg
@echo Generating $@ from $?
@echo "include('$?')" | tee $@
@echo "config_opts['dnf_vars'] = { 'best': 'False' }" | tee -a $@
@echo Resetting root directory
@echo "config_opts['root'] = 'samba4repo-{{ releasever }}-{{ target_arch }}'" | tee -a $@
@echo "config_opts['dnf.conf'] += \"\"\"" | tee -a $@
@echo '[samba4repo]' | tee -a $@
@echo 'name=samba4repo' | tee -a $@
@echo 'enabled=1' | tee -a $@
@echo 'baseurl=$(REPOBASE)/samba4repo/el/10/x86_64/' | tee -a $@
@echo 'skip_if_unavailable=False' | tee -a $@
@echo 'metadata_expire=0' | tee -a $@
@echo 'gpgcheck=0' >> $@
@echo 'priority=20' >> $@
@echo '"""' >> $@
samba4repo-f40-x86_64.cfg: /etc/mock/fedora-40-x86_64.cfg
@echo Generating $@ from $?
@echo "include('$?')" | tee $@
@echo "config_opts['dnf_vars'] = { 'best': 'False' }" | tee -a $@
@echo >> $@
@echo Resetting root directory
@echo "config_opts['root'] = 'samba4repo-{{ releasever }}-{{ target_arch }}'" >> $@
@echo "config_opts['dnf.conf'] += \"\"\"" >> $@
@echo '[samba4repo]' >> $@
@echo 'name=samba4repo' >> $@
@echo 'enabled=1' >> $@
@echo 'baseurl=$(REPOBASE)/samba4repo/fedora/40/x86_64/' >> $@
@echo 'skip_if_unavailable=False' >> $@
@echo 'metadata_expire=0' >> $@
@echo 'gpgcheck=0' >> $@
@echo 'priority=20' >> $@
@echo '"""' >> $@
samba4repo-rawhide-x86_64.cfg: /etc/mock/fedora-rawhide-x86_64.cfg
@echo Generating $@ from $?
@echo "include('$?')" | tee $@
@echo "config_opts['dnf_vars'] = { 'best': 'False' }" | tee -a $@
@sed -i "s/^config_opts\['root'\] =/#config_opts\['root'\] =/g" $@
@echo >> $@
@echo Resetting root directory
@echo "config_opts['root'] = 'samba4repo-{{ releasever }}-{{ target_arch }}'" >> $@
@echo "config_opts['yum.conf'] += \"\"\"" >> $@
@echo '[samba4repo]' >> $@
@echo 'name=samba4repo' >> $@
@echo 'enabled=1' >> $@
@echo 'baseurl=$(REPOBASE)/samba4repo/fedora/rawhide/x86_64/' >> $@
@echo 'skip_if_unavailable=False' >> $@
@echo 'metadata_expire=0' >> $@
@echo 'gpgcheck=0' >> $@
@echo 'priority=20' >> $@
@echo '"""' >> $@
samba4repo-amz2023-x86_64.cfg: /etc/mock/amazonlinux-2023-x86_64.cfg
@echo Generating $@ from $?
@echo "include('$?')" | tee $@
@echo "config_opts['dnf_vars'] = { 'best': 'False' }" | tee -a $@
@echo >> $@
@echo Resetting root directory
@echo "config_opts['root'] = 'samba4repo-{{ releasever }}-{{ target_arch }}'" >> $@
@echo "config_opts['dnf.conf'] += \"\"\"" >> $@
@echo '[samba4repo]' >> $@
@echo 'name=samba4repo' >> $@
@echo 'enabled=1' >> $@
@echo 'baseurl=$(REPOBASE)/samba4repo/amazon/2023/x86_64/' >> $@
@echo 'skip_if_unavailable=False' >> $@
@echo 'metadata_expire=0' >> $@
@echo 'gpgcheck=0' >> $@
@echo 'priority=20' >> $@
@echo '"""' >> $@
repo: samba4repo.repo
samba4repo.repo:: Makefile samba4repo.repo.in
if [ -s /etc/fedora-release ]; then \
cat $@.in | \
sed "s|@REPOBASEDIR@/|$(PWD)/|g" | \
sed "s|/@RELEASEDIR@/|/fedora/|g" | tee $@; \
elif [ -s /etc/redhat-release ]; then \
cat $@.in | \
sed "s|@REPOBASEDIR@/|$(PWD)/|g" | \
sed "s|/@RELEASEDIR@/|/el/|g" | tee $@; \
else \
echo Error: unknown release, check /etc/*-release; \
exit 1; \
fi
samba4repo.repo::
@cmp -s $@ /etc/yum.repos.d/$@ || \
diff -u $@ /etc/yum.repos.d/$@
clean::
find . -name \*~ -exec rm -f {} \;
rm -f *.cfg
rm -f *.out
@for name in $(SAMBAPKGS); do \
$(MAKE) -C $$name clean; \
done
distclean: clean
rm -rf $(REPOS)
rm -rf samba4repo
@for name in $(SAMBAPKGS); do \
(cd $$name; git clean -x -d -f); \
done
maintainer-clean: distclean
rm -rf $(SAMBAPKGS)
@for name in $(SAMBAPKGS); do \
(cd $$name; git clean -x -d -f); \
done