Skip to content

Commit 0c5c98f

Browse files
authored
Merge pull request #413 from bryce-carson/master
Use CMake to perform installation, and RPM macros
2 parents 6e7d64f + e79a633 commit 0c5c98f

4 files changed

Lines changed: 38 additions & 47 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,9 @@ else()
348348
target_link_libraries(${TARGET_NAME} PUBLIC Qt5::Widgets Qt5::Core Qt5::Gui OpenGL::GL gsl tables eidos_zlib gnu )
349349
else()
350350
target_link_libraries( ${TARGET_NAME} PUBLIC Qt5::Widgets Qt5::Core Qt5::Gui OpenGL::GL gsl tables eidos_zlib )
351-
352-
install(DIRECTORY data/ DESTINATION share)
353-
endif()
351+
# Install icons and desktop files to the data root directory (usually /usr/local/share, or /usr/share).
352+
install(DIRECTORY data/ TYPE DATA)
353+
endif()
354354
endif()
355355
install(TARGETS ${TARGET_NAME} DESTINATION bin)
356356
endif(BUILD_SLIMGUI)

SLiM.spec

Lines changed: 30 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
# Cross-distribution SLiM RPM spec.
2+
# Defines:
3+
%if %{defined suse_version}
4+
%define qt5 libqt5
5+
%else
6+
%define qt5 qt5
7+
%endif
8+
19
Name: SLiM
2-
Version: 4.0.1
3-
Release: 2%{?dist}
10+
Version: 4.1
11+
Release: 1%{?dist}
412
Summary: an evolutionary simulation framework
513

614
License: GPLv3+
@@ -10,6 +18,7 @@ Source0: https://github.com/MesserLab/SLiM/archive/v%{version}.tar.gz
1018
# Prevent users of the Copr repository from using Simple Login Manager, due to binary file name conflict.
1119
Conflicts: slim
1220

21+
# This paragraph of the spec file is old and delicate.
1322
BuildRequires: cmake
1423
# openSUSE Build Requires
1524
%if %{defined suse_version}
@@ -26,23 +35,8 @@ BuildRequires: libappstream-glib
2635
%endif
2736
ExclusiveArch: x86_64
2837

29-
# Fedora: these package versions are those that COPR is building against, and thus if
30-
# they change because of point releases in Qt5, the RPMs need to be rebuilt and deployed.
31-
# Qt is weird and doesn't allow older software to be used if a newer point release is
32-
# installed on the system.
33-
%if 0%{?fedora}
34-
Requires: qt5-qtbase >= 5.13.2
35-
%endif
36-
37-
# Conditonal requires for RHEL (and CentOS)
38-
%if 0%{?rhel}
39-
Requires: qt5-qtbase >= 5.12.5
40-
%endif
41-
42-
# Conditional requires for openSUSE and SLE.
43-
%if %{defined suse_version}
44-
Requires: libqt5-qtbase >= 5.12.7
45-
%endif
38+
# RHEL 8 has the oldest point release of 5.15, and is the oldest RHEL supported.
39+
Requires: %{qt5}-qtbase >= 5.15.1
4640

4741
%description
4842
SLiM is an evolutionary simulation framework that combines a powerful engine for
@@ -56,36 +50,33 @@ Linux for easy simulation set-up, interactive runtime control, and dynamical
5650
visualization of simulation output.
5751

5852
%prep
59-
tar -xf ../SOURCES/v%{version}.tar.gz
53+
%setup -q
6054

6155
%build
62-
# NOTE: is the relative path required when using the cmake macro due to the above source prep-style?
63-
%cmake -DBUILD_SLIMGUI=ON #./SLiM-%version}/
56+
%cmake -DBUILD_SLIMGUI=ON
6457
%cmake_build
6558

6659
%install
6760
%cmake_install
6861

