Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
b44ac857
Commit
b44ac857
authored
Apr 17, 2022
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm install/repack: add AppImage support
parent
c848bf28
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
8 deletions
+64
-8
epm-install
bin/epm-install
+4
-2
epm-repack
bin/epm-repack
+23
-6
epm-sh-functions
bin/epm-sh-functions
+4
-0
generic-appimage.sh
repack.d/generic-appimage.sh
+33
-0
No files found.
bin/epm-install
View file @
b44ac857
...
...
@@ -309,7 +309,8 @@ epm_install_files()
ALTLinux|ALTServer
)
# TODO: replace with name changed function
__epm_check_if_try_install_deb
$@
&&
return
__epm_check_if_try_install_pkgtype deb
$@
&&
return
__epm_check_if_try_install_pkgtype AppImage
$@
&&
return
__epm_check_if_src_rpm
$@
# do not using low-level for install by file path (FIXME: reasons?)
...
...
@@ -355,7 +356,8 @@ epm_install_files()
;;
*
-rpm
)
__epm_check_if_try_install_deb
$@
&&
return
__epm_check_if_try_install_pkgtype deb
$@
&&
return
__epm_check_if_try_install_pkgtype AppImage
$@
&&
return
__epm_check_if_src_rpm
$@
sudocmd rpm
-Uvh
$force
$noscripts
$nodeps
$@
&&
return
local
RES
=
$?
...
...
bin/epm-repack
View file @
b44ac857
...
...
@@ -227,8 +227,23 @@ __epm_repack_to_rpm()
PKGNAME
=
''
VERSION
=
''
SUBGENERIC
=
''
# convert tarballs to tar (for alien)
if
!
echo
"
$pkg
"
|
grep
-q
"
\.
rpm"
&&
!
echo
"
$pkg
"
|
grep
-q
"
\.
deb"
;
then
if
rhas
"
$pkg
"
"
\.
(rpm|deb)$"
;
then
:
elif
rhas
"
$pkg
"
"
\.
AppImage$"
;
then
VERSION
=
"
$(
echo
"
$alpkg
"
|
grep
-o
-P
"[-_.]([0-9])([0-9])*(
\.
[0-9])*"
|
head
-n1
|
sed
-e
's|^[-_.]||'
)
"
#"
[
-n
"
$VERSION
"
]
||
fatal
"Can't get version from
$alpkg
."
PKGNAME
=
"
$(
echo
"
$alpkg
"
|
sed
-e
"s|[-_.]
$VERSION
.*||"
)
"
# TODO: move repack archive to erc?
[
-x
"
$alpkg
"
]
||
docmd
chmod
u+x
-v
"
$alpkg
"
#[ -x "$alpkg" ] || sudocmd chmod u+x -v "$abspkg"
SUBGENERIC
=
'appimage'
./
$alpkg
--appimage-extract
||
fatal
alpkg
=
$PKGNAME
-
$VERSION
.tar
erc a
$alpkg
squashfs-root
fi
VERSION
=
"
$(
echo
"
$alpkg
"
|
grep
-o
-P
"[-_.]([0-9])([0-9])*(
\.
[0-9])*"
|
head
-n1
|
sed
-e
's|^[-_.]||'
)
"
#"
if
[
-n
"
$VERSION
"
]
;
then
PKGNAME
=
"
$(
echo
"
$alpkg
"
|
sed
-e
"s|[-_.]
$VERSION
.*||"
)
"
...
...
@@ -244,7 +259,6 @@ __epm_repack_to_rpm()
alpkg
=
$newalpkg
fi
fi
fi
cd
$tmpbuilddir
/
||
fatal
...
...
@@ -271,6 +285,7 @@ __epm_repack_to_rpm()
__fix_spec
$pkgname
$tmpbuilddir
/
$subdir
$spec
__apply_fix_code
"generic"
$tmpbuilddir
/
$subdir
$spec
[
-n
"
$SUBGENERIC
"
]
&&
__apply_fix_code
"generic-
$SUBGENERIC
"
$tmpbuilddir
/
$subdir
$spec
__apply_fix_code
$pkgname
$tmpbuilddir
/
$subdir
$spec
# TODO: we need these dirs to be created
to_remove_pkg_dirs
=
"
$to_remove_pkg_dirs
$HOME
/RPM/BUILD
$HOME
/RPM"
...
...
@@ -300,14 +315,16 @@ __epm_repack_to_rpm()
true
}
__epm_check_if_try_install_
deb
()
__epm_check_if_try_install_
pkgtype
()
{
__epm_split_by_pkg_type deb
"
$@
"
||
return
1
local
PKG
=
"
$1
"
shift
__epm_split_by_pkg_type
$PKG
"
$@
"
||
return
1
__epm_repack_to_rpm
$split_replaced_pkgs
||
fatal
# TODO: move to install
docmd epm
install
$repacked_rpms
local
RES
=
$?
# TODO: move it to exit handler
if
[
-z
"
$DEBUG
"
]
;
then
# TODO: reinvent
...
...
@@ -316,7 +333,7 @@ __epm_check_if_try_install_deb()
[
-n
"
$to_remove_pkg_dirs
"
]
&&
rmdir
$to_remove_pkg_dirs
2>/dev/null
fi
return
0
return
$RES
}
...
...
bin/epm-sh-functions
View file @
b44ac857
...
...
@@ -532,6 +532,10 @@ get_package_type()
echo
"msi"
return
;;
*
.AppImage
)
echo
"AppImage"
return
;;
*
)
#fatal "Don't know type of $1"
# return package name for info
...
...
repack.d/generic-appimage.sh
0 → 100755
View file @
b44ac857
#!/bin/sh -x
# It will run with two args: buildroot spec
BUILDROOT
=
"
$1
"
SPEC
=
"
$2
"
PRODUCT
=
"
$(
grep
"^Name: "
$SPEC
|
sed
-e
"s|Name: ||g"
|
head
-n1
)
"
PRODUCTDIR
=
/opt/
$PRODUCT
.
$(
dirname
$0
)
/common.sh
# move package to /opt
ROOTDIR
=
$(
basename
$(
find
$BUILDROOT
-mindepth
1
-maxdepth
1
-type
d
))
mkdir
-p
$BUILDROOT
/opt
mv
$BUILDROOT
/
$ROOTDIR
$BUILDROOT$PRODUCTDIR
subst
"s|
\"
/
$ROOTDIR
/|
\"
$PRODUCTDIR
/|"
$SPEC
fix_chrome_sandbox
cd
$BUILDROOT$PRODUCTDIR
DESKTOPFILE
=
"
$(
echo
*
.desktop |
head
-n1
)
"
ICONFILE
=
"
$(
cat
$DESKTOPFILE
|
grep
"^Icon"
|
head
-n1
|
sed
-e
's|Icon=||'
)
.png"
mkdir
-p
$BUILDROOT
/usr/share/applications/
cat
$DESKTOPFILE
|
sed
-e
"s|AppRun|
$PRODUCT
|"
>
$BUILDROOT
/usr/share/applications/
$DESKTOPFILE
pack_file /usr/share/applications/
$DESKTOPFILE
mkdir
-p
$BUILDROOT
/usr/share/pixmaps/
cp
$ICONFILE
$BUILDROOT
/usr/share/pixmaps/
pack_file /usr/share/pixmaps/kontur-talk.png
cd
-
>
/dev/null
add_bin_exec_command
$PRODUCT
$PRODUCTDIR
/AppRun
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment