mirror of
https://github.com/clearlinux/common.git
synced 2026-06-16 19:16:00 +00:00
Compare commits
76 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d5cdd5d1c5 | |||
| 806a1f5593 | |||
| b82d61d686 | |||
| d7404ca99d | |||
| c81774a23c | |||
| b1ef20b90b | |||
| b100150ca3 | |||
| 482940952d | |||
| b50fabd346 | |||
| c383979d14 | |||
| 08138ad889 | |||
| b78940d18a | |||
| bb74ceef8d | |||
| 12800a51fa | |||
| 9b445f1116 | |||
| 40898f6ce0 | |||
| 3b4b1b3053 | |||
| e26fd3e022 | |||
| 677fe6cbd5 | |||
| 9e54179aea | |||
| 1145477b30 | |||
| 19cb72b28e | |||
| 497059b257 | |||
| fbda0655f2 | |||
| 1b32d114f3 | |||
| 90a4ceb162 | |||
| 2947369532 | |||
| 26bb3f43f8 | |||
| fd509a2295 | |||
| eb4fcd4085 | |||
| 4fd9e54785 | |||
| 5bc6cc856b | |||
| 3bfdb39ee1 | |||
| b495687f7c | |||
| c719db89dd | |||
| ba9e38f3f0 | |||
| 0d4b01ec83 | |||
| 4867cefcb7 | |||
| e88fcdc4bc | |||
| a381875001 | |||
| 114936fc23 | |||
| 3739bc0e0f | |||
| f43a186a78 | |||
| da562cb750 | |||
| 16467cfbc0 | |||
| 16466cac02 | |||
| 6e8d00eb30 | |||
| c160c30218 | |||
| 9b09c217da | |||
| 00230e7d1d | |||
| ff40498428 | |||
| 6483c7dd86 | |||
| d1079234d9 | |||
| 51a2c03a4a | |||
| 3d8c98b0d8 | |||
| 243ad03d32 | |||
| e1072736aa | |||
| 9a557531f4 | |||
| d8cb4987e5 | |||
| 6719c0f7df | |||
| 7166df721b | |||
| a70cf49f45 | |||
| 781eae34bb | |||
| ee17bc50a9 | |||
| 1fcfde404c | |||
| 36716ffe26 | |||
| eab92f6841 | |||
| 903919de2f | |||
| 69000f2f2e | |||
| 8b8f649dcb | |||
| 91ba5c1c6b | |||
| 70e5280ae4 | |||
| dbc677ddca | |||
| c2ff34b4ca | |||
| df917a0aa2 | |||
| c0e95c9bcd |
+41
-33
@@ -12,9 +12,9 @@ SHELL = /bin/bash
|
||||
SPECFILE = $(addsuffix .spec, $(PKG_NAME))
|
||||
|
||||
SRPMVERS = $(shell [ ! -f $(SPECFILE) ] || rpmspec -D '_vendor clr' --srpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}\n' $(SPECFILE))
|
||||
SRPMFILE = results/srpm/$(SRPMVERS).src.rpm
|
||||
SRPMFILE = results/$(SRPMVERS).src.rpm
|
||||
|
||||
LATEST_RPMS = $(shell [ ! -s results/logs/build.log ] || for r in `egrep 'Wrote.*/RPMS/.*.rpm' results/logs/build.log | sed 's/.*\///;s/.*debuginfo/debuginfo\/&/'` ; do echo "results/$$r"; done)
|
||||
LATEST_RPMS = $(wildcard rpms/*.rpm)
|
||||
RPMS ?= $(LATEST_RPMS)
|
||||
|
||||
WITH_SUDO = $(shell cmp /usr/bin/mock /usr/sbin/mock &> /dev/null && echo sudo )
|
||||
@@ -28,16 +28,18 @@ __missingsources := $(filter-out $(wildcard ${__allsources}), ${__allsources})
|
||||
endif
|
||||
|
||||
$(SPECFILE):
|
||||
@echo Error: $(SPECFILE) is missing. Please run \`make autospec\` to try and auto
|
||||
@echo Error: generate one for you.
|
||||
@exit 1
|
||||
@[[ -f "$@" ]] || (\
|
||||
echo Error: $@ is missing. Please run \`make autospec\` to try and auto;\
|
||||
echo Error: generate one for you.;\
|
||||
exit 1 )
|
||||
|
||||
upstream:
|
||||
@echo Error: The \"upstream\" file is missing. Try running \`make autospec\` to
|
||||
@echo Error: auto generate one for you. If you are not using autospec to
|
||||
@echo Error: generate a spec file, specify the proper "Source*" entries in the
|
||||
@echo Error: spec header, and try running \`make generateupstream\`.
|
||||
@exit 1
|
||||
@[[ -f "$@" ]] || (\
|
||||
echo Error: The \"$@\" file is missing. Try running \`make autospec\` to;\
|
||||
echo Error: auto generate one for you. If you are not using autospec to;\
|
||||
echo Error: generate a spec file, specify the proper "Source*" entries in the;\
|
||||
echo Error: spec header, and try running \`make generateupstream\`.;\
|
||||
exit 1 )
|
||||
|
||||
#help spdxcheck: Checks that the package license is a valid SPDX license,
|
||||
#help or that it is in the exceptions list.
|
||||
@@ -91,24 +93,20 @@ prebuild-checks:
|
||||
#help Use MOCK_OPTS environment varible to pass down arbitrary mock options.
|
||||
build: prebuild-checks configemail $(SPECFILE) upstream $(SRPMFILE)
|
||||
$(MOCK) $(SRPMFILE) --result=results/ --no-cleanup-after --uniqueext=$(PKG_NAME)
|
||||
mkdir -p results/logs results/debuginfo
|
||||
mv results/*.log results/logs
|
||||
-mv results/*-debuginfo*.rpm results/debuginfo/
|
||||
@perl $(TOPLVL)/projects/common/logcheck.pl results/logs/build.log
|
||||
@perl $(TOPLVL)/projects/common/count.pl results/logs/build.log &> testresults
|
||||
$(MAKE) link-new-rpms PKG_REPO_DIR="."
|
||||
@perl $(TOPLVL)/projects/common/logcheck.pl results/build.log
|
||||
@perl $(TOPLVL)/projects/common/count.pl results/build.log &> testresults
|
||||
@$(MAKE) checkblacklist
|
||||
|
||||
#help build-nocheck: Same as 'make build', but do not run the package's test suite.
|
||||
build-nocheck: configemail $(SPECFILE) upstream $(SRPMFILE)
|
||||
$(MOCK) $(SRPMFILE) --nocheck --result=results/ --no-cleanup-after --uniqueext=$(PKG_NAME)
|
||||
mkdir -p results/logs results/debuginfo
|
||||
mv results/*.log results/logs
|
||||
-mv results/*-debuginfo*.rpm results/debuginfo/
|
||||
@perl $(TOPLVL)/projects/common/logcheck.pl results/logs/build.log
|
||||
@perl $(TOPLVL)/projects/common/count.pl results/logs/build.log &> testresults
|
||||
$(MAKE) link-new-rpms PKG_REPO_DIR="."
|
||||
@perl $(TOPLVL)/projects/common/logcheck.pl results/build.log
|
||||
@perl $(TOPLVL)/projects/common/count.pl results/build.log &> testresults
|
||||
@$(MAKE) checkblacklist
|
||||
|
||||
fmvpatches: results/logs/build.log
|
||||
fmvpatches: results/build.log
|
||||
@perl $(TOPLVL)/projects/common/fmvpatches.pl $(PKG_NAME)
|
||||
|
||||
#help rootshell: Puts you in a root shell at the top of your build root.
|
||||
@@ -121,9 +119,11 @@ shell:
|
||||
|
||||
# Always rebuild the source rpm
|
||||
.PHONY: $(SRPMFILE)
|
||||
$(SRPMFILE): $(SPECFILE) $(__allsources) localreponotice
|
||||
$(SRPMFILE): $(SPECFILE) $(__allsources) localreponotice clean-old-content
|
||||
@$(MAKE) spdxcheck
|
||||
$(MOCK) --buildsrpm --source=./ --spec=$(SPECFILE) --result=results/srpm/ --no-cleanup-after --uniqueext=$(PKG_NAME)
|
||||
$(MOCK) --buildsrpm --source=./ --spec=$(SPECFILE) --result=results/ --no-cleanup-after --uniqueext=$(PKG_NAME)
|
||||
mv results/root.log results/srpm-root.log
|
||||
mv results/build.log results/srpm-build.log
|
||||
|
||||
# Do a git fetch and a git rebase to apply local commits on top of latest
|
||||
# commits from the remote. A git fetch/rebase is used rather than a git pull so
|
||||
@@ -160,8 +160,7 @@ pullrebase:
|
||||
#help Use MOCK_OPTS environment varible to pass down arbitrary mock options
|
||||
#help to autospec.
|
||||
#help For more information, see the project at https://github.com/clearlinux/autospec
|
||||
autospec: pullrebase localreponotice
|
||||
rm -f results/srpm/*src.rpm
|
||||
autospec: pullrebase localreponotice clean-old-content
|
||||
@if [ -e $(SPECFILE) ] && ! grep -q "# Generated by: autospec.py" $(SPECFILE) ; then \
|
||||
echo "Specfile already exists and was not created by autospec.py! Aborting."; \
|
||||
exit 1; \
|
||||
@@ -178,6 +177,7 @@ autospec: pullrebase localreponotice
|
||||
$${SETVERSION:+ --version $${SETVERSION}} \
|
||||
${NON_INTERACTIVE} ${SKIP_GIT} ${CLEANUP} \
|
||||
$(firstword $(NEWURL) $(URL));
|
||||
$(MAKE) link-new-rpms PKG_REPO_DIR="."
|
||||
@$(MAKE) spdxcheck
|
||||
@$(MAKE) checkblacklist
|
||||
@if [ -e update_changelog.sh ] && [ -z "$$SKIP_GIT" ] ; then \
|
||||
@@ -327,7 +327,7 @@ rekoji-nowait:
|
||||
$(MAKE) KOJI_NOWAIT="--nowait --background" rekoji
|
||||
|
||||
logcheck:
|
||||
@perl $(TOPLVL)/projects/common/logcheck.pl results/logs/build.log
|
||||
@perl $(TOPLVL)/projects/common/logcheck.pl results/build.log
|
||||
|
||||
$(TOPLVL)/repo:
|
||||
@echo "Creating local RPM repository $(TOPLVL)/repo"
|
||||
@@ -337,19 +337,24 @@ $(TOPLVL)/repo:
|
||||
#help repoadd: Adds locally-built RPMs for this package to the local RPM
|
||||
#help repository. If this repository does not yet exist, it is created and
|
||||
#help enabled.
|
||||
repoadd: results/logs/build.log $(TOPLVL)/repo
|
||||
@if [ -z "`grep '^Wrote: .*$(shell basename $(SRPMFILE))$$' results/logs/build.log`" ]; then \
|
||||
echo "You have not yet succesfully built this release yet"; exit 1; \
|
||||
fi
|
||||
@if [ -f .repo-index ]; then \
|
||||
repoadd: $(TOPLVL)/repo
|
||||
@if [ -z "${LATEST_RPMS}" ]; then \
|
||||
echo "No rpms found in rpms/ directory."; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
if [ -f .repo-index ]; then \
|
||||
echo "Cleaning old rpms:"; \
|
||||
for r in `cat .repo-index`; do \
|
||||
echo "-$$r"; \
|
||||
rm -f $(TOPLVL)/repo/$$r; \
|
||||
done; \
|
||||
rm .repo-index; \
|
||||
fi
|
||||
for r in $(LATEST_RPMS); do echo "+$$r"; echo $$(basename $$r) >> .repo-index; cp $$r $(TOPLVL)/repo; done
|
||||
fi; \
|
||||
for r in ${LATEST_RPMS}; do \
|
||||
echo "+$$r"; \
|
||||
echo $$(basename $$r) >> .repo-index; \
|
||||
ln -f $$r $(TOPLVL)/repo/; \
|
||||
done
|
||||
$(MAKE) localrepocreate
|
||||
$(call localrepoenable,${PM_CONF},${MOCK_CONF})
|
||||
|
||||
@@ -430,3 +435,6 @@ drop-abandoned: $(SPECFILE)
|
||||
|
||||
# Define site local common targets in a separate makefile
|
||||
-include $(TOPLVL)/projects/common/Makefile.common.site_local
|
||||
|
||||
# Include optional extended makefiles from individual package repos
|
||||
-include Makefile.custom
|
||||
|
||||
@@ -138,6 +138,30 @@ localreponotice:
|
||||
[ -f $(TOPLVL)/repo/opt-in-build ] || sleep 3; \
|
||||
fi >&2
|
||||
|
||||
.PHONY: clean-old-rpms clean-old-logs clean-old-content
|
||||
clean-old-rpms:
|
||||
rm -rf ./rpms
|
||||
rm -f ./results/*.rpm
|
||||
|
||||
clean-old-logs:
|
||||
rm -f ./results/*.log
|
||||
|
||||
clean-old-content: clean-old-rpms clean-old-logs
|
||||
|
||||
.PHONY: require-pkg-repo-dir link-new-rpms
|
||||
require-pkg-repo-dir:
|
||||
@if [ -z ${PKG_REPO_DIR} ]; then \
|
||||
echo "Please specify PKG_REPO_DIR to indicate package repo location."; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
link-new-rpms: require-pkg-repo-dir
|
||||
mkdir -p ${PKG_REPO_DIR}/rpms
|
||||
rm -f ${PKG_REPO_DIR}/rpms/*.rpm
|
||||
find ${PKG_REPO_DIR}/results -maxdepth 1 -name '*.rpm' -exec ln {} ${PKG_REPO_DIR}/rpms/ \;
|
||||
rm -f ${PKG_REPO_DIR}/rpms/*.src.rpm
|
||||
|
||||
|
||||
.PHONY: help
|
||||
##### Code
|
||||
# Make sure that HELPSPACE has exactly HELPLEN spaces in it
|
||||
|
||||
+13
-12
@@ -136,11 +136,11 @@ clean-pkgs-dir: $(PACKAGES_FILE)
|
||||
done
|
||||
@echo "packages directory cleaned";
|
||||
|
||||
clean_PKGS = $(addprefix clean_,$(PKGS))
|
||||
clean_PKGS = $(addprefix clean_,$(PKGS_LOCAL))
|
||||
#help clean: Run 'make clean' for every package.
|
||||
clean: $(clean_PKGS)
|
||||
|
||||
proper_PKGS = $(addprefix proper_,$(PKGS))
|
||||
proper_PKGS = $(addprefix proper_,$(PKGS_LOCAL))
|
||||
#help proper: Run 'make proper' for every package, and purge the local
|
||||
#help repo and image.
|
||||
proper: $(proper_PKGS)
|
||||
@@ -154,34 +154,34 @@ proper: $(proper_PKGS)
|
||||
|
||||
$(clean_PKGS):
|
||||
@echo "cleaning $(patsubst clean_%,%,$@)"
|
||||
-@$(MAKE) -s -j -C $(addprefix packages/,$(patsubst clean_%,%,$@)) clean
|
||||
-@$(MAKE) -s -C $(addprefix packages/,$(patsubst clean_%,%,$@)) clean
|
||||
|
||||
$(proper_PKGS):
|
||||
-@$(MAKE) -s -j -C $(addprefix packages/,$(patsubst proper_%,%,$@)) proper
|
||||
-@$(MAKE) -s -C $(addprefix packages/,$(patsubst proper_%,%,$@)) proper
|
||||
|
||||
#help status: Runs git status for all package repos, thus displaying untracked
|
||||
#help and unstaged files in addition to staged files.
|
||||
status: $(PACKAGES_FILE) $(addprefix packages/,$(PKGS))
|
||||
@for p in projects/common $(addprefix packages/,$(PKGS)); do \
|
||||
status: $(PACKAGES_FILE) $(addprefix packages/,$(PKGS_LOCAL))
|
||||
@for p in projects/common $(addprefix packages/,$(PKGS_LOCAL)); do \
|
||||
if [ -d "$$p/.git" ] && [ -n "$$(git -C $$p status -uno --porcelain)" ]; then echo "Uncommitted changes in $$p:"; git -C "$$p" status --short; fi ;\
|
||||
done
|
||||
|
||||
#help diff: Runs git diff for all package repos and displays the output using
|
||||
#help diffstat. Requires that diffstat is installed.
|
||||
diff: $(PACKAGES_FILE) $(addprefix packages/,$(PKGS))
|
||||
@for p in projects/common $(addprefix packages/,$(PKGS)); do \
|
||||
diff: $(PACKAGES_FILE) $(addprefix packages/,$(PKGS_LOCAL))
|
||||
@for p in projects/common $(addprefix packages/,$(PKGS_LOCAL)); do \
|
||||
(cd $$p ; git status | grep -q 'nothing to commit, working [^ ]* clean' || (echo "Uncommitted changes in: $$p"; git diff |diffstat -p1)) ;\
|
||||
done
|
||||
|
||||
#help versions: Displays the version of each package in the ./packages tree.
|
||||
versions: $(PACKAGES_FILE) $(addprefix packages/,$(PKGS))
|
||||
@for p in $(addprefix packages/,$(PKGS)); do \
|
||||
versions: $(PACKAGES_FILE) $(addprefix packages/,$(PKGS_LOCAL))
|
||||
@for p in $(addprefix packages/,$(PKGS_LOCAL)); do \
|
||||
(cd $$p; if ls *.spec &> /dev/null; then rpmspec -q --queryformat '%{NAME}-%{VERSION}\n' *.spec | head -n1; fi) ;\
|
||||
done
|
||||
|
||||
#help releases: Like 'make versions', but also displays the release number.
|
||||
releases: $(PACKAGES_FILE) $(addprefix packages/,$(PKGS))
|
||||
@for p in $(addprefix packages/,$(PKGS)); do \
|
||||
releases: $(PACKAGES_FILE) $(addprefix packages/,$(PKGS_LOCAL))
|
||||
@for p in $(addprefix packages/,$(PKGS_LOCAL)); do \
|
||||
(cd $$p; if ls *.spec &> /dev/null; then rpmspec -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}\n' *.spec | head -n1; fi) ;\
|
||||
done
|
||||
|
||||
@@ -224,6 +224,7 @@ autospecnew: localreponotice
|
||||
$${SETVERSION:+ --version $${SETVERSION}} \
|
||||
${NON_INTERACTIVE} ${SKIP_GIT} ${CLEANUP} \
|
||||
$(URL); \
|
||||
[ $$? -eq 0 ] && $(MAKE) link-new-rpms PKG_REPO_DIR="${TOPLVL}/packages/${NAME}"; \
|
||||
$(TOPLVL)/projects/common/checkblacklist.sh $(TOPLVL)/projects/common/blacklist $(TOPLVL)/packages/${NAME}/results/*.rpm; \
|
||||
else \
|
||||
echo "$(NAME) already exists at $(TOPLVL)/packages/$(NAME)"; \
|
||||
|
||||
@@ -102,6 +102,10 @@ $ echo missing-build-req >> buildreq_add
|
||||
$ make autospec
|
||||
```
|
||||
|
||||
Please see https://github.com/clearlinux/autospec#common-files for
|
||||
documention on buildreq_add and the other files autospec uses during the
|
||||
build process.
|
||||
|
||||
### Bump the release number for a package
|
||||
|
||||
If you simply need to increment a package's release number and rebuild the
|
||||
@@ -112,6 +116,16 @@ $ make bump
|
||||
$ make build
|
||||
```
|
||||
|
||||
### Update the release version for a package
|
||||
|
||||
If you have an update release version for a package, you can change the url
|
||||
for the new release in the package/example-pkg/Makefile. After modifying the
|
||||
new url, run `make autospec` again to fetch the new package and rebuild.
|
||||
|
||||
```
|
||||
$ make autospec
|
||||
```
|
||||
|
||||
## Other topics
|
||||
|
||||
### Customizing the mock config
|
||||
|
||||
@@ -6,6 +6,8 @@ config_opts['dist'] = 'clear' # only useful for --resultdir variable subst
|
||||
config_opts['extra_chroot_dirs'] = [ '/run/lock', ]
|
||||
config_opts['useradd'] = '/usr/sbin/useradd -m -u %(uid)s -g %(gid)s -d %(home)s %(user)s'
|
||||
config_opts['plugin_conf']['ccache_enable'] = False
|
||||
config_opts['plugin_conf']['root_cache_opts']['compress_program'] = 'zstd -5'
|
||||
config_opts['plugin_conf']['root_cache_opts']['extension'] = '.zst'
|
||||
config_opts['releasever'] = 'clear'
|
||||
config_opts['package_manager'] = 'dnf'
|
||||
config_opts['chrootgroup'] = 'mockbuild'
|
||||
|
||||
Reference in New Issue
Block a user