Skip to content

Instantly share code, notes, and snippets.

@jack126guy
Created October 12, 2015 02:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jack126guy/d609d23b3fdd126df4cb to your computer and use it in GitHub Desktop.
Save jack126guy/d609d23b3fdd126df4cb to your computer and use it in GitHub Desktop.
"microsoft-c++-express-2010" Debian package contents
#!/bin/sh
CONF_DIR='/etc/microsoft-c++-express-2010'
if [ -f "$CONF_DIR/cl-base" ]; then
#Trim whitespace
CC="`cat "$CONF_DIR/cl-base" | \
sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
`"
else
CC=''
fi
if [ -n "$CC" ]; then
dosoption "$CC" "$@"
else
echo "No compiler configured for cl. Please run 'dpkg-reconfigure microsoft-c++-express-2010' or edit $CONF_DIR/cl-base."
exit 1
fi
(This file is blank in the actual package.)
/etc/microsoft-c++-express-2010/cl-base
#!/bin/sh
. /usr/share/debconf/confmodule
COMPILERS="cc gcc clang tcc bcc"
CONF_DIR='/etc/microsoft-c++-express-2010'
findcompiler() {
#Get existing configuration and trim whitespace
if [ -f "$CONF_DIR/cl-base" ]; then
DEFAULT="`cat "$CONF_DIR/cl-base" | \
sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
`"
if [ -n "$DEFAULT" ]; then
return 0;
fi
fi
#No existing configuration
for COMPILER in $COMPILERS; do
if [ -n "`which "$COMPILER"`" ]; then
DEFAULT="$COMPILER"
return 0;
fi
done
#No compiler found
return 1;
}
if findcompiler; then
db_set microsoft-c++-express-2010/cl-base "$DEFAULT"
db_input medium microsoft-c++-express-2010/cl-base
else
db_set microsoft-c++-express-2010/cl-base ''
db_input high microsoft-c++-express-2010/compiler-not-found
db_input high microsoft-c++-express-2010/cl-base
fi
db_go
Package: microsoft-c++-express-2010
Version: 1.1
Section: misc
Priority: optional
Architecture: all
Depends: dosoption
Recommends: c-compiler
Installed-Size: 3
Maintainer: Jack126Guy <someanon126@gmail.com>
Description: Emulate (somewhat) the Visual Studio C/C++ compiler
This package provides a "cl" wrapper command to provide a
Windows-like interface to a compiler on the system.
.TH MS-C++-EXPRESS-2010 1 "Version 1.1"
.SH NAME
microsoft-c++-express-2010, cl - compile C/C++ programs with a
Visual Studio-like interface
.SH SYNOPSIS
.B cl
.RI [ options ]
.SH DESCRIPTION
This program is a simple wrapper for a C/C++ compiler that provides a
Visual Studio-like interface.
.SH BACKGROUND
This package is based a comment to an online forum in which a user tried
to install Microsoft Visual C++ on a Linux system. This comment was posted
to Reddit at
.nh
<http://www.redd.it/3nr9wg>
.hy 1
.SH AUTHOR
Jack126Guy <someanon126@gmail.com>
.SH COPYRIGHT
The program and this manual are released into the public domain under
Creative Commons CC0 1.0 Universal:
<http://creativecommons.org/publicdomain/zero/1.0/>
.SH SEE ALSO
.BR dosoption (1)
#!/bin/sh
. /usr/share/debconf/confmodule
CONF_DIR='/etc/microsoft-c++-express-2010'
db_get microsoft-c++-express-2010/cl-base
echo "$RET" > "$CONF_DIR/cl-base"
Template: microsoft-c++-express-2010/cl-base
Type: string
Default: gcc
Description: Compiler command to use for "cl":
Please specify the command for the C/C++ compiler. If only one compiler is
installed, the default should work.
.
The command need not be a full path, and flags (Unix-style, not DOS-style)
may be included.
Template: microsoft-c++-express-2010/compiler-not-found
Type: note
Description: C/C++ compiler not found!
No C/C++ compiler could be found. If one is installed, please specify it
during the configuration process.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment