Commit a6cbd93b authored by eric pellegrini's avatar eric pellegrini

(Re)Harmonized Windows and Unix directory structure

parent 9f36c1ad
......@@ -23,7 +23,7 @@ mkdir -p ${DEBIAN_ROOT_DIR}
echo -e "${BLUE}""Build debian tree""${NORMAL}"
# Copy all the debian files (e.g. control, copyright, md5sum ...) into DEBIAN directory
cp -r ${SCRIPT_DIR}/DEBIAN ${DEBIAN_ROOT_DIR}/
cp -r ${SCRIPT_DIR}/Resources/DEBIAN ${DEBIAN_ROOT_DIR}/
# Set automatically the good version number for the Debian control file
sed -i "s/Version:.*/Version: ${VERSION_NAME}/g" ${DEBIAN_ROOT_DIR}/DEBIAN/control
chmod -R 755 ${DEBIAN_ROOT_DIR}/DEBIAN
......@@ -31,7 +31,7 @@ chmod -R 755 ${DEBIAN_ROOT_DIR}/DEBIAN
# Build the /usr/share/applications directory inside the debian root directory and copy the mdanse desktop file inside
DEBIAN_APP_DIR=${DEBIAN_ROOT_DIR}/usr/share/applications
mkdir -p ${DEBIAN_APP_DIR}
cp ${SCRIPT_DIR}/MDANSE.desktop ${DEBIAN_APP_DIR}/
cp ${SCRIPT_DIR}/Resources/MDANSE.desktop ${DEBIAN_APP_DIR}/
# Build the /usr/share/pixmaps directory inside the debian root directory and copy the mdanse icon file inside
DEBIAN_PIXMAPS_DIR=${DEBIAN_ROOT_DIR}/usr/share/pixmaps
......
......@@ -88,4 +88,4 @@ ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/change_dylib_path.sh
hdiutil unmount /Volumes/MDANSE -force -quiet
sleep 5
${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/dmg/create-dmg --background "${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/dmg/dmg_background.jpg" --volname "MDANSE" --window-pos 200 120 --window-size 800 400 --icon MDANSE.app 200 190 --hide-extension MDANSE.app --app-drop-link 600 185 "${MDANSE_DMG}" ${CI_TEMP_DIR}/dist
${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/Resources/dmg/create-dmg --background "${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/Resources/dmg/dmg_background.jpg" --volname "MDANSE" --window-pos 200 120 --window-size 800 400 --icon MDANSE.app 200 190 --hide-extension MDANSE.app --app-drop-link 600 185 "${MDANSE_DMG}" ${CI_TEMP_DIR}/dist
......@@ -56,28 +56,3 @@ if [ $status -ne 0 ]; then
exit $status
fi
PKG_INFO=${CI_TEMP_INSTALL_DIR}/lib/python2.7/site-packages/MDANSE/__pkginfo__.py
# Update the __pkginfo__ file with the current commit
$SED_I_COMMAND "s/.*__commit__.*/__commit__ = \"${CI_COMMIT_ID}\"/" ${PKG_INFO}
# Get MDANSE version
MDANSE_VERSION=`sed -n 's/__version__.*=.*\"\(.*\)\"/\1/p' ${PKG_INFO}`
# Check if branch is master
if [[ ${CI_COMMIT_REF_NAME} == "master" ]]
then
VERSION_NAME=${MDANSE_VERSION}
${SED_I_COMMAND} "s/.*__beta__.*/__beta__ = None/" ${PKG_INFO}
else
# Check if branch is release*
if [[ ${CI_COMMIT_REF_NAME::7} == "release" ]]
then
VERSION_NAME=${MDANSE_VERSION}-rc-${CI_COMMIT_ID}
${SED_I_COMMAND} "s/.*__beta__.*/__beta__ = \"rc\"/" ${PKG_INFO}
else
VERSION_NAME=${MDANSE_VERSION}-beta-${CI_COMMIT_ID}
${SED_I_COMMAND} "s/.*__beta__.*/__beta__ = \"beta\"/" ${PKG_INFO}
fi
fi
export VERSION_NAME
......@@ -36,3 +36,30 @@ export NORMAL="\\033[0m"
echo -e "${BLUE}""Commit id = ${CI_COMMIT_ID}""${NORMAL}"
echo -e "${BLUE}""Branch name = ${CI_COMMIT_REF_NAME}""${NORMAL}"
PKG_INFO=${CI_TEMP_INSTALL_DIR}/lib/python2.7/site-packages/MDANSE/__pkginfo__.py
# Update the __pkginfo__ file with the current commit
$SED_I_COMMAND "s/.*__commit__.*/__commit__ = \"${CI_COMMIT_ID}\"/" ${PKG_INFO}
# Get MDANSE version
MDANSE_VERSION=`sed -n 's/__version__.*=.*\"\(.*\)\"/\1/p' ${PKG_INFO}`
# Check if branch is master
if [[ ${CI_COMMIT_REF_NAME} == "master" ]]
then
VERSION_NAME=${MDANSE_VERSION}
${SED_I_COMMAND} "s/.*__beta__.*/__beta__ = None/" ${PKG_INFO}
else
# Check if branch is release*
if [[ ${CI_COMMIT_REF_NAME::7} == "release" ]]
then
VERSION_NAME=${MDANSE_VERSION}-rc-${CI_COMMIT_ID}
${SED_I_COMMAND} "s/.*__beta__.*/__beta__ = \"rc\"/" ${PKG_INFO}
else
VERSION_NAME=${MDANSE_VERSION}-beta-${CI_COMMIT_ID}
${SED_I_COMMAND} "s/.*__beta__.*/__beta__ = \"beta\"/" ${PKG_INFO}
fi
fi
export VERSION_NAME
......@@ -35,20 +35,20 @@ if %STATUS% neq 0 (
cd "%MDANSE_SOURCE_DIR%\\BuildServer\\Windows"
rem copy LICENSE
copy %MDANSE_SOURCE_DIR%\\LICENSE %MDANSE_SOURCE_DIR%\\BuildServer\\Windows\\Windows_resources\\nsis\\
copy %MDANSE_SOURCE_DIR%\\LICENSE %MDANSE_SOURCE_DIR%\\BuildServer\\Windows\\Resources\\nsis\\
rem copy CHANGELOG to CHANGELOG.txt (compulsory to be opened by nsis through an external text editor)
copy %MDANSE_SOURCE_DIR%\\CHANGELOG %MDANSE_SOURCE_DIR%\\BuildServer\\Windows\\Windows_resources\\nsis\\CHANGELOG.txt
copy %MDANSE_SOURCE_DIR%\\CHANGELOG %MDANSE_SOURCE_DIR%\\BuildServer\\Windows\\Resources\\nsis\\CHANGELOG.txt
rem Copy site.py
copy %MDANSE_SOURCE_DIR%\\BuildServer\\Windows\\Windows_resources\\site.py %MDANSE_TEMPORARY_INSTALLATION_DIR%\\Lib\\
copy %MDANSE_SOURCE_DIR%\\BuildServer\\Windows\\Resources\\site.py %MDANSE_TEMPORARY_INSTALLATION_DIR%\\Lib\\
rem Copy Visual dll see https://stackoverflow.com/questions/214852/python-module-dlls to understand why dll copy destination folder must be the Scientific folder
copy "%MDANSE_DEPENDENCIES_DIR%\\NetCDF\\vcruntime140.dll" "%MDANSE_TEMPORARY_INSTALLATION_DIR%\\Lib\\site-packages\\Scientific\\"
rem create the MDANSE installer
echo "Creating nsis installer for target %MDANSE_TEMPORARY_INSTALLATION_DIR%..."
makensis /V4 /ONSISlog.txt /DVERSION=%VERSION_NAME% /DARCH=%BUILD_TARGET% /DTARGET_DIR=%MDANSE_TEMPORARY_INSTALLATION_DIR% %MDANSE_SOURCE_DIR%\\BuildServer\\Windows\\Windows_resources\\nsis\\MDANSE_installer.nsi
makensis /V4 /ONSISlog.txt /DVERSION=%VERSION_NAME% /DARCH=%BUILD_TARGET% /DTARGET_DIR=%MDANSE_TEMPORARY_INSTALLATION_DIR% %MDANSE_SOURCE_DIR%\\BuildServer\\Windows\\Resources\\nsis\\MDANSE_installer.nsi
set STATUS=%ERRORLEVEL%
rem Exit now if something goes wrong
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment