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
1ae52fcf
Commit
1ae52fcf
authored
Mar 17, 2025
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-repack-rpm: move __fix_spec to generic.sh
parent
7e0a307e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
70 deletions
+61
-70
epm-repack-rpm
bin/epm-repack-rpm
+1
-70
generic.sh
repack.d/generic.sh
+60
-0
No files found.
bin/epm-repack-rpm
View file @
1ae52fcf
...
...
@@ -17,74 +17,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
__icons_res_list
=
"apps scalable symbolic 8x8 14x14 16x16 20x20 22x22 24x24 28x28 32x32 36x36 42x42 45x45 48x48 64 64x64 72x72 96x96 128x128 144x144 160x160 192x192 256x256 256x256@2x 480x480 512 512x512 1024x1024"
__icons_type_list
=
"actions animations apps categories devices emblems emotes filesystems intl mimetypes places status stock"
__get_icons_hicolor_list
()
{
local
i j
for
i
in
${
__icons_res_list
}
;
do
echo
"/usr/share/icons/hicolor/
$i
"
for
j
in
${
__icons_type_list
}
;
do
echo
"/usr/share/icons/hicolor/
$i
/
$j
"
done
done
}
__get_icons_gnome_list
()
{
local
i j
for
i
in
${
__icons_res_list
}
;
do
echo
"/usr/share/icons/gnome/
$i
"
for
j
in
${
__icons_type_list
}
;
do
echo
"/usr/share/icons/gnome/
$i
/
$j
"
done
done
}
# args: pkgname buildroot spec
__fix_spec
()
{
local
pkgname
=
"
$1
"
local
buildroot
=
"
$2
"
local
spec
=
"
$3
"
local
i
# drop forbidded paths
# https://bugzilla.altlinux.org/show_bug.cgi?id=38842
for
i
in
/ /etc /etc/init.d /etc/systemd /bin /opt /usr /usr/bin /usr/lib /usr/lib64 /usr/share /usr/share/doc /var /var/log /var/run
\
/etc/cron.daily /usr/share/icons/usr/share/pixmaps /usr/share/man /usr/share/man/man1 /usr/share/appdata /usr/share/applications /usr/share/menu
\
/usr/share/mime /usr/share/mime/packages /usr/share/icons
\
/usr/share/icons/gnome
$(
__get_icons_gnome_list
)
\
/usr/share/icons/hicolor
$(
__get_icons_hicolor_list
)
;
do
sed
-i
\
-e
"s|/
\.
/|/|"
\
-e
"s|^%dir[[:space:]]
\"
$i
/*
\"
$|
|"
\
-e
"s|^%dir[[:space:]]
$i
/*
$|
|"
\
-e
"s|^
\"
$i
/*
\"
$|
|"
\
-e
"s|^
$i
/*
$|
|"
\
$spec
done
# commented out: conflicts with already installed package
# drop %dir for existed system dirs
#for i in $(grep '^%dir "' $spec | sed -e 's|^%dir *"\(.*\)".*|\1|' ) ; do #"
# echo "$i" | grep -q '^/opt/' && continue
# [ -d "$i" ] && [ -n "$verbose" ] && echo "drop dir $i from packing, it exists in the system"
#done
# replace dir "/path/dir" -> %dir /path/dir
grep
'^"/'
$spec
|
sed
-e
's|^"\(/.*\)"$|\1|'
|
while
read
i
;
do
# add dir as %dir in the filelist
if
[
-d
"
$buildroot$i
"
]
&&
[
!
-L
"
$buildroot$i
"
]
;
then
subst
"s|^
\(\"
$i
\"\)
$|
%dir
\1
|"
$spec
#else
# subst 's|^\("'$i'"\)$|\1|' $spec
fi
done
}
has_repack_script
()
{
local
repackcode
=
"
$EPM_REPACK_SCRIPTS_DIR
/
$1
.sh"
...
...
@@ -241,14 +173,13 @@ __epm_repack_to_rpm()
# run generic scripts and repack script for the pkg
cd
$buildroot
||
fatal
__fix_spec
$pkgname
$buildroot
$spec
__apply_fix_code
"generic"
$buildroot
$spec
$pkgname
$abspkg
$SUBGENERIC
__apply_fix_code
"generic-
$SUBGENERIC
"
$buildroot
$spec
$pkgname
$abspkg
__apply_fix_code
$pkgname
$buildroot
$spec
$pkgname
$abspkg
if
!
has_repack_script
$pkgname
;
then
__apply_fix_code
"generic-default"
$buildroot
$spec
$pkgname
$abspkg
fi
__
fix_spec
$pkgname
$buildroot
$spec
__
apply_fix_code
"generic-post"
$buildroot
$spec
$pkgname
$abspkg
cd
-
>
/dev/null
# reassign package name (could be renamed in fix scripts)
...
...
repack.d/generic.sh
View file @
1ae52fcf
...
...
@@ -9,6 +9,66 @@ SUBGENERIC="$5"
# firstly, pack $PRODUCTDIR if used
.
$(
dirname
$0
)
/common.sh
# commented out: conflicts with already installed package
# drop %dir for existed system dirs
#for i in $(grep '^%dir "' $spec | sed -e 's|^%dir *"\(.*\)".*|\1|' ) ; do #"
# echo "$i" | grep -q '^/opt/' && continue
# [ -d "$i" ] && [ -n "$verbose" ] && echo "drop dir $i from packing, it exists in the system"
#done
# TODO: drop it, it breaks packages with spaces in paths
# replace dir "/path/dir" -> %dir /path/dir
grep
'^"/'
$SPEC
|
sed
-e
's|^"\(/.*\)"$|\1|'
|
while
read
i
;
do
# add dir as %dir in the filelist
if
[
-d
"
$BUILDROOT$i
"
]
&&
[
!
-L
"
$BUILDROOT$i
"
]
;
then
subst
"s|^
\(\"
$i
\"\)
$|
%dir
\1
|"
$SPEC
#else
# subst 's|^\("'$i'"\)$|\1|' $spec
fi
done
__icons_res_list
=
"apps scalable symbolic 8x8 14x14 16x16 20x20 22x22 24x24 28x28 32x32 36x36 42x42 45x45 48x48 64 64x64 72x72 96x96 128x128 144x144 160x160 192x192 256x256 256x256@2x 480x480 512 512x512 1024x1024"
__icons_type_list
=
"actions animations apps categories devices emblems emotes filesystems intl mimetypes places status stock"
__get_icons_hicolor_list
()
{
local
i j
for
i
in
${
__icons_res_list
}
;
do
echo
"/usr/share/icons/hicolor/
$i
"
for
j
in
${
__icons_type_list
}
;
do
echo
"/usr/share/icons/hicolor/
$i
/
$j
"
done
done
}
__get_icons_gnome_list
()
{
local
i j
for
i
in
${
__icons_res_list
}
;
do
echo
"/usr/share/icons/gnome/
$i
"
for
j
in
${
__icons_type_list
}
;
do
echo
"/usr/share/icons/gnome/
$i
/
$j
"
done
done
}
# drop forbidded paths
# https://bugzilla.altlinux.org/show_bug.cgi?id=38842
for
i
in
/ /etc /etc/init.d /etc/systemd /bin /opt /usr /usr/bin /usr/lib /usr/lib64 /usr/share /usr/share/doc /var /var/log /var/run
\
/etc/cron.daily /usr/share/icons/usr/share/pixmaps /usr/share/man /usr/share/man/man1 /usr/share/appdata /usr/share/applications /usr/share/menu
\
/usr/share/mime /usr/share/mime/packages /usr/share/icons
\
/usr/share/icons/gnome
$(
__get_icons_gnome_list
)
\
/usr/share/icons/hicolor
$(
__get_icons_hicolor_list
)
;
do
sed
-i
\
-e
"s|/
\.
/|/|"
\
-e
"s|^%dir[[:space:]]
\"
$i
/*
\"
$|
|"
\
-e
"s|^%dir[[:space:]]
$i
/*
$|
|"
\
-e
"s|^
\"
$i
/*
\"
$|
|"
\
-e
"s|^
$i
/*
$|
|"
\
$SPEC
done
flag_python3
=
''
for
i
in
lib/python3 lib/python2.7
;
do
...
...
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