Commit 3888b2ad authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-install: add /etc/eepm/repack.d/PKGNAME.sh support during repacking

parent 57c84a00
......@@ -369,6 +369,14 @@ __fix_spec()
#" hack for highlight
}
__apply_fix_code()
{
local repackcode="/etc/eepm/repack.d/$1.sh"
[ -x "$repackcode" ] || return
shift
docmd $repackcode "$1" "$2" || warning "There was errors with $repackcode script"
}
# will fill repacked_rpms var
__epm_repack_rpm()
{
......@@ -399,6 +407,8 @@ __epm_repack_rpm()
mv $spec $tmpbuilddir || fatal
spec="$tmpbuilddir/$(basename "$spec")"
__fix_spec $tmpbuilddir/$subdir $spec
local pkgname="$(grep "^Name: " $spec | sed -e "s|Name: ||g" | head -n1)"
__apply_fix_code $pkgname $tmpbuilddir/$subdir $spec
showcmd fakeroot rpmbuild --buildroot $tmpbuilddir/$subdir --define='_allow_root_build 1' -bb $spec
if [ -n "$verbose" ] ; then
fakeroot rpmbuild --buildroot $tmpbuilddir/$subdir --define='_allow_root_build 1' -bb $spec || fatal
......
......@@ -54,6 +54,9 @@ cat <<EOF >%buildroot%_sysconfdir/eepm/eepm.conf
EOF
mkdir -p %buildroot%_sysconfdir/eepm/repack.d/
cp repack.d/*.sh %buildroot%_sysconfdir/eepm/repack.d/
chmod 0755 %buildroot%_sysconfdir/eepm/repack.d/*.sh
mkdir -p %buildroot%_sysconfdir/bash_completion.d/
install -m 0644 bash_completion/serv %buildroot%_sysconfdir/bash_completion.d/serv
ln -s serv %buildroot%_sysconfdir/bash_completion.d/cerv
......@@ -70,7 +73,9 @@ rm -f %buildroot%_datadir/%name/tools_eget
%files
%doc README TODO LICENSE
%dir %_sysconfdir/eepm/
%dir %_sysconfdir/eepm/repack.d/
%(config, noreplace) %_sysconfdir/eepm/eepm.conf
%(config, noreplace) %_sysconfdir/eepm/repack.d/*.sh
%_bindir/epm*
%_bindir/eepm
%_bindir/upm
......
#!/bin/sh
# Place shell code here
# It will run with two args: buildroot spec
# Name this script like package name
BUILDROOT="$1"
SPEC="$2"
#!/bin/sh -x
# It will run with two args: buildroot spec
BUILDROOT="$1"
SPEC="$2"
# move binaries from /usr/share/PKGNAME to _libdir/PKGNAME
LIBDIR=$(rpmbuild --eval %_libdir 2>/dev/null)
mkdir -p $BUILDROOT$LIBDIR/
mv $BUILDROOT/usr/share/skypeforlinux/ $BUILDROOT$LIBDIR/
subst "s|/usr/share/skypeforlinux|$LIBDIR/skypeforlinux|g" $SPEC
subst "s|^SKYPE_PATH=.*|SKYPE_PATH=$LIBDIR/skypeforlinux/skypeforlinux|" $BUILDROOT/usr/bin/skypeforlinux
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