From e07c12daccd4ac65410e5d86d008df960c5c6534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B3=D0=BE=D1=80?= <148970641+Egor00f@users.noreply.github.com> Date: Mon, 11 Nov 2024 07:47:00 +0000 Subject: [PATCH] fix adding link to toolchain dir and remove & add copyright to package --- .gitignore | 3 ++- CMakeLists.txt | 2 ++ install.sh | 7 ++++--- package/DEBIAN/control | 2 +- package/DEBIAN/postrm | 6 +++--- package/DEBIAN/prerm | 2 ++ 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 5317c62..8ff6a58 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ Output/ package/DEBIAN/postinst +package/DEBIAN/copyright package.deb -build/ \ No newline at end of file +build/ diff --git a/CMakeLists.txt b/CMakeLists.txt index db1688d..1277121 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,11 +9,13 @@ project( add_custom_target( Package COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/install.sh ${CMAKE_CURRENT_SOURCE_DIR}/package/DEBIAN/postinst + COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/package/DEBIAN/copyright COMMAND chmod 775 ${CMAKE_CURRENT_SOURCE_DIR}/package/DEBIAN COMMAND chmod 775 ${CMAKE_CURRENT_SOURCE_DIR}/package/DEBIAN/control COMMAND chmod 775 ${CMAKE_CURRENT_SOURCE_DIR}/package/DEBIAN/prerm COMMAND chmod 775 ${CMAKE_CURRENT_SOURCE_DIR}/package/DEBIAN/postinst COMMAND chmod 775 ${CMAKE_CURRENT_SOURCE_DIR}/package/DEBIAN/postrm + COMMAND chmod 775 ${CMAKE_CURRENT_SOURCE_DIR}/package/DEBIAN/copyright COMMAND dpkg-deb --build ${CMAKE_CURRENT_SOURCE_DIR}/package ${CMAKE_CURRENT_BINARY_DIR}/package.deb WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) diff --git a/install.sh b/install.sh index 4424b14..3528330 100755 --- a/install.sh +++ b/install.sh @@ -43,6 +43,8 @@ if [[ ! -z "$INPUT" ]]; then TOOLCHAIN_DIR=$INPUT fi +echo "Installing toolchain to $TOOLCHAIN_DIR" + print_msg "Checking utilities..." @@ -136,7 +138,7 @@ print_ok "Successfully!" if [ "$TOOLCHAIN_DIR" != "$DEFAULT_TOOLCHAIN_DIR" ]; then - sudo ln -sf $TOOLCHAIN_DIR $DEFAULT_TOOLCHAIN_DIR + sudo ln -sf $TOOLCHAIN_DIR/win32 $DEFAULT_TOOLCHAIN_DIR fi @@ -146,7 +148,6 @@ EXPORT_MESSSAGE="export $MESSAGE" if [ ! "$(id -u)" -ne 0 ] then - echo $MESSAGE >> /etc/profile sudo mkdir -p /etc/kos32-gcc @@ -154,7 +155,7 @@ then else if ! grep -q $EXPORT_MESSSAGE ~/.bashrc; then print_msg "Adding '$TOOLCHAIN_DIR/win32/bin' to '~/.bashrc'" - echo $EXPORT_MESSSAGE >> ~/.bashrc + echo '$EXPORT_MESSSAGE' >> ~/.bashrc fi fi diff --git a/package/DEBIAN/control b/package/DEBIAN/control index 5fddf45..31fdda7 100755 --- a/package/DEBIAN/control +++ b/package/DEBIAN/control @@ -11,4 +11,4 @@ Origin: http://ftp.kolibrios.org/users/Serge/new/Toolchain Maintainer: Egor00f Installed-Size: 131708 Description: KolibriOS gcc toolchain installer - This package installing KolibriOS gcc toolchain. + This package installing KolibriOS gcc toolchain by Serge. diff --git a/package/DEBIAN/postrm b/package/DEBIAN/postrm index de08bc7..30e207b 100755 --- a/package/DEBIAN/postrm +++ b/package/DEBIAN/postrm @@ -2,10 +2,10 @@ TOOLCHAIN_DIR=$(head -n 1 /etc/kos32-gcc/install-path) -MESSAGE="PATH=\$PATH:$TOOLCHAIN_DIR" +MESSAGE="PATH=\$PATH:$TOOLCHAIN_DIR\win32\bin" -if grep -q $MESSAGE /etc/profile; then - sed -i '/$MESSAGE/d' /etc/profile +if grep -q '$MESSAGE' /etc/profile; then + sudo sed -i '/$MESSAGE/d' /etc/profile fi rm /etc/kos32-gcc -R diff --git a/package/DEBIAN/prerm b/package/DEBIAN/prerm index 0b3ec41..a58ff21 100755 --- a/package/DEBIAN/prerm +++ b/package/DEBIAN/prerm @@ -3,3 +3,5 @@ TOOLCHAIN_DIR=$(head -n 1 /etc/kos32-gcc/install-path) rm -R $TOOLCHAIN_DIR + +rm -R /home/autobuild