Add msys2-base package

This commit is contained in:
Alexpux
2013-11-02 12:43:27 +04:00
parent 07e5ed145c
commit c5a7808611
9 changed files with 273 additions and 0 deletions

46
msys2-base/PKGBUILD Normal file
View File

@@ -0,0 +1,46 @@
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
pkgname=msys2-base
pkgver=1.0
pkgrel=1
pkgdesc="MSYS2 base files"
arch=('any')
url=""
license=('BSD')
groups=('base')
depends=()
provides=($pkgname)
conflicts=($pkgname)
replaces=()
backup=()
options=()
source=('cmd'
'compress-msys2'
'compress_exclude'
'mingw_shell.bat'
'msys2_shell.bat'
'regen-info.sh'
'start'
'which')
noextract=()
md5sums=('bf6a73107768c9b7f667430cfcb1d840'
'8a0f89affc79867b337cf783cff1bbf0'
'3e727adfc6ae21fd5f333dc7d086a51b'
'9e62a3d8ac6af4c8cb4982688d24abf0'
'fb20c7b9a8dc3a0a89a2834bd991186f'
'1c5faeb9b7f083bcdab768c41c933039'
'f9b5897a4f3f3cf7a59ec90a6dd41ed2'
'3de69e0d868cbd5ea2c775335edd33f9')
package() {
mkdir -p $pkgdir/usr/{bin,etc,sbin}
cp -f $srcdir/mingw_shell.bat $pkgdir/usr/
cp -f $srcdir/msys2_shell.bat $pkgdir/usr/
cp -f $srcdir/cmd $pkgdir/usr/bin/
cp -f $srcdir/start $pkgdir/usr/bin
cp -f $srcdir/which $pkgdir/usr/bin/
cp -f $srcdir/regen-info.sh $pkgdir/usr/sbin/
cp -f $srcdir/compress-msys2 $pkgdir/usr/sbin/
cp -f $srcdir/compress_exclude $pkgdir/usr/etc/
}

8
msys2-base/cmd Normal file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
# Copyright (C) 2002, Earnie Boyd
# mailto:earnie@users.sf.net
# This file is part of Minimal SYStem.
# http://www.mingw.org/msys.shtml
# File: cmd
"$COMSPEC" "$@"

32
msys2-base/compress-msys2 Normal file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
_arch=$(uname -m)
_date=$(date +'%Y%m%d')
_filename=${_arch}-msys2-${_date}.tar.xz
_log=/tmp/compress.log
echo "Creating MSYS2 archive /tmp/$_filename"
if [ -f /tmp/$_filename ]; then
rm -f /tmp/$_filename
fi
_dirs=
for curr_dir in /bin /etc /include /lib /libexec /sbin /share /ssl /${_arch}-pc-msys /tmp /var /mingw_shell.bat /msys.ico /msys2_shell.bat ; do
if [[ -d $curr_dir || -f $curr_dir ]]; then
_dirs="$_dirs $curr_dir"
fi
done
if [ -n "$_dirs" ]; then
_compress_cmd="/bin/tar --transform='s/:/_/g' --dereference --hard-dereference -cvJf /tmp/${_filename} $_dirs -X /etc/compress_exclude"
cd /
eval ${_compress_cmd} | tee $_log 2>&1
_result=$?
if [ "$_result" -eq "0" ]; then
echo " done"
else
die "MSYS2 compressing fail. See $_log"
fi
fi
exit 0

View File

