Skip to content

Commit

Permalink
Reverted to original behaviour of compiling X11rdp in /opt,
Browse files Browse the repository at this point in the history
because the new behaviour simply didn't work - a different
strategy is needed.
  • Loading branch information
scarygliders committed Nov 22, 2014
1 parent 6c9a6bc commit b77ce70
Showing 1 changed file with 61 additions and 38 deletions.
99 changes: 61 additions & 38 deletions X11rdp-o-matic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,8 @@ compile_X11rdp_interactive()

compile_X11rdp_noninteractive()
{
# Don't compile to /opt, compile to a target within the xrdp source...
mkdir -p $WORKINGDIR/xrdp/xorg/debuild/x11rdp-files/$X11DIR
cd $WORKINGDIR/xrdp/xorg/X11R7.6/
# -------> sh buildx.sh $X11DIR
sh buildx.sh $WORKINGDIR/xrdp/xorg/debuild/x11rdp-files/$X11DIR
sh buildx.sh $X11DIR
RC=$?
if [ $RC -ne 0 ]; then
echo "error building X11rdp"
Expand All @@ -340,19 +337,33 @@ package_X11rdp_noninteractive()
mkdir -p $PKGDEST
fi

mkdir -p $WORKINGDIR/xrdp/xorg/debuild/x11rdp-files/DEBIAN
cp $WORKINGDIR/control $WORKINGDIR/xrdp/xorg/debuild/x11rdp-files/DEBIAN
cp -a $WORKINGDIR/x11rdp_postinst $WORKINGDIR/xrdp/xorg/debuild/x11rdp-files/DEBIAN/postinst
cd $WORKINGDIR/xrdp/xorg/debuild
PACKDIR=x11rdp-files
NAME=x11rdp
sed -i -e "s/DUMMYVERINFO/$VERSION-$RELEASE/" $PACKDIR/DEBIAN/control
sed -i -e "s/DUMMYARCHINFO/$ARCH/" $PACKDIR/DEBIAN/control
# need a different delimiter, since it has a path
sed -i -e "s,DUMMYDIRINFO,/$X11DIR," $PACKDIR/DEBIAN/postinst
dpkg-deb --build $PACKDIR $PKGDEST/${NAME}_$VERSION-${RELEASE}_${ARCH}.deb
XORGPKGNAME=${NAME}_$VERSION-${RELEASE}_${ARCH}.deb
rm -rf $PACKDIR
if [ $BLEED == 1 ]
then
cd $WORKINGDIR/xrdp/xorg/debuild
./debX11rdp.sh $VERSION $RELEASE $X11DIR $PKGDEST
else
mkdir -p $WORKINGDIR/xrdp/xorg/debuild/x11rdp-files/DEBIAN
cp $WORKINGDIR/control $WORKINGDIR/xrdp/xorg/debuild/x11rdp-files/DEBIAN
cp -a $WORKINGDIR/x11rdp_postinst $WORKINGDIR/xrdp/xorg/debuild/x11rdp-files/DEBIAN/postinst
cd $WORKINGDIR/xrdp/xorg/debuild
PACKDIR=x11rdp-files
DESTDIR=$PACKDIR/opt
NAME=x11rdp
sed -i -e "s/DUMMYVERINFO/$VERSION-$RELEASE/" $PACKDIR/DEBIAN/control
sed -i -e "s/DUMMYARCHINFO/$ARCH/" $PACKDIR/DEBIAN/control
# need a different delimiter, since it has a path
sed -i -e "s,DUMMYDIRINFO,$X11DIR," $PACKDIR/DEBIAN/postinst
mkdir -p $DESTDIR
cp -Rf $X11DIR $DESTDIR
dpkg-deb --build $PACKDIR $PKGDEST/${NAME}_$VERSION-${RELEASE}_${ARCH}.deb
XORGPKGNAME=${NAME}_$VERSION-${RELEASE}_${ARCH}.deb
# revert to initial state
rm -rf $DESTDIR
sed -i -e "s/$VERSION-$RELEASE/DUMMYVERINFO/" $PACKDIR/DEBIAN/control
sed -i -e "s/$ARCH/DUMMYARCHINFO/" $PACKDIR/DEBIAN/control
# need a different delimiter, since it has a path
sed -i -e "s,$X11DIR,DUMMYDIRINFO," $PACKDIR/DEBIAN/postinst
fi
}

package_X11rdp_interactive()
Expand All @@ -364,21 +375,33 @@ package_X11rdp_interactive()
mkdir -p $PKGDEST
fi

(
mkdir -p $WORKINGDIR/xrdp/xorg/debuild/x11rdp-files/DEBIAN;
cp $WORKINGDIR/control $WORKINGDIR/xrdp/xorg/debuild/x11rdp-files/DEBIAN;
cp -a $WORKINGDIR/x11rdp_postinst $WORKINGDIR/xrdp/xorg/debuild/x11rdp-files/DEBIAN;
cd $WORKINGDIR/xrdp/xorg/debuild;
PACKDIR=x11rdp-files;
NAME=x11rdp;
sed -i -e "s/DUMMYVERINFO/$VERSION-$RELEASE/" $PACKDIR/DEBIAN/control;
sed -i -e "s/DUMMYARCHINFO/$ARCH/" $PACKDIR/DEBIAN/control;
# need a different delimiter, since it has a path
sed -i -e "s,DUMMYDIRINFO,$X11DIR," $PACKDIR/DEBIAN/postinst;
dpkg-deb --build $PACKDIR $PKGDEST/${NAME}_$VERSION-${RELEASE}_${ARCH}.deb;
XORGPKGNAME=${NAME}_$VERSION-${RELEASE}_${ARCH}.deb;
rm -rf $PACKDIR;
) 2>&1 | dialog --progressbox "Making X11rdp Debian Package..." 30 100
if [ $BLEED == 1 ]
then
cd $WORKINGDIR/xrdp/xorg/debuild
./debX11rdp.sh $VERSION $RELEASE $X11DIR $PKGDEST
else
( mkdir -p $WORKINGDIR/xrdp/xorg/debuild/x11rdp-files/DEBIAN;
cp $WORKINGDIR/control $WORKINGDIR/xrdp/xorg/debuild/x11rdp-files/DEBIAN;
cp -a $WORKINGDIR/x11rdp_postinst $WORKINGDIR/xrdp/xorg/debuild/x11rdp-files/DEBIAN;
cd $WORKINGDIR/xrdp/xorg/debuild;
PACKDIR=x11rdp-files;
DESTDIR=$PACKDIR/opt;
NAME=x11rdp;
sed -i -e "s/DUMMYVERINFO/$VERSION-$RELEASE/" $PACKDIR/DEBIAN/control;
sed -i -e "s/DUMMYARCHINFO/$ARCH/" $PACKDIR/DEBIAN/control;
# need a different delimiter, since it has a path
sed -i -e "s,DUMMYDIRINFO,$X11DIR," $PACKDIR/DEBIAN/postinst;
mkdir -p $DESTDIR;
cp -Rf $X11DIR $DESTDIR;
dpkg-deb --build $PACKDIR $PKGDEST/${NAME}_$VERSION-${RELEASE}_${ARCH}.deb;
XORGPKGNAME=${NAME}_$VERSION-${RELEASE}_${ARCH}.deb;
# revert to initial state
rm -rf $DESTDIR;
sed -i -e "s/$VERSION-$RELEASE/DUMMYVERINFO/" $PACKDIR/DEBIAN/control;
sed -i -e "s/$ARCH/DUMMYARCHINFO/" $PACKDIR/DEBIAN/control;
# need a different delimiter, since it has a path
sed -i -e "s,$X11DIR,DUMMYDIRINFO," $PACKDIR/DEBIAN/postinst ) 2>&1 | dialog --progressbox "Making X11rdp Debian Package..." 30 100
fi
}

# Interactively compile & package xrdp using dh-make...
Expand Down Expand Up @@ -735,7 +758,7 @@ download_compile_interactively()
if [ "$X11RDP" == "1" ]; then
compile_X11rdp_interactive
package_X11rdp_interactive
# -----> make_X11rdp_symbolic_link
make_X11rdp_symbolic_link
fi
compile_xrdp_interactive
}
Expand All @@ -754,7 +777,7 @@ download_compile_noninteractively()
then
compile_X11rdp_noninteractive
package_X11rdp_noninteractive
# -----> make_X11rdp_symbolic_link
make_X11rdp_symbolic_link
fi

# New method...
Expand Down Expand Up @@ -951,10 +974,10 @@ if [ "$INSTFLAG" == "0" ] # If not installing on this system...
then
# this is stupid but some Makefiles from X11rdp don't have an uninstall target (ex: Python!)
# ... so instead of not installing X11rdp we remove it in the end
#if [ "$X11RDP" == "1" ] # If we compiled X11rdp then remove the generated X11rdp files (from /opt)
#then
# rm -rf $X11DIR
#fi
if [ "$X11RDP" == "1" ] # If we compiled X11rdp then remove the generated X11rdp files (from /opt)
then
rm -rf $X11DIR
fi

echo $LINE
echo "Will exit now, since we are not installing on this system..."
Expand Down

0 comments on commit b77ce70

Please sign in to comment.