mirror of
https://github.com/Ponce/slackbuilds
synced 2024-09-29 17:37:55 +02:00
system/winusb: Added (USB Stick Windows Installer Creator).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
parent
2829844cc2
commit
36d6ed0355
8 changed files with 203 additions and 0 deletions
9
system/winusb/README
Normal file
9
system/winusb/README
Normal file
|
@ -0,0 +1,9 @@
|
|||
WinUSB is a simple tool that enable you to create your own usb stick windows installer from an iso image or a real DVD.
|
||||
|
||||
This package contains two programs:
|
||||
- WinUSB-gui: a graphical interface which is very easy to use.
|
||||
- winusb: the command line tool.
|
||||
|
||||
Supported images: Windows Vista, Seven, 8 installer for any language and any version (home, pro...) and Windows PE.
|
||||
|
||||
NOTE: this application requires a grub from official slackware packages.
|
20
system/winusb/com.slackware.pkexec.winusb.policy
Normal file
20
system/winusb/com.slackware.pkexec.winusb.policy
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE policyconfig PUBLIC
|
||||
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
|
||||
<policyconfig>
|
||||
|
||||
<action id="com.slackware.pkexec.winusb">
|
||||
<description>Run WinUSB</description>
|
||||
<message>Authentication is required to run WinUSB</message>
|
||||
<icon_name>winusbgui-icon</icon_name>
|
||||
<defaults>
|
||||
<allow_any>auth_admin</allow_any>
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>auth_admin</allow_active>
|
||||
</defaults>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/winusbgui</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
||||
</action>
|
||||
|
||||
</policyconfig>
|
3
system/winusb/doinst.sh
Normal file
3
system/winusb/doinst.sh
Normal file
|
@ -0,0 +1,3 @@
|
|||
if [ -x /usr/bin/update-desktop-database ]; then
|
||||
/usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
|
||||
fi
|
23
system/winusb/slack-desc
Normal file
23
system/winusb/slack-desc
Normal file
|
@ -0,0 +1,23 @@
|
|||
# HOW TO EDIT THIS FILE:
|
||||
# The "handy ruler" below makes it easier to edit a package description.
|
||||
# Line up the first '|' above the ':' following the base package name, and
|
||||
# the '|' on the right side marks the last column you can put a character in.
|
||||
# You must make exactly 11 lines for the formatting to be correct. It's also
|
||||
# customary to leave one space after the ':' except on otherwise blank lines.
|
||||
|
||||
|-----handy-ruler------------------------------------------------------|
|
||||
winusb: WinUSB (make a bootable windows install usb)
|
||||
winusb:
|
||||
winusb: WinUSB is a simple tool that enable you to create your own usb stick
|
||||
winusb: windows installer from an iso image or a real DVD.
|
||||
winusb:
|
||||
winusb: This package contains two programs:
|
||||
winusb: - WinUSB-gui: a graphical interface which is very easy to use.
|
||||
winusb: - winusb: the command line tool.
|
||||
winusb:
|
||||
winusb: Supported images: Windows Vista, Seven, 8.
|
||||
winusb:
|
||||
winusb: Homepage: http://en.congelli.eu/prog_info_winusb.html
|
||||
winusb:
|
||||
winusb:
|
||||
winusb:
|
20
system/winusb/winusb-1.0.11-nogksudo1.patch
Normal file
20
system/winusb/winusb-1.0.11-nogksudo1.patch
Normal file
|
@ -0,0 +1,20 @@
|
|||
--- src/MainPanel.cpp 2013-03-27 18:57:44.000000000 -0300
|
||||
+++ winusb-1.0.11-nogksudo1.cpp 2015-01-12 17:01:26.274398856 -0200
|
||||
@@ -240,8 +240,15 @@
|
||||
iso = m_dvdDriveDevList.at(m_dvdDriveList->GetSelection());
|
||||
}
|
||||
|
||||
- PipeManager pipe(std::string("gksudo --description 'WinUSB' -- sh -c 'winusb --noColor --forGui --format \"") + iso + "\" \"" + device + "\" 2>&1'");
|
||||
-
|
||||
+ //PipeManager pipe(std::string("gksudo --description 'WinUSB' -- sh -c 'winusb --noColor --forGui --format \"") + iso + "\" \"" + device + "\" 2>&1'");
|
||||
+
|
||||
+ if(getuid() != 0) {
|
||||
+ wxMessageBox(_("WinUSB must be run by the root user !"), _("Error"), wxOK | wxICON_ERROR, this);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ PipeManager pipe(std::string("winusb --noColor --forGui --format \"") + iso + "\" \"" + device + "\" 2>&1");
|
||||
+
|
||||
wxProgressDialog *dialog = new wxProgressDialog(_("Installing..."), _("Please wait..."), 100, GetParent(), wxPD_APP_MODAL | wxPD_SMOOTH | wxPD_CAN_ABORT);
|
||||
|
||||
wxString log;
|
112
system/winusb/winusb.SlackBuild
Normal file
112
system/winusb/winusb.SlackBuild
Normal file
|
@ -0,0 +1,112 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Slackware build script for winusb
|
||||
|
||||
# Copyright 2015 Ruan K. F, Brazil <ruan.klein@gmail.com>
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use of this script, with or without modification, is
|
||||
# permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of this script must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
PRGNAM=winusb
|
||||
VERSION=${VERSION:-1.0.11}
|
||||
BUILD=${BUILD:-1}
|
||||
TAG=${TAG:-_SBo}
|
||||
|
||||
DOCS="AUTHORS ChangeLog COPYING INSTALL README"
|
||||
|
||||
if [ -z "$ARCH" ]; then
|
||||
case "$( uname -m )" in
|
||||
i?86) ARCH=i486 ;;
|
||||
arm*) ARCH=arm ;;
|
||||
*) ARCH=$( uname -m ) ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
CWD=$(pwd)
|
||||
TMP=${TMP:-/tmp/SBo}
|
||||
PKG=$TMP/package-$PRGNAM
|
||||
OUTPUT=${OUTPUT:-/tmp}
|
||||
|
||||
if [ "$ARCH" = "i486" ]; then
|
||||
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
||||
LIBDIRSUFFIX=""
|
||||
elif [ "$ARCH" = "i686" ]; then
|
||||
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
||||
LIBDIRSUFFIX=""
|
||||
elif [ "$ARCH" = "x86_64" ]; then
|
||||
SLKCFLAGS="-O2 -fPIC"
|
||||
LIBDIRSUFFIX="64"
|
||||
else
|
||||
SLKCFLAGS="-O2"
|
||||
LIBDIRSUFFIX=""
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
rm -rf $PKG
|
||||
mkdir -p $TMP $PKG $OUTPUT
|
||||
cd $TMP
|
||||
rm -rf $PRGNAM-$VERSION
|
||||
tar -zxvf $CWD/$PRGNAM-$VERSION.tar.gz
|
||||
cd $PRGNAM-$VERSION
|
||||
chown -R root:root .
|
||||
find -L . \
|
||||
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
||||
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
||||
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
||||
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
||||
|
||||
# patch to avoid gksudo and use pkexec from official polkit pkg
|
||||
patch src/MainPanel.cpp < $CWD/winusb-1.0.11-nogksudo1.patch
|
||||
|
||||
CFLAGS="$SLKCFLAGS" \
|
||||
CXXFLAGS="$SLKCFLAGS" \
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
||||
--sysconfdir=/etc \
|
||||
--localstatedir=/var \
|
||||
--mandir=/usr/man \
|
||||
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
||||
--build=$ARCH-slackware-linux
|
||||
|
||||
make
|
||||
make install DESTDIR=$PKG
|
||||
|
||||
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
||||
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
||||
|
||||
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
||||
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
||||
|
||||
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
||||
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
|
||||
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
||||
|
||||
# For pkexec configuration
|
||||
mkdir -p $PKG/usr/share/polkit-1/actions
|
||||
sed -i 's/^\(Exec\)=winusbgui$/\1=winusbgui_polkit/' $PKG/usr/share/applications/winusbgui.desktop
|
||||
install -m0755 -o 0:0 $CWD/winusbgui_polkit $PKG/usr/bin
|
||||
install -m0644 -o 0:0 $CWD/com.slackware.pkexec.winusb.policy $PKG/usr/share/polkit-1/actions
|
||||
|
||||
mkdir -p $PKG/install
|
||||
cat $CWD/slack-desc > $PKG/install/slack-desc
|
||||
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
||||
|
||||
cd $PKG
|
||||
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|
10
system/winusb/winusb.info
Normal file
10
system/winusb/winusb.info
Normal file
|
@ -0,0 +1,10 @@
|
|||
PRGNAM="winusb"
|
||||
VERSION="1.0.11"
|
||||
HOMEPAGE="http://en.congelli.eu/prog_info_winusb.html"
|
||||
DOWNLOAD="http://ftp.cc.uoc.gr/mirrors/linux/frugalware/frugalware-current/source/xapps-extra/winusb/winusb-1.0.11.tar.gz"
|
||||
MD5SUM="08a5de928f510d383b7bca0a31adb2d6"
|
||||
DOWNLOAD_x86_64=""
|
||||
MD5SUM_x86_64=""
|
||||
REQUIRES="wxPython"
|
||||
MAINTAINER="Ruan K. F"
|
||||
EMAIL="ruan.klein@gmail.com"
|
6
system/winusb/winusbgui_polkit
Normal file
6
system/winusb/winusbgui_polkit
Normal file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
if (which pkexec >/dev/null 2>&1); then
|
||||
pkexec --disable-internal-agent /usr/bin/winusbgui "$@"
|
||||
else
|
||||
/usr/bin/winusbgui "$@"
|
||||
fi
|
Loading…
Reference in a new issue