summaryrefslogtreecommitdiff
path: root/distribution/posix
diff options
context:
space:
mode:
Diffstat (limited to 'distribution/posix')
-rw-r--r--distribution/posix/CMakeLists.txt12
-rwxr-xr-xdistribution/posix/postinst9
-rwxr-xr-xdistribution/posix/prerm9
3 files changed, 7 insertions, 23 deletions
diff --git a/distribution/posix/CMakeLists.txt b/distribution/posix/CMakeLists.txt
index 6e44581..f202791 100644
--- a/distribution/posix/CMakeLists.txt
+++ b/distribution/posix/CMakeLists.txt
@@ -8,10 +8,11 @@ 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}")
-if(XTRKCAD_PACKAGE_GA_RELEASE)
- set(CPACK_INSTALL_PREFIX "/usr" )
-else()
+if(XTRKCAD_BETA MATCHES "-beta")
set(CPACK_INSTALL_PREFIX "/usr/local" )
+else()
+ set(CPACK_INSTALL_PREFIX "/usr" )
+ set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/postinst;${CMAKE_CURRENT_SOURCE_DIR}/prerm")
endif()
set(CPACK_PACKAGING_INSTALL_PREFIX ${CPACK_INSTALL_PREFIX})
@@ -59,7 +60,7 @@ set(CPACK_RPM_CHANGELOG_FILE "${CMAKE_CURRENT_SOURCE_DIR}////changelog.txt")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
-set(CPACK_DEBIAN_PACKAGE_NAME "XTrkCad")
+set(CPACK_DEBIAN_PACKAGE_NAME "XTrkCad${XTRKCAD_BETA}")
set(CPACK_DEBIAN_PACKAGE_VERSION "1:${XTRKCAD_VERSION}")
@@ -95,7 +96,4 @@ 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
index 914534d..969aa7e 100755
--- a/distribution/posix/postinst
+++ b/distribution/posix/postinst
@@ -7,14 +7,7 @@ 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
+INSTALLDIR=/usr/share/xtrkcad
( su -c "sh ${INSTALLDIR}/xtrkcad-setup install ${INSTALLDIR}" -l $SUDO_USER ) >> ${LOGF} 2>&1
diff --git a/distribution/posix/prerm b/distribution/posix/prerm
index 3c5db28..b5ae917 100755
--- a/distribution/posix/prerm
+++ b/distribution/posix/prerm
@@ -7,14 +7,7 @@ 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
+INSTALLDIR=/usr/share/xtrkcad
( su -c "sh ${INSTALLDIR}/xtrkcad-setup remove ${INSTALLDIR}" -l $SUDO_USER ) >> ${LOGF} 2>&1