Create SPECS and SOURCES dirs

This commit is contained in:
eabdullin 2024-07-18 11:47:42 +03:00
parent f5e5bf3256
commit 170a638329
15 changed files with 18 additions and 187 deletions

View File

@ -1 +0,0 @@
1

30
.gitignore vendored
View File

@ -1,15 +1,15 @@
/go-rpm-macros-3.0.8.tar.gz SOURCES/go-rpm-macros-3.0.8.tar.gz
/go-rpm-macros-3.0.9.tar.gz SOURCES/go-rpm-macros-3.0.9.tar.gz
/go-rpm-macros-3.0.10.tar.gz SOURCES/go-rpm-macros-3.0.10.tar.gz
/go-rpm-macros-3.0.11.tar.gz SOURCES/go-rpm-macros-3.0.11.tar.gz
/go-rpm-macros-3.0.12.tar.gz SOURCES/go-rpm-macros-3.0.12.tar.gz
/go-rpm-macros-3.0.13.tar.gz SOURCES/go-rpm-macros-3.0.13.tar.gz
/go-rpm-macros-3.0.14.tar.gz SOURCES/go-rpm-macros-3.0.14.tar.gz
/go-rpm-macros-3.0.15.tar.gz SOURCES/go-rpm-macros-3.0.15.tar.gz
/go-rpm-macros-3.1.0.tar.gz SOURCES/go-rpm-macros-3.1.0.tar.gz
/go-rpm-macros-3.2.0.tar.gz SOURCES/go-rpm-macros-3.2.0.tar.gz
/golist-0.10.3.tar.gz SOURCES/golist-0.10.3.tar.gz
/golist-0.10.3-vendor.tar.xz SOURCES/golist-0.10.3-vendor.tar.xz
/golist-0.10.4.tar.gz SOURCES/golist-0.10.4.tar.gz
/golist-0.10.4-vendor.tar.xz SOURCES/golist-0.10.4-vendor.tar.xz
/go-rpm-macros-3.3.0.tar.gz SOURCES/go-rpm-macros-3.3.0.tar.gz

3
.go-rpm-macros.metadata Normal file
View File

@ -0,0 +1,3 @@
1f3e46f9c6df47b2a621fd9072c106e20a3ec169 SOURCES/go-rpm-macros-3.3.0.tar.gz
d372835dbdb7c93e1c3ec0b7d1d4957dd860ac6c SOURCES/golist-0.10.4-vendor.tar.xz
4a105131658d029fe0b2d312b078a056748af2b4 SOURCES/golist-0.10.4.tar.gz

View File

@ -1,5 +0,0 @@
summary: CI Gating Plan
discover:
how: fmf
execute:
how: tmt

View File

@ -1,3 +0,0 @@
SHA512 (go-rpm-macros-3.3.0.tar.gz) = b14086efbd1fcc7f3a8228756a54582b15a6c6a64dc263060c3fc042666f40db98d9e5f117cb2c53c884bded247366e594f4d0c30c69c4105a03b750bd39f0ba
SHA512 (golist-0.10.4.tar.gz) = 81fc9cdc4cb0fa1b78ade56c60cb2ac0070dcb11130a333e61053a266e2312b03e64a6705415d6d20883ae4f8cd0be57722c93835c3efffdfaeb9330f4cc12ea
SHA512 (golist-0.10.4-vendor.tar.xz) = 53efe2d344d5eeb7954dd7c18a1142c67c1e7009b4d34b503372e010a6380a2218bceccff4925b513c8a80a3c3de8290c244d338f1da00c438d00f9affd8b363

View File

@ -1,2 +0,0 @@
The test's Makefiles are not used in Fedora CI infrastructure. But are kept here
for backward compatibility with traditional beakerlib test harness in RHEL.

View File

@ -1,66 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/go-rpm-macros/Sanity/gobuild-grafana
# Description: golang rpm macros usage building grafana
# Author: Jan Kuřík <jkurik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2021 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/go-rpm-macros/Sanity/gobuild-grafana
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Jan Kuřík <jkurik@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: golang rpm macros usage building" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 2h" >> $(METADATA)
@echo "RunFor: golang" >> $(METADATA)
@echo "Requires: golang" >> $(METADATA)
@echo "Requires: go-rpm-macros go-srpm-macros" >> $(METADATA)
@echo "Requires: /usr/bin/yumdownloader /usr/bin/yum-builddep" >> $(METADATA)
@echo "Requires: /usr/bin/rpmbuild" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: Fedora" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,3 +0,0 @@
PURPOSE of /tools/go-rpm-macros/Sanity/gobuild-grafana
Description: golang rpm macros usage building grafana
Author: Jan Kuřík <jkurik@redhat.com>

View File

@ -1,17 +0,0 @@
summary: golang rpm macros usage building
description: ''
contact: Jan Kuřík <jkurik@redhat.com>
component:
- golang
test: ./runtest.sh
framework: beakerlib
recommend:
- golang
- go-rpm-macros
- go-srpm-macros
- /usr/bin/yumdownloader
- /usr/bin/yum-builddep
- /usr/bin/rpmbuild
duration: 2h
extra-summary: /tools/go-rpm-macros/Sanity/gobuild-grafana
extra-task: /tools/go-rpm-macros/Sanity/gobuild-grafana

View File

@ -1,75 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/go-rpm-macros/Sanity/gobuild-grafana
# Description: golang rpm macros usage building grafana
# Author: Jan Kuřík <jkurik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2021 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="go-rpm-macros"
GO_PACKAGE="$(rpm -qf $(which go))"
# Conserve the non-zero return value through the pipe
set -o pipefail
rlJournalStart
rlPhaseStartSetup
rlRun "TmpDir=\$(mktemp -d /var/tmp/XXXXXXX)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest "check macros"
rlRun "gobuild_string=\"$(rpm -E '%gobuild')\"" 127
rlRun "gotest_string=\"$(rpm -E '%gotest')\"" 127
rlAssertNotEquals "Checking if %gobuild macro is defined" "$gobuild_string" "%gobuild"
rlAssertNotEquals "Checking if %gotest macro is defined" "$gotest_string" "%gotest"
rlPhaseEnd
rlPhaseStart FAIL "setup grafana sources"
rlRun "SRPM=\$(basename \$(yumdownloader --source --url grafana | tail -n 1))"
rlRun "yumdownloader --source grafana"
rlRun "yum-builddep --enablerepo=\* -y --srpm ${SRPM}"
rlRun "rpm -i -D '_topdir $TmpDir' ${SRPM}"
rlRun "sed -i 's/^\s*%define\s*compile_frontend\s.*/%define compile_frontend 0/g' \
SPECS/grafana.spec" 0 "Make sure we build only the golang part, no JS stuff"
rlPhaseEnd
rlPhaseStartTest "rpmbuild grafana"
rlRun "rpmbuild --showrc &> ${TmpDir}/rpm.rc"
rlFileSubmit "${TmpDir}/rpm.rc"
rlAssertGrep "%gobuild" SPECS/grafana.spec -w
rlAssertGrep "%gotest" SPECS/grafana.spec -w
rlRun "rpmbuild -bc --define='_topdir $TmpDir' SPECS/grafana.spec \
|& tee grafana.rpmbuild.log"
rlFileSubmit "grafana.rpmbuild.log"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd