summaryrefslogtreecommitdiff
path: root/distribution/fedora
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2024-07-03 10:19:30 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2024-07-03 10:19:30 +0200
commita14a7a0ccc9de76aeab0b2e4bbf58f1a79deedc2 (patch)
treee469179df67a0e0db49161a43cbf8076a189f6f4 /distribution/fedora
parent5d2c2b27a6323e2666378b986129b2a7c2c39e5c (diff)
New upstream version 5.3.0GAupstream/5.3.0GAupstream
Diffstat (limited to 'distribution/fedora')
-rw-r--r--distribution/fedora/README26
-rw-r--r--distribution/fedora/xtrkcad-5.2.2GA-xtrkcad.desktop.patch106
-rw-r--r--distribution/fedora/xtrkcad.spec87
3 files changed, 199 insertions, 20 deletions
diff --git a/distribution/fedora/README b/distribution/fedora/README
new file mode 100644
index 0000000..239b454
--- /dev/null
+++ b/distribution/fedora/README
@@ -0,0 +1,26 @@
+202220315
+This is repository of the files needed to make a fedora release.
+
+Temporary patches needed for 5.2.2, delete on next GA
+xtrkcad-5.2.2GA-xtrkcad.desktop.patch
+
+Builds the needed fedora rpms
+xtrkcad.spec
+Also needs (not saved here)
+xtrkcad-source-5.2.2GA.tar.gz
+
+builds the fc37 rpms
+fedpkg --release rawhide mockbuild
+
+builds fc35 rpms
+fedpkg --release f 35 mockbuild
+
+Built xtrkcad-5.2.2-1.fc35.x86_64.rpm installs as
+a graphical app, Can be selected by Applications->Graphics->XTrackCAD
+
+https://bugzilla.redhat.com/show_bug.cgi?id=2040728
+2040728 - xtrkcad - CAD for Model Railroad layout
+Approved 03/15 Comment #21
+
+
+
diff --git a/distribution/fedora/xtrkcad-5.2.2GA-xtrkcad.desktop.patch b/distribution/fedora/xtrkcad-5.2.2GA-xtrkcad.desktop.patch
new file mode 100644
index 0000000..54f74dc
--- /dev/null
+++ b/distribution/fedora/xtrkcad-5.2.2GA-xtrkcad.desktop.patch
@@ -0,0 +1,106 @@
+diff -ru orig/xtrkcad-source-5.2.2GA/app/bin/CMakeLists.txt xtrkcad-source-5.2.2GA/app/bin/CMakeLists.txt
+--- orig/xtrkcad-source-5.2.2GA/app/bin/CMakeLists.txt 2021-12-18 12:12:02.000000000 -0500
++++ xtrkcad-source-5.2.2GA/app/bin/CMakeLists.txt 2022-02-21 15:22:10.656926058 -0500
+@@ -169,7 +169,6 @@
+ utility.c
+ utility.h
+ validator.c
+- cJSON.c
+ archive.h
+ directory.h
+ manifest.h
+@@ -237,10 +236,7 @@
+ # This ensures that messages.h has been generated before we build xtrkcad-lib
+ ADD_DEPENDENCIES(xtrkcad-lib Help)
+
+-TARGET_LINK_LIBRARIES(xtrkcad xtrkcad-lib)
+-TARGET_LINK_LIBRARIES(xtrkcad xtrkcad-wlib)
+-TARGET_LINK_LIBRARIES(xtrkcad xtrkcad-cornu)
+-TARGET_LINK_LIBRARIES(xtrkcad dynstring)
++TARGET_LINK_LIBRARIES(xtrkcad xtrkcad-lib xtrkcad-wlib xtrkcad-cornu dynstring cjson)
+ if(XTRKCAD_CREATE_SVG)
+ IF(UNIX)
+ if (NOT APPLE)
+diff -ru orig/xtrkcad-source-5.2.2GA/app/bin/fileio.c xtrkcad-source-5.2.2GA/app/bin/fileio.c
+--- orig/xtrkcad-source-5.2.2GA/app/bin/fileio.c 2021-12-18 10:31:35.000000000 -0500
++++ xtrkcad-source-5.2.2GA/app/bin/fileio.c 2022-02-20 10:51:17.258176965 -0500
+@@ -20,7 +20,7 @@
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+-#include <cJSON.h>
++#include <cjson/cJSON.h>
+
+ #include "archive.h"
+ #include "common.h"
+Only in orig/xtrkcad-source-5.2.2GA/app/bin/include: dirent.h
+Only in xtrkcad-source-5.2.2GA/app/bin/include: dirent.h.phil
+diff -ru orig/xtrkcad-source-5.2.2GA/app/bin/manifest.c xtrkcad-source-5.2.2GA/app/bin/manifest.c
+--- orig/xtrkcad-source-5.2.2GA/app/bin/manifest.c 2021-12-18 10:31:34.000000000 -0500
++++ xtrkcad-source-5.2.2GA/app/bin/manifest.c 2022-02-20 10:51:14.426213927 -0500
+@@ -21,7 +21,7 @@
+
+ #include <string.h>
+
+-#include "cJSON.h"
++#include <cjson/cJSON.h>
+ #include "fileio.h"
+ #include "layout.h"
+ #include "misc2.h"
+diff -ru orig/xtrkcad-source-5.2.2GA/app/help/CMakeLists.txt xtrkcad-source-5.2.2GA/app/help/CMakeLists.txt
+--- orig/xtrkcad-source-5.2.2GA/app/help/CMakeLists.txt 2021-12-18 10:27:44.000000000 -0500
++++ xtrkcad-source-5.2.2GA/app/help/CMakeLists.txt 2022-02-21 15:24:51.868816364 -0500
+@@ -1,6 +1,6 @@
+ PROJECT(help)
+
+-ADD_EXECUTABLE(genhelp genhelp.c cJSON.c cJSON.h)
++ADD_EXECUTABLE(genhelp genhelp.c)
+
+ ADD_EXECUTABLE(genmessages genmessages.c)
+
+@@ -10,6 +10,8 @@
+ SET(GENMESSAGES_OPTS "")
+ ENDIF(XTRKCAD_USE_GETTEXT)
+
++TARGET_LINK_LIBRARIES(genhelp PUBLIC cjson)
++
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/messages.h ${CMAKE_CURRENT_BINARY_DIR}/messages.but
+ DEPENDS genmessages ${CMAKE_CURRENT_SOURCE_DIR}/messages.in
+diff -ru orig/xtrkcad-source-5.2.2GA/app/help/genhelp.c xtrkcad-source-5.2.2GA/app/help/genhelp.c
+--- orig/xtrkcad-source-5.2.2GA/app/help/genhelp.c 2021-12-18 10:27:44.000000000 -0500
++++ xtrkcad-source-5.2.2GA/app/help/genhelp.c 2022-02-20 10:28:37.155745877 -0500
+@@ -20,7 +20,7 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+-#include "cJSON.h"
++#include <cjson/cJSON.h>
+
+ #define I18NHEADERFILE "i18n.h"
+
+diff -ru orig/xtrkcad-source-5.2.2GA/app/lib/CMakeLists.txt xtrkcad-source-5.2.2GA/app/lib/CMakeLists.txt
+--- orig/xtrkcad-source-5.2.2GA/app/lib/CMakeLists.txt 2021-12-18 12:12:02.000000000 -0500
++++ xtrkcad-source-5.2.2GA/app/lib/CMakeLists.txt 2022-02-21 15:25:06.717622045 -0500
+@@ -42,10 +42,6 @@
+ endif()
+
+ if(UNIX AND NOT APPLE)
+- install(PROGRAMS
+- xdg-open xtrkcad-setup
+- DESTINATION ${XTRKCAD_SHARE_INSTALL_DIR}
+- )
+ install(FILES
+ xtrkcad.desktop xtrkcad.xml
+ DESTINATION "${XTRKCAD_SHARE_INSTALL_DIR}/applications"
+diff -ru orig/xtrkcad-source-5.2.2GA/CMakeLists.txt xtrkcad-source-5.2.2GA/CMakeLists.txt
+--- orig/xtrkcad-source-5.2.2GA/CMakeLists.txt 2021-12-18 13:10:04.000000000 -0500
++++ xtrkcad-source-5.2.2GA/CMakeLists.txt 2022-02-21 15:30:10.711643816 -0500
+@@ -1,6 +1,6 @@
+ PROJECT(XTrkCAD)
+ enable_testing()
+-cmake_minimum_required(VERSION 2.8)
++cmake_minimum_required(VERSION 3.22)
+ set(CMAKE_MACOSX_RPATH 0)
+
+ # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
diff --git a/distribution/fedora/xtrkcad.spec b/distribution/fedora/xtrkcad.spec
index 84e4be1..eae4a74 100644
--- a/distribution/fedora/xtrkcad.spec
+++ b/distribution/fedora/xtrkcad.spec
@@ -1,16 +1,29 @@
-Summary: XTrkCad CAD for Model Railroad layout
Name: xtrkcad
+Summary: CAD for Model Railroad layout
Version: 5.2.2
Release: 1%{?dist}
-License: GPLv2+
+License: GPLv2
URL: https://sourceforge.net/projects/xtrkcad-fork
-Source0: https://sourceforge.net/projects/xtrkcad-fork/files/XTrackCad/Version%20%{version}%20/xtrkcad-source-%{version}.zip
-BuildRoot: %{_tmppath}/%{name}-root
-BuildRequires: gcc, gcc-c++, cmake >= 2.4.7, pkgconfig, gtk2-devel
-BuildRequires: libcmocka, libcmocka-devel, libzip, libzip-devel
-BuildRequires: tinyxml, tinyxml-devel, pandoc
-BuildRequires: gettext, gettext-devel, glibc-devel
-Requires: libcmocka, libzip, tinyxml
+Source0: https://sourceforge.net/projects/xtrkcad-fork/files/XTrackCad/Version%20%{version}/xtrkcad-source-%{version}GA.tar.gz
+# patch (to be removed on next GA release)
+# patch0 adds xtrkcad.desktop to build - Changed upstream
+# It also uses cJSON and xdg-utils packages
+Patch0: xtrkcad-5.2.2GA-xtrkcad.desktop.patch
+
+BuildRequires: gcc
+BuildRequires: gcc-c++
+BuildRequires: cmake >= 2.4.7
+BuildRequires: pkgconfig
+BuildRequires: gtk2-devel
+BuildRequires: libzip-devel
+BuildRequires: desktop-file-utils
+BuildRequires: gettext-devel
+BuildRequires: glibc-devel
+BuildRequires: pandoc
+BuildRequires: doxygen
+BuildRequires: cjson-devel
+
+Requires: xdg-utils
%description
XTrkCad is a CAD program for designing Model Railroad layouts.
@@ -25,26 +38,60 @@ benchwork, 'Print to BitMap', elevations, train simulation and
car inventory.
%prep
-%setup -n xtrkcad-source-%{version}/usr/local -q
+%setup -n xtrkcad-source-%{version}GA -q
+
+# removed on next GA release
+%patch0 -p1
+
+%package doc
+Summary: Documentation for %{name}
+BuildArch: noarch
+
+%description doc
+This package contains user documentation for XTrkCad,
+in HTML format. It also contains demos, and examples.
%build
-cmake -D CMAKE_INSTALL_PREFIX:PATH=%{_prefix} -D CMAKE_BUILD_TYPE=Debug .
-make
+%cmake -DBUILD_SHARED_LIBS=OFF -DXTRKCAD_USE_DOXYGEN=ON
+%cmake_build
%install
-rm -rf $RPM_BUILD_ROOT/*
-make DESTDIR=$RPM_BUILD_ROOT install
+%cmake_install
-%check
-make test
+desktop-file-install --dir=%{buildroot}/%{_datadir}/applications \
+ %{buildroot}/%{_datadir}/%{name}/applications/xtrkcad.desktop
+rm %{buildroot}/%{_datadir}/%{name}/applications/xtrkcad.desktop
+
+mkdir -p %{buildroot}/%{_datadir}/pixmaps
+mv %{buildroot}/%{_datadir}/%{name}/pixmaps/xtrkcad.png \
+ %{buildroot}/%{_datadir}/pixmaps/xtrkcad.png
+rm -rf %{buildroot}/%{_datadir}/%{name}/pixmaps
+
+mkdir -p %{buildroot}/%{_datadir}/mime/packages
+mv %{buildroot}/%{_datadir}/%{name}/applications/xtrkcad.xml \
+ %{buildroot}/%{_datadir}/mime/packages/xtrkcad.xml
+
+# Tests require a feature in the next release
+#%check
+#%ctest
%files
%license app/COPYING
-%defattr(-, root, root)
-%{_bindir}/xtrkcad
-%{_datadir}
+%{_bindir}/%{name}
+%{_datadir}/applications/xtrkcad.desktop
+%{_datadir}/pixmaps/xtrkcad.png
+%{_datadir}/mime/packages/xtrkcad.xml
+%{_datadir}/%{name}
+%exclude %{_datadir}/%{name}/demos
+%exclude %{_datadir}/%{name}/examples
+%exclude %{_datadir}/%{name}/html
+
+%files doc
+%{_datadir}/%{name}/demos
+%{_datadir}/%{name}/examples
+%{_datadir}/%{name}/html
%changelog
-* Tue Dec 14 2021 Phil Cameron
+* Mon Feb 21 2022 Phil Cameron <pecameron1 -at- gmail.com> 5.2.2-1
- V5.2.2 GA