Skip to content

Commit 0120068

Browse files
committed
Fedora packaging
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
1 parent 0307c25 commit 0120068

File tree

11 files changed

+306
-0
lines changed

11 files changed

+306
-0
lines changed

.distro/.fmf/version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1

.distro/plans/full.fmf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
summary:
2+
Test the bundled ctests and pytest
3+
discover+:
4+
how: fmf
5+
path: test-suite
6+
execute:
7+
how: tmt

.distro/plans/main.fmf.dist-git

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
discover:
2+
how: fmf
3+
dist-git-source: true
4+
dist-git-extract: wannier90-*/

.distro/plans/rpminspect.fmf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
plan:
2+
import:
3+
url: https://github.com/packit/tmt-plans
4+
ref: main
5+
name: /plans/rpminspect

.distro/plans/rpmlint.fmf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
prepare:
2+
- how: shell
3+
script: cp ./*.rpmlintrc $TMT_PLAN_DATA/
4+
discover:
5+
how: fmf
6+
filter: "tag: rpmlint"
7+
url: https://github.com/packit/tmt-plans
8+
ref: main
9+
execute:
10+
how: tmt

.distro/wannier90.rpmlintrc

Whitespace-only changes.

.distro/wannier90.spec

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
Name: wannier90
2+
Summary: Maximally-Localised Generalised Wannier Functions Code
3+
Version: 0.0.0
4+
Release: %autorelease
5+
License: GPLv2
6+
URL: https://www.wannier.org/
7+
8+
Source: https://github.com/wannier-developers/wannier90/archive/refs/tags/v%{version}.tar.gz
9+
10+
BuildRequires: ninja-build
11+
BuildRequires: cmake
12+
BuildRequires: gcc-fortran
13+
BuildRequires: flexiblas-devel
14+
# Required for testing
15+
BuildRequires: gcc-c++
16+
BuildRequires: python3
17+
18+
%global _description %{expand:
19+
Maximally-Localised Generalised Wannier Functions Code.}
20+
21+
%description
22+
%{_description}
23+
24+
%package devel
25+
Summary: Development files for wannier90
26+
Requires: wannier90%{?_isa} = %{version}-%{release}
27+
28+
%description devel
29+
This package contains the development files for the wannier90 library.
30+
31+
%package openmpi
32+
Summary: Maximally-Localised Generalised Wannier Functions Code - OpenMPI version
33+
BuildRequires: openmpi-devel
34+
35+
%description openmpi
36+
%{_description}
37+
38+
This package contains the OpenMPI parallel version.
39+
40+
%package openmpi-devel
41+
Summary: Development files for wannier90 - OpenMPI version
42+
Requires: wannier90-openmpi%{?_isa} = %{version}-%{release}
43+
44+
%description openmpi-devel
45+
This package contains the development files for the wannier90 (OpenMPI) library.
46+
47+
%package mpich
48+
Summary: Maximally-Localised Generalised Wannier Functions Code - MPICH version
49+
BuildRequires: mpich-devel
50+
51+
%description mpich
52+
%{_description}
53+
54+
This package contains the MPICH parallel version.
55+
56+
%package mpich-devel
57+
Summary: Development files for wannier90 - MPICH version
58+
Requires: wannier90-mpich%{?_isa} = %{version}-%{release}
59+
60+
%description mpich-devel
61+
This package contains the development files for the wannier90 (MPICH) library.
62+
63+
64+
%prep
65+
%autosetup -n wannier90-%{version}
66+
67+
# $MPI_SUFFIX will be evaluated in the loops below, set by mpi modules
68+
%global _vpath_builddir %{_vendor}-%{_target_os}-build${MPI_SUFFIX:-_serial}
69+
# We are running the module load/unload manually until there is a macro-like way to expand this
70+
. /etc/profile.d/modules.sh
71+
72+
73+
%build
74+
cmake_common_args=(
75+
"-G Ninja"
76+
"-DWANNIER90_SHARED_LIBS=ON"
77+
"-DWANNIER90_TEST=ON"
78+
)
79+
for mpi in '' mpich openmpi ; do
80+
if [ -n "$mpi" ]; then
81+
module load mpi/${mpi}-%{_arch}
82+
cmake_mpi_args=(
83+
"-DCMAKE_INSTALL_PREFIX=${MPI_HOME}"
84+
"-DWANNIER90_MPI=ON"
85+
"-DCMAKE_INSTALL_MODULEDIR=${MPI_FORTRAN_MOD_DIR}"
86+
"-DCMAKE_INSTALL_LIBDIR=lib"
87+
)
88+
else
89+
cmake_mpi_args=(
90+
"-DWANNIER90_MPI=OFF"
91+
"-DCMAKE_INSTALL_MODULEDIR=%{_fmoddir}"
92+
)
93+
fi
94+
95+
%cmake \
96+
${cmake_common_args[@]} \
97+
${cmake_mpi_args[@]}
98+
%cmake_build
99+
100+
[ -n "$mpi" ] && module unload mpi/${mpi}-%{_arch}
101+
done
102+
103+
104+
%install
105+
for mpi in '' mpich openmpi ; do
106+
[ -n "$mpi" ] && module load mpi/${mpi}-%{_arch}
107+
%cmake_install
108+
[ -n "$mpi" ] && module unload mpi/${mpi}-%{_arch}
109+
done
110+
111+
112+
%check
113+
for mpi in '' mpich %{?with_openmpi:openmpi} ; do
114+
[ -n "$mpi" ] && module load mpi/${mpi}-%{_arch}
115+
%ctest
116+
[ -n "$mpi" ] && module unload mpi/${mpi}-%{_arch}
117+
done
118+
119+
120+
%files
121+
%doc README.rst
122+
%license LICENSE
123+
%{_libdir}/libwannier90.so.*
124+
%{_bindir}/wannier90.x
125+
%{_bindir}/postw90.x
126+
127+
%files devel
128+
%{_includedir}/wannier90.hh
129+
%{_libdir}/libwannier90.so
130+
%{_fmoddir}/Wannier90/
131+
%{_libdir}/cmake/Wannier90
132+
%{_libdir}/pkgconfig/wannier90.pc
133+
134+
%files openmpi
135+
%{_libdir}/openmpi/bin/wannier90.x
136+
%{_libdir}/openmpi/bin/postw90.x
137+
%{_libdir}/openmpi/lib/libwannier90.so.*
138+
139+
%files openmpi-devel
140+
%{_libdir}/openmpi/include/wannier90.hh
141+
%{_libdir}/openmpi/lib/libwannier90.so
142+
%{_fmoddir}/openmpi/Wannier90/
143+
%{_libdir}/openmpi/lib/cmake/Wannier90
144+
%{_libdir}/openmpi/lib/pkgconfig/wannier90.pc
145+
146+
%files mpich
147+
%{_libdir}/mpich/bin/wannier90.x
148+
%{_libdir}/mpich/bin/postw90.x
149+
%{_libdir}/mpich/lib/libwannier90.so.*
150+
151+
%files mpich-devel
152+
%{_libdir}/mpich/include/wannier90.hh
153+
%{_libdir}/mpich/lib/libwannier90.so
154+
%{_fmoddir}/mpich/Wannier90/
155+
%{_libdir}/mpich/lib/cmake/Wannier90
156+
%{_libdir}/mpich/lib/pkgconfig/wannier90.pc
157+
158+
%changelog
159+
%autochangelog

.packit.yaml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
specfile_path: .distro/wannier90.spec
2+
files_to_sync:
3+
- src: .distro/
4+
dest: ./
5+
filters:
6+
- "- plans/main.fmf.dist-git"
7+
- "- plans/rpminspect.fmf"
8+
- "- plans/rpmlint.fmf"
9+
- src: .distro/plans/main.fmf.dist-git
10+
dest: plans/main.fmf
11+
- .packit.yaml
12+
13+
upstream_package_name: wannier90
14+
downstream_package_name: wannier90
15+
update_release: false
16+
upstream_tag_template: v{version}
17+
18+
jobs:
19+
- job: copr_build
20+
trigger: pull_request
21+
owner: lecris
22+
project: wannier90
23+
update_release: true
24+
release_suffix: "{PACKIT_RPMSPEC_RELEASE}"
25+
targets:
26+
- fedora-all-x86_64
27+
- fedora-all-aarch64
28+
- job: tests
29+
trigger: pull_request
30+
targets:
31+
- fedora-all-x86_64
32+
- fedora-all-aarch64
33+
fmf_path: .distro
34+
- job: copr_build
35+
trigger: commit
36+
branch: develop
37+
owner: lecris
38+
project: nightly
39+
additional_repos:
40+
- copr://@scikit-build/release
41+
targets:
42+
- fedora-all-x86_64
43+
- fedora-all-aarch64
44+
- job: tests
45+
trigger: commit
46+
branch: develop
47+
targets:
48+
- fedora-all-x86_64
49+
- fedora-all-aarch64
50+
fmf_path: .distro
51+
- job: copr_build
52+
trigger: release
53+
owner: lecris
54+
project: release
55+
targets:
56+
- fedora-all-x86_64
57+
- fedora-all-aarch64
58+
- job: tests
59+
trigger: release
60+
targets:
61+
- fedora-all-x86_64
62+
- fedora-all-aarch64
63+
fmf_path: .distro
64+
- job: propose_downstream
65+
trigger: release
66+
dist_git_branches:
67+
# TODO: Switch to fedora-development and fedora-latest
68+
# There is an issue that the commits diverge on different PRs. In the meantime will create PRs on branched fedora
69+
# manually
70+
# https://github.com/packit/packit/issues/1724
71+
- fedora-rawhide
72+
- job: koji_build
73+
trigger: commit
74+
dist_git_branches:
75+
- fedora-all
76+
- job: bodhi_update
77+
trigger: commit
78+
dist_git_branches:
79+
- fedora-branched

test-suite/.fmf/version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1

test-suite/ctest.fmf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
tag: [ cmake ]
2+
require:
3+
- cmake
4+
- rsync
5+
- gcc
6+
- gcc-c++
7+
- gcc-fortran
8+
- pkgconf
9+
- git
10+
# For test-suite
11+
- bzip2
12+
# For testing FetchContent
13+
- flexiblas-devel
14+
framework: beakerlib
15+
path: /
16+
test: ./ctest.sh

0 commit comments

Comments
 (0)