@@ -0,0 +1,9 @@
/etc/postinstall/postinstall.marker
/etc/group
/etc/passwd
/etc/mtab
/etc/fstab
/home/*
/dev/*
/tmp/*
/var/tmp/*

View File

@@ -0,0 +1,46 @@
@echo off
rem ember value of GOTO: is used to know recursion has happened.
if "%1" == "GOTO:" goto %2
if NOT "x%WD%" == "x" set WD=
rem ember command.com only uses the first eight characters of the label.
goto _WindowsNT
start /min %COMSPEC% /e:4096 /c %0 GOTO: _Resume %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
goto EOF
rem ember that we execute here if we recursed.
:_Resume
for %%F in (1 2 3) do shift
if NOT EXIST %WD%msys-2.0.dll set WD=.\bin\
rem ember that we get here even in command.com.
:_WindowsNT
if NOT EXIST %WD%msys-2.0.dll set WD=%~dp0\bin\
set MSYSTEM=MINGW
set MSYSCON=mintty.exe
if "x%1" == "x-consolez" set MSYSCON=console.exe
if "x%1" == "x-mintty" set MSYSCON=mintty.exe
if "x%MSYSCON%" == "xmintty.exe" goto startmintty
if "x%MSYSCON%" == "xconsole.exe" goto startconsolez
:startmintty
if NOT EXIST %WD%mintty.exe goto startsh
start %WD%mintty -i /msys.ico -
exit
:startconsolez
cd %WD%..\lib\ConsoleZ
start console -t "MinGW"
exit
:startsh
start %WD%sh --login -i
exit
:EOF

View File

@@ -0,0 +1,46 @@
@echo off
rem ember value of GOTO: is used to know recursion has happened.
if "%1" == "GOTO:" goto %2
if NOT "x%WD%" == "x" set WD=
rem ember command.com only uses the first eight characters of the label.
goto _WindowsNT
start /min %COMSPEC% /e:4096 /c %0 GOTO: _Resume %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
goto EOF
rem ember that we execute here if we recursed.
:_Resume
for %%F in (1 2 3) do shift
if NOT EXIST %WD%msys-2.0.dll set WD=.\bin\
rem ember that we get here even in command.com.
:_WindowsNT
if NOT EXIST %WD%msys-2.0.dll set WD=%~dp0\bin\
set MSYSTEM=MSYS
set MSYSCON=mintty.exe
if "x%1" == "x-consolez" set MSYSCON=console.exe
if "x%1" == "x-mintty" set MSYSCON=mintty.exe
if "x%MSYSCON%" == "xmintty.exe" goto startmintty
if "x%MSYSCON%" == "xconsole.exe" goto startconsolez
:startmintty
if NOT EXIST %WD%mintty.exe goto startsh
start %WD%mintty -i /msys.ico -
exit
:startconsolez
cd %WD%..\lib\ConsoleZ
start console -t "MSys2"
exit
:startsh
start %WD%sh --login -i
exit
:EOF

12
msys2-base/regen-info.sh Normal file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
INFODIR=/usr/share/info
rm -f $INFODIR/dir
for F in $INFODIR/*.info; do
echo -n "--> Installing $F ..."
/usr/bin/install-info --info-file=$F --dir-file=$INFODIR/dir
echo " done"
done
exit 0

8
msys2-base/start Normal file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
# Copyright (C) 2002, Earnie Boyd
# mailto:earnie@users.sf.net
# This file is part of Minimal SYStem.
# http://www.mingw.org/msys.shtml
# File: start
cmd //c start "$@"

66
msys2-base/which Normal file
View File

@@ -0,0 +1,66 @@
#!/bin/sh
# Original copyright (C) 2002, Earnie Boyd
# mailto:earnie@users.sf.net
# This implementation copyright (C) 2006, 2008, Keith Marshall
# mailto:keithmarshall@users.sf.net
#
# This file is part of MSYS
# http://www.mingw.org/msys.shtml
#
# File: which
# $Id: which,v 1.4 2009/03/14 14:13:32 keithmarshall Exp $
CMD=`IFS='\\/:'; set CMD $0; eval echo \$\{$#\}`
if test $# -lt 1
then
echo >&2 "$CMD: syntax error: missing argument"
echo >&2 "Usage: $CMD [ -a | --all ] cmd ..."
exit 1
fi
# To accomodate Woe32's typically asinine $PATH, which frequently
# includes directory names with embedded spaces, we need to set up
# $IFS to consider only a newline as a field separator.
IFS=$'\n'
break=break
for PROG
do
if test x"$PROG" = x-a || test x"$PROG" = x--all
then
break=""
else
WHICH=""
# need `type -ap -- "$PROG" || type -p -- "$PROG"'
# because `type -ap foo' reports nothing, if both `foo' and `foo.exe'
# are present, and are distinct.
for LIST in `type -ap -- "$PROG" || type -p -- "$PROG"`
do
if test -f "$LIST"
then
# preserve `.exe' extension
WHICH="$LIST"`test -f "$LIST.exe" && echo '.exe'`
if test "$LIST" != "$WHICH"
then
# detect distinct `foo' and `foo.exe'
# (this needs IFS=<space>, to get the INODE numbers)
IFS=" " INODE1=`ls -id "$LIST"` INODE2=`ls -id "$WHICH"`
if test `set ref $INODE1; echo $2` != `set ref $INODE2; echo $2`
then
# `foo' matches first, followed by `foo.exe'
test -z "$break" && echo "$LIST" || WHICH="$LIST"
fi
# reset IFS=<newline>, to get any further PROG names
IFS=$'\n'
fi
echo "$WHICH"
$break
fi
done
test x"$WHICH" = x && echo >&2 "$CMD: $PROG: "${ERROR="unknown command"}
fi
done
test ${ERROR+set} && exit 1
exit 0
# $RCSfile: which,v $: end of file