Fix modes for /compat/linux/proc
When linprocfs is mounted the mode set to /compat/linux/proc is set to 555
while the package said 755 meaning pkg will try to change it 755 and fail
preventing upgrade or installation of the package because linprocfs does not
support changing attributes.
Enforce it to 555 to prevent that situation

Since base r283461 /compat/linux/dev/shm must point to a tmpfs. Make
/compat/linux/dev/shm a plain directory instead of a link to /tmp so we
don't force users to mount tmpfs on /tmp. This also makes /dev/shm a
separate namespace from /tmp.
PR: 207769

- Replace Mk/bsd.linux-apps.mk and Mk/bsd.linux-rpm.mk with
Mk/Uses/linux.mk.
- Replace USE_LINUX=yes with USES+=linux and USE_LINUX=(.*) with
USES+=linux:\1 in all ports.
- Replace USE_LINUX_APPS with USE_LINUX in all ports.
- Use INSTALL_SCRIPT instead of INSTALL_PROGRAM to install scripts in some
ports.
- When USE_LINUX_RPM is defined, simplify the way DISTFILES and EXTRACT_ONLY
are defined.
- Remove BRANDELF_DIRS and BRANDELF_FILES handling. In the very rare cases
that it is still necessary ports can run ${BRANDELF} from post-patch.
- Remove AUTOMATIC_PLIST handling. Only one port used it.
- Fix Linux MASTER_SITES.
- Replace OVERRIDE_LINUX_BASE_PORT and OVERRIDE_LINUX_NONBASE_PORTS with
default versions framework.

Do not try to load the linux* modules from the pre install scripts
It will always fail when jailed, it is also inaccurate given we now have
linux and linux64 modules. There is alrady a test before that via checking
compat.linux.* which is good enough to determien if linux emulation is supported

Remove UNIQUENAME and LATEST_LINK.
UNIQUENAME was never unique, it was only used by USE_LDCONFIG and now,
we won't have conflicts there.
Use PKGBASE instead of LATEST_LINK in PKGLATESTFILE, the *only* consumer
is pkg-devel, and it works just fine without LATEST_LINK as pkg-devel
has the correct PKGNAME anyway.
Now that UNIQUENAME is gone, OPTIONSFILE is too. (it's been called
OPTIONS_FILE now.)
Reviewed by: antoine, bapt
Exp-run by: antoine
Sponsored by: Absolight
Differential Revision: https://reviews.freebsd.org/D3336

Re-commit of
64 bit linuxulator support (not activated by default):
- most of the work was done by Alan Jude
- all errors are mine
- 64bit (may) have rough edges
- I validated
* that the 32bit part doesn't has deinstall regressions (incl. EXP runs by
antoine)
* 29 of 72 64bit ports ports don't have deinstall leftovers (more validation
later, when I dare to activate the 64bit linuxulator in the kernel)
- the infrastructure part looks mature enough to let more test-bunnies get
some experience with the new 64 bit parts
- to use it you shall have no linux ports installed and have to specify
(on your own risk) the following in make.conf before installing the ports:
OVERRIDE_LINUX_BASE_PORT=c6_64

64 bit linuxulator support (not activated by default):
- most of the work was done by Alan Jude
- all errors are mine
- 64bit (may) have rough edges
- I validated
* that the 32bit part doesn't has deinstall regressions
* 29 of 72 64bit ports ports don't have deinstall leftovers (more validation
later, when I dare to activate the 64bit linuxulator in the kernel)
- the infrastructure part looks mature enough to let more test-bunnies get
some experience with it
- to use it you shall have no linux ports installed and have to specify
(on your own risk) the following in make.conf before installing the ports:
OVERRIDE_LINUX_BASE_PORT=c6_64
OVERRIDE_LINUX_NONBASE_PORTS=c6_64

- White space fixes
- Like r315899 did for linux_base-f10, add some symlinks to linux_base-c6
for executables that exist in /usr/bin on Linux but /bin on FreeBSD.
This guarantees that Linux shell scripts run the Linux executables and
not the FreeBSD ones.
PR: 197406

Force PREFIX to LINUXBASE
Using pkg with linux packages will generate conflicts with non-linux ports if
PREFIX is set in make.conf. If USE_LINUX_PREFIX is defined, force PREFIX to
LINUXBASE, which can be overridden separately.
Differential Revision: https://reviews.freebsd.org/D1265
Approved by: koobs, swills (mentors)

emulators/linux_base-c6: Use a CVE-free version of bash
Bash 4.1.2 as shipped with this Linux base port is vulnerable to
CVE-2014-6271 and CVE-2014-7169. As EL6 policy is to backport security
patches, use a RPM that is not vulnerable to either remote code execution
vulnerability.
While here:
- Add the proper UDPATES Master site
- remove sample files installation from Makefile, in favor of @sample
Approved by: swills (mentor)
Security: 71ad81da-4414-11e4-a33e-3c970e169bc2

Update CentOS base to 6.5, add userland ports
The Fedora 10 infrastructure ports have been in use since June 2009 and, while
having served a great deed, have become unsupported upstream and hence affected
by unfixed security vulnerabilities. In addition to that, many recent Linux
binaries need newer libc / stdlibc++ versions.
This commit adds the linux-c6- userland as drop-in replacement for the -f10
infrastructure, as well as upgrading the linux_base-c6 port to CentOS 6.5.
If you want to switch to linux-c6 ports, please define at /etc/make.conf:
OVERRIDE_LINUX_BASE_PORT=c6
OVERRIDE_LINUX_NONBASE_PORTS=c6

- Add staging support
- Properly handle yp.conf and krb5.conf
- Remove some assignments with default values
Note that staging warns about etc/*shadow not being readable, because their
permissions are 0.

After repocopy (by marcus@) from linux_base-f10:
Add linux_base-c6 port. This is a linux_base port based upon CentOS 6.
CentOS 6 is supported upstream (so far) until November 30, 2020.
Compared to the port as submitted in the PR, I added most SRC_DISTFILES
and set the maintainer to emulation@ (discussed with the submitter).
Not connected to the ports collection (emulation/Makefile) yet, first I want
to find the missing src RPMs (compat-*, stdc++, ...). The port is committed
anyway, so that people can help with the TODO list (in the Makefile).
WARNING: it is highly experimental to use this port instead of the default
linux_base port. You need to set compat.linux.osrelease to 2.6.18, so watch
out for unimplemented syscalls (most recent 8-stable / 9-stable or -current
is recommended for this).
Submitted by: Svyatoslav Lempert <svyatoslav.lempert@gmail.com>
PR: 165900