summaryrefslogtreecommitdiff
path: root/distribution
diff options
context:
space:
mode:
Diffstat (limited to 'distribution')
-rw-r--r--distribution/CMakeLists.txt11
-rw-r--r--distribution/fedora/xtrkcad.spec50
-rw-r--r--distribution/posix/CMakeLists.txt31
-rwxr-xr-xdistribution/posix/postinst21
-rwxr-xr-xdistribution/posix/prerm22
-rw-r--r--distribution/win32/CMakeLists.txt5
-rw-r--r--distribution/win32/nsis/CMakeLists.txt29
7 files changed, 148 insertions, 21 deletions
diff --git a/distribution/CMakeLists.txt b/distribution/CMakeLists.txt
index 9eede85..119b684 100644
--- a/distribution/CMakeLists.txt
+++ b/distribution/CMakeLists.txt
@@ -1,7 +1,16 @@
# Setup global packaging parameters ...
SET(CPACK_PACKAGE_DESCRIPTION "XTrackCad is a CAD program for designing model railroad layouts.")
SET(CPACK_PACKAGE_EXECUTABLES "xtrkcad;XTrkCAD ${XTRKCAD_VERSION}")
-SET(CPACK_PACKAGE_FILE_NAME "xtrkcad-setup-${XTRKCAD_VERSION}")
+IF(WIN32)
+ # Add suffix
+ IF(WIN64)
+ SET(CPACK_PACKAGE_FILE_NAME "xtrkcad-setup-${XTRKCAD_VERSION}-x64")
+ ELSE(WIN64)
+ SET(CPACK_PACKAGE_FILE_NAME "xtrkcad-setup-${XTRKCAD_VERSION}-x86")
+ ENDIF(WIN64)
+ELSE(WIN32)
+ SET(CPACK_PACKAGE_FILE_NAME "xtrkcad-setup-${XTRKCAD_VERSION}")
+ENDIF(WIN32)
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "XTrkCAD ${XTRKCAD_VERSION}")
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "XTrkCAD ${XTRKCAD_VERSION}")
SET(CPACK_PACKAGE_NAME "xtrkcad")
diff --git a/distribution/fedora/xtrkcad.spec b/distribution/fedora/xtrkcad.spec
new file mode 100644
index 0000000..84e4be1
--- /dev/null
+++ b/distribution/fedora/xtrkcad.spec
@@ -0,0 +1,50 @@
+Summary: XTrkCad CAD for Model Railroad layout
+Name: xtrkcad
+Version: 5.2.2
+Release: 1%{?dist}
+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
+
+%description
+XTrkCad is a CAD program for designing Model Railroad layouts.
+XTrkCad supports any scale, has libraries of popular brands of x
+turnouts and sectional track (plus you add your own easily), can
+automatically use spiral transition curves when joining track
+XTrkCad lets you manipulate track much like you would with actual
+flex-track to modify, extend and join tracks and turnouts.
+Additional features include tunnels, 'post-it' notes, on-screen
+ruler, parts list, 99 drawing layers, undo/redo commands,
+benchwork, 'Print to BitMap', elevations, train simulation and
+car inventory.
+
+%prep
+%setup -n xtrkcad-source-%{version}/usr/local -q
+
+%build
+cmake -D CMAKE_INSTALL_PREFIX:PATH=%{_prefix} -D CMAKE_BUILD_TYPE=Debug .
+make
+
+%install
+rm -rf $RPM_BUILD_ROOT/*
+make DESTDIR=$RPM_BUILD_ROOT install
+
+%check
+make test
+
+%files
+%license app/COPYING
+%defattr(-, root, root)
+%{_bindir}/xtrkcad
+%{_datadir}
+
+%changelog
+* Tue Dec 14 2021 Phil Cameron
+- V5.2.2 GA
+
diff --git a/distribution/posix/CMakeLists.txt b/distribution/posix/CMakeLists.txt
index 3356005..6e44581 100644
--- a/distribution/posix/CMakeLists.txt
+++ b/distribution/posix/CMakeLists.txt
@@ -8,7 +8,12 @@ set(CPACK_RPM_PACKAGE_GROUP "Applications/Engineering")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}////xtrkcad-desc.txt")
set(CPACK_PACKAGE_FILE_NAME "xtrkcad-setup-${XTRKCAD_VERSION}-${CPACK_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}")
-set(CPACK_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} )
+if(XTRKCAD_PACKAGE_GA_RELEASE)
+ set(CPACK_INSTALL_PREFIX "/usr" )
+else()
+ set(CPACK_INSTALL_PREFIX "/usr/local" )
+endif()
+
set(CPACK_PACKAGING_INSTALL_PREFIX ${CPACK_INSTALL_PREFIX})
# get the specific configuration for each packager
@@ -17,7 +22,7 @@ set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/package.txt)
set(CPACK_PACKAGE_VENDOR "XTrackCAD Fork Project")
# common dependencies for all Linux builds
-set(CPACK_RPM_PACKAGE_REQUIRES "glibc gtk2 zip zlib")
+set(CPACK_RPM_PACKAGE_REQUIRES "glibc gtk2 zlib")
set(CPACK_RPM_BUILDREQUIRES
"gcc, cmake >= 2.4.7, pkgconfig, gtk2-devel"
@@ -31,6 +36,12 @@ if(NOT XTRKCAD_USE_BROWSER)
# message(AUTHOR_WARNING "Add dependency to webkitgtk for viewing help!")
endif()
+#Add dependency to MiniXML (mxml) if configured
+if(XTRKCAD_CREATE_SVG)
+ set(CPACK_RPM_PACKAGE_REQUIRES
+ "${CPACK_RPM_PACKAGE_REQUIRES} mxml")
+endif()
+
# exclude these directories from the rpm
set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION
"/usr/local"
@@ -54,13 +65,23 @@ set(CPACK_DEBIAN_PACKAGE_VERSION "1:${XTRKCAD_VERSION}")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
-set(CPACK_DEBIAN_PACKAGE_DEPENDS "zip")
+set(CPACK_DEBIAN_PACKAGE_DEPENDS "xdg-utils")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "xtrkcad@sillub.com")
set(CPACK_PACKAGE_CONTACT "xtrkcad@sillub.com")
-set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "XTrkCad description")
+set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "XTrkCad supports any scale, has libraries of popular brands of \
+turnouts and sectional track (plus you add your own easily), can \
+automatically use spiral transition curves when joining track \
+XTrkCad lets you manipulate track much like you would with actual \
+flex-track to modify, extend and join tracks and turnouts. \
+Additional features include tunnels, 'post-it' notes, on-screen \
+ruler, parts list, 99 drawing layers, undo/redo commands, \
+benchwork, 'Print to BitMap', elevations, train simulation and \
+car inventory. \
+")
+
set(CPACK_DEBIAN_PACKAGE_SECTION "contrib/graphics")
@@ -74,5 +95,7 @@ set(CPACK_PACKAGE_EXECUTABLES "xtrkcad;XTrkCad-5.2.1-Beta")
set(CPACK_CREATE_DESKTOP_LINKS "xtrkcad")
+set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/postinst;${CMAKE_CURRENT_SOURCE_DIR}/prerm")
+
include(CPack)
diff --git a/distribution/posix/postinst b/distribution/posix/postinst
new file mode 100755
index 0000000..914534d
--- /dev/null
+++ b/distribution/posix/postinst
@@ -0,0 +1,21 @@
+#!/bin/sh
+LOGF=/tmp/xtrkcad-setup.log
+if [ -f "${LOGF}" ] ; then
+ chmod 666 ${LOGF}
+ echo postinst: $* >> ${LOGF}
+else
+ LOGF=/dev/null
+fi
+
+if [ -d /usr/local/share/xtrkcad ] ; then
+ INSTALLDIR=/usr/local/share/xtrkcad
+elif [ -d /usr/share/xtrkcad ] ; then
+ INSTALLDIR=/usr/share/xtrkcad
+else
+ echo No existing XTrkCad install >> ${LOGF}
+ exit 1
+fi
+
+( su -c "sh ${INSTALLDIR}/xtrkcad-setup install ${INSTALLDIR}" -l $SUDO_USER ) >> ${LOGF} 2>&1
+
+exit 0
diff --git a/distribution/posix/prerm b/distribution/posix/prerm
new file mode 100755
index 0000000..3c5db28
--- /dev/null
+++ b/distribution/posix/prerm
@@ -0,0 +1,22 @@
+#!/bin/sh
+LOGF=/tmp/xtrkcad-setup.log
+if [ -f "${LOGF}" ] ; then
+ chmod 666 ${LOGF}
+ echo prerm: $* >> ${LOGF}
+else
+ LOGF=/dev/null
+fi
+
+if [ -d /usr/local/share/xtrkcad ] ; then
+ INSTALLDIR=/usr/local/share/xtrkcad
+elif [ -d /usr/share/xtrkcad ] ; then
+ INSTALLDIR=/usr/share/xtrkcad
+else
+ echo No existing XTrkCad install >> ${LOGF}
+ exit 1
+fi
+
+( su -c "sh ${INSTALLDIR}/xtrkcad-setup remove ${INSTALLDIR}" -l $SUDO_USER ) >> ${LOGF} 2>&1
+
+exit 0
+
diff --git a/distribution/win32/CMakeLists.txt b/distribution/win32/CMakeLists.txt
index 80ecfe3..3a46c7f 100644
--- a/distribution/win32/CMakeLists.txt
+++ b/distribution/win32/CMakeLists.txt
@@ -1,4 +1,3 @@
-SET(CPACK_SOURCE_GENERATOR "ZIP")
-
-ADD_SUBDIRECTORY(nsis)
+set(CPACK_SOURCE_GENERATOR "ZIP")
+add_subdirectory(nsis)
diff --git a/distribution/win32/nsis/CMakeLists.txt b/distribution/win32/nsis/CMakeLists.txt
index 150fe43..ef1775c 100644
--- a/distribution/win32/nsis/CMakeLists.txt
+++ b/distribution/win32/nsis/CMakeLists.txt
@@ -1,23 +1,26 @@
-STRING(REPLACE "/" "\\\\" NATIVE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+string(REPLACE "/" "\\\\" NATIVE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-SET(CPACK_GENERATOR "NSIS")
-SET(CPACK_PACKAGE_INSTALL_DIRECTORY "XTrackCAD")
-SET(CPACK_NSIS_EXECUTABLE_NAME "bin\\\\xtrkcad.exe")
-SET(CPACK_NSIS_DISPLAY_NAME "XTrackCAD ${CPACK_PACKAGE_VERSION}")
-SET(CPACK_PACKAGE_ICON "${NATIVE_CURRENT_SOURCE_DIR}\\\\headerimage.bmp")
-SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\xtrkcad.exe")
-SET(CPACK_NSIS_HELP_LINK "http://www.xtrkcad.org")
-SET(CPACK_NSIS_MUI_FINISHPAGE_RUN "xtrkcad.exe")
+set(CPACK_GENERATOR "NSIS")
+set(CPACK_PACKAGE_INSTALL_DIRECTORY "XTrackCAD")
+set(CPACK_NSIS_EXECUTABLE_NAME "bin\\\\xtrkcad.exe")
+set(CPACK_NSIS_DISPLAY_NAME "XTrackCAD ${CPACK_PACKAGE_VERSION}")
+set(CPACK_PACKAGE_ICON "${NATIVE_CURRENT_SOURCE_DIR}\\\\headerimage.bmp")
+set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\xtrkcad.exe")
+set(CPACK_NSIS_HELP_LINK "http://www.xtrkcad.org")
+set(CPACK_NSIS_MUI_FINISHPAGE_RUN "xtrkcad.exe")
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "on")
+set(CMAKE_INSTALL_OPENMP_LIBRARIES TRUE)
-SET(CPACK_NSIS_STARTMENU_FOLDER "XTrackCAD")
+set(CPACK_NSIS_STARTMENU_FOLDER "XTrackCAD")
-SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
+set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
"; add part specific to XTrackCAD installation
!include \\\"${NATIVE_CURRENT_SOURCE_DIR}\\\\install.nsh\\\"")
-SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
+set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
"; add part specific to XTrackCAD uninstall
!include \\\"${NATIVE_CURRENT_SOURCE_DIR}\\\\uninstall.nsh\\\"")
-INCLUDE(CPack)
+include (InstallRequiredSystemLibraries)
+
+include(CPack)