-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Cristian Le <[email protected]>
- Loading branch information
Showing
15 changed files
with
225 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
Name: cmake-template | ||
Summary: CMake project template | ||
Version: 0.0.0 | ||
Release: %autorelease | ||
License: MIT | ||
URL: https://github.com/LecrisUT/CMake-Template | ||
|
||
Source: https://github.com/LecrisUT/CMake-Template/archive/refs/tags/v%{version}.tar.gz | ||
|
||
BuildRequires: ninja-build | ||
BuildRequires: cmake | ||
BuildRequires: gcc-c++ | ||
|
||
%description | ||
CMake project template | ||
|
||
%package devel | ||
Summary: Development files for cmake-template | ||
Requires: cmake-template%{?_isa} = %{version}-%{release} | ||
|
||
%description devel | ||
This package contains libraries and header files for developing | ||
applications that use cmake-template. | ||
|
||
|
||
%prep | ||
%autosetup -n cmake-template-%{version} | ||
|
||
|
||
%build | ||
%cmake \ | ||
-DTEMPLATE_SHARED_LIBS=ON \ | ||
-DTEMPLATE_TESTS=ON | ||
%cmake_build | ||
|
||
|
||
%install | ||
%cmake_install | ||
|
||
|
||
%check | ||
%ctest | ||
|
||
|
||
%files | ||
%doc README.md | ||
%license LICENSE | ||
%{_libdir}/libtemplate.so.* | ||
|
||
%files devel | ||
%{_libdir}/libtemplate.so | ||
%{_includedir}/template.h | ||
%{_libdir}/cmake/Template | ||
%{_libdir}/pkgconfig/template.pc | ||
|
||
|
||
%changelog | ||
%autochangelog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
discover: | ||
how: fmf | ||
dist-git-source: true | ||
dist-git-extract: cmake-template-*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
summary: | ||
Test importing package | ||
discover+: | ||
how: fmf | ||
filter: "tag: package" | ||
path: test | ||
execute: | ||
how: tmt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
plan: | ||
import: | ||
url: https://github.com/packit/tmt-plans | ||
ref: main | ||
name: /plans/rpminspect | ||
environment: | ||
RPMINSPECT_EXCLUDE: disttag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
plan: | ||
import: | ||
url: https://github.com/packit/tmt-plans | ||
ref: main | ||
name: /plans/rpmlint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
summary: | ||
Basic smoke tests | ||
discover: | ||
how: fmf | ||
filter: "tag: smoke" | ||
execute: | ||
how: tmt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Common test variables | ||
tag: | ||
- smoke | ||
tier: 0 | ||
path: / | ||
|
||
# Define tests | ||
/version: | ||
test: hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
specfile_path: .distro/cmake-template.spec | ||
|
||
# add or remove files that should be synced | ||
files_to_sync: | ||
- src: .distro/cmake-template.spec | ||
dest: cmake-template.spec | ||
- .packit.yaml | ||
- src: .distro/cmake-template.rpmlintrc | ||
dest: cmake-template.rpmlintrc | ||
# tmt setup | ||
- src: .distro/.fmf/ | ||
dest: .fmf/ | ||
- src: .distro/plans/ | ||
dest: plans/ | ||
filters: | ||
- "- main.fmf.dist-git" | ||
- src: .distro/plans/main.fmf.dist-git | ||
dest: plans/main.fmf | ||
- .packit.yaml | ||
|
||
upstream_package_name: CMake-Template | ||
downstream_package_name: cmake-template | ||
|
||
update_release: false | ||
upstream_tag_template: v{version} | ||
|
||
jobs: | ||
- job: copr_build | ||
trigger: pull_request | ||
owner: lecris | ||
project: cmake-template | ||
targets: | ||
- fedora-all-x86_64 | ||
- fedora-all-aarch64 | ||
- epel-9-x86_64 | ||
- epel-9-aarch64 | ||
- job: tests | ||
trigger: pull_request | ||
targets: | ||
- fedora-all-x86_64 | ||
- fedora-all-aarch64 | ||
- epel-9-x86_64 | ||
- epel-9-aarch64 | ||
fmf_path: .distro | ||
- job: copr_build | ||
trigger: commit | ||
branch: main | ||
owner: lecris | ||
project: nightly | ||
targets: | ||
- fedora-all-x86_64 | ||
- fedora-all-aarch64 | ||
- epel-9-x86_64 | ||
- epel-9-aarch64 | ||
- job: tests | ||
trigger: commit | ||
branch: main | ||
targets: | ||
- fedora-all-x86_64 | ||
- fedora-all-aarch64 | ||
- epel-9-x86_64 | ||
- epel-9-aarch64 | ||
fmf_path: .distro | ||
## Uncomment when released downstream | ||
# - job: propose_downstream | ||
# trigger: release | ||
# dist_git_branches: | ||
# - fedora-rawhide | ||
# - epel-9 | ||
# - job: koji_build | ||
# trigger: commit | ||
# dist_git_branches: | ||
# - fedora-all | ||
# - epel-9 | ||
# - job: bodhi_update | ||
# trigger: commit | ||
# dist_git_branches: | ||
# - fedora-branched | ||
# - epel-9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
summary: | ||
Test FetchContent | ||
require+: | ||
- git | ||
tag+: [ FetchContent ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
summary: | ||
Test find_package | ||
tag+: [ find_package ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
tag: [ cmake, package ] | ||
require: | ||
- cmake | ||
- rsync | ||
- tree | ||
- gcc-c++ | ||
framework: beakerlib | ||
path: / | ||
test: ./package/test.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
summary: | ||
Test pkg-config for C library | ||
require+: | ||
- pkgconf | ||
tag+: [ pkg-config ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k | ||
# shellcheck disable=all | ||
source /usr/share/beakerlib/beakerlib.sh || exit 1 | ||
|
||
rlJournalStart | ||
rlPhaseStartSetup | ||
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory" | ||
rlRun "rsync -rL .$TMT_TEST_NAME/ $tmp" 0 "Copy example project" | ||
rlRun "pushd $tmp" | ||
rlRun "tree" 0 "Show directory tree" | ||
rlRun "set -o pipefail" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest | ||
rlRun "cmake -B ./build" | ||
rlRun "cmake --build ./build" | ||
rlRun "./build/main" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartCleanup | ||
rlRun "popd" | ||
rlRun "rm -r $tmp" 0 "Remove tmp directory" | ||
rlPhaseEnd | ||
rlJournalEnd |