69-
%check
70-
appstream-util validate-relax --nonet %{buildroot}/usr/share/metainfo/org.messerlab.slimgui.appdata.xml
71-
7262
%files
73-
/usr/bin/eidos
74-
/usr/bin/slim
75-
/usr/bin/SLiMgui
76-
/usr/share/applications/org.messerlab.slimgui.desktop
77-
/usr/share/icons/hicolor/scalable/apps/org.messerlab.slimgui.svg
78-
/usr/share/icons/hicolor/scalable/mimetypes/text-slim.svg
79-
/usr/share/icons/hicolor/symbolic/apps/org.messerlab.slimgui-symbolic.svg
80-
/usr/share/metainfo/org.messerlab.slimgui.appdata.xml
81-
/usr/share/metainfo/org.messerlab.slimgui.metainfo.xml
82-
/usr/share/mime/packages/org.messerlab.slimgui-mime.xml
83-
84-
%post
85-
update-mime-database -n /usr/share/mime/
86-
xdg-mime install --mode system /usr/share/mime/packages/org.messerlab.slimgui-mime.xml
63+
%{_bindir}/eidos
64+
%{_bindir}/slim
65+
%{_bindir}/SLiMgui
66+
%{_datadir}/applications/org.messerlab.slimgui.desktop
67+
%{_datadir}/icons/hicolor/scalable/apps/org.messerlab.slimgui.svg
68+
%{_datadir}/icons/hicolor/scalable/mimetypes/text-slim.svg
69+
%{_datadir}/icons/hicolor/symbolic/apps/org.messerlab.slimgui-symbolic.svg
70+
%{_datadir}/metainfo/org.messerlab.slimgui.appdata.xml
71+
%{_datadir}/metainfo/org.messerlab.slimgui.metainfo.xml
72+
%{_datadir}/mime/packages/org.messerlab.slimgui-mime.xml
8773

8874
%changelog
75+
* Mon Dec 4 2023 Bryce Carson <bryce.a.carson@gmail.com> - 4.1-1
76+
- Final candidate 1 for 4.1 release
77+
- CMake install of package desktop environment data properly implemented
78+
- RPM macros adopted
79+
8980
* Tue Sep 27 2022 Bryce Carson <bryce.a.carson@gmail.com> - 4.0.1-2
9081
- `CMakeLists.txt` improved, so the installation section of the RPM is now simplified.
9182
- Data files now exist in `data/`, rather than in the root folder of the software.

data/metainfo/org.messerlab.slimgui.appdata.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<component type="desktop">
2+
<component type="desktop-application">
33
<id>org.messerlab.slimgui</id>
44
<metadata_license>FSFAP</metadata_license>
55
<project_license>GPL-3.0-or-later</project_license>
66
<name>SLiMgui</name>
7+
<launchable type="desktop-id">org.messerlab.slimgui.desktop</launchable>
78
<summary>Evolutionary simulation framework</summary>
8-
<url type="homepage">https://messerlab.org/slim/</url>
99
<description>
1010
<p>
1111
SLiM is an evolutionary simulation framework that combines a powerful engine for population genetic simulations with the capability of modeling arbitrarily complex evolutionary scenarios. Simulations are configured via the integrated Eidos scripting language that allows interactive control over practically every aspect of the simulated evolutionary scenarios. The underlying individual-based simulation engine is highly optimized to enable modeling of entire chromosomes in large populations. We also provide a graphical user interface on macOS and Linux for easy simulation set-up, interactive runtime control, and dynamical visualization of simulation output.
@@ -22,6 +22,6 @@
2222
<developer_name>Ben Haller</developer_name>
2323
<content_rating type="oars-1.0" />
2424
<releases>
25-
<release version="v4.0.1" date="2022-09-13" type="stable"/>
25+
<release version="v4.1" date="2023-12-01" type="stable"/>
2626
</releases>
2727
</component>

data/metainfo/org.messerlab.slimgui.metainfo.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<component type="desktop-application">
3-
<id>org.messerlab.slim</id>
3+
<id>org.messerlab.slimgui</id>
44

55
<name>SLiM</name>
66
<summary>Evolutionary simulation framework for population genetics</summary>
@@ -26,6 +26,6 @@
2626
<developer_name>Ben Haller</developer_name>
2727
<content_rating type="oars-1.0" />
2828
<releases>
29-
<release version="v4.0.1" date="2022-09-13" type="stable"/>
29+
<release version="v4.1" date="2023-12-01" type="stable"/>
3030
</releases>
3131
</component>

0 commit comments

Comments
 (0)