1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-01 05:45:45 +00:00

Add new port sysutils/rinse

PR:		193493
Submitted by:	Jan Beich

Rinse is a simple tool which is designed to carry out the installation
of a new RPM-based distribution. Using rinse you can easily setup simple
chroot() systems running different RPM-based distributions, such as
Centos, Scientific Linux or openSUSE.

The purpose and usage are analogous to the 'debootstrap' utility
familiar to users of Debian GNU/Linux. It was primarily designed to
work with the xen-tools software, which creates new guest images for
running inder the Xen hypervisor.
This commit is contained in:
John Marino 2014-10-31 16:34:20 +00:00
parent f7057b396c
commit 166701d1cc
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=371874
7 changed files with 204 additions and 0 deletions

View File

@ -776,6 +776,7 @@
SUBDIR += respond
SUBDIR += retail
SUBDIR += rfstool
SUBDIR += rinse
SUBDIR += rmonitor
SUBDIR += roottail
SUBDIR += rsnapshot

61
sysutils/rinse/Makefile Normal file
View File

@ -0,0 +1,61 @@
# $FreeBSD$
PORTNAME= rinse
PORTVERSION= 3.0.4
CATEGORIES= sysutils
MASTER_SITES= DEBIAN
DISTNAME= ${PORTNAME}_${DISTVERSION}
MAINTAINER= jbeich@vfemail.net
COMMENT= Install RPM-based system into a directory
LICENSE= ARTPERL10
RUN_DEPENDS= p5-Term-Size>0:${PORTSDIR}/devel/p5-Term-Size \
p5-libwww>0:${PORTSDIR}/www/p5-libwww
NO_ARCH= yes
NO_BUILD= yes
USES= perl5 shebangfix
USE_PERL5= run
SHEBANG_FILES= bin/* tests/*
MAKE_ARGS= PREFIX="${STAGEDIR}${PREFIX}" VERSION=${DISTVERSION}
DATADIR= ${PREFIX}/lib/${PORTNAME}
WRKSRC= ${WRKDIR}/${PORTNAME}
ONLY_FOR_ARCHS= amd64 i386
ONLY_FOR_ARCHS_REASON= requires linuxulator to register rpms
.include <bsd.port.pre.mk>
.if ${OPSYS} == DragonFly
IGNORE= requires linuxulator to register rpms
.endif
post-extract:
${MV} ${WRKSRC}/etc/rinse.conf ${WRKSRC}/etc/rinse.conf.sample
post-patch:
${REINPLACE_CMD} -e 's,/usr,,g' \
-e 's,/share/man,/man,g' \
-e '/cache/s/PREFIX/DESTDIR/' \
-e '/^include VERSION/d' \
-e '/scripts\.common/s/*/&.sh/' \
-e 's/\.conf/&.sample/' \
${WRKSRC}/Makefile
${REINPLACE_CMD} -e 's,/etc,${PREFIX}&,' \
-e 's,/usr/lib,${PREFIX}/lib,g' \
${WRKSRC}/bin/${PORTNAME} \
${WRKSRC}/misc/${PORTNAME}
# mount flags and /dev are different, drop duplicates and add missing
${REINPLACE_CMD} -e 's,-o bind $$i,-t lin$${i#/}fs none,' \
${WRKSRC}/scripts.common/15-mount-proc.sh
${REINPLACE_CMD} -Ee 's/sed -i/& ""/' \
-e '/mknod.*dev/d' \
-e '/chroot.*MAKEDEV/d' \
-e '/-o bind.*(proc|sys)/d' \
-e '/umount.*proc/ { p; s/proc/dev/p; \
s/dev/sys/; N; /(.*)\n\1/!P; g; }' \
${WRKSRC}/scripts/*/post-install.sh
.include <bsd.port.post.mk>

2
sysutils/rinse/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (rinse_3.0.4.tar.gz) = 9e0ff73bdc0ed0c5e2d19afbf626c4e74d20966dcd7ac8bc7fcc97f8419cf41a
SIZE (rinse_3.0.4.tar.gz) = 29634

View File

@ -0,0 +1,29 @@
--- bin/rinse~
+++ bin/rinse
@@ -334,7 +334,7 @@ exit;
sub testSetup {
- my @required = qw/ rpm rpm2cpio wget /;
+ my @required = qw/ bsdtar fetch /;
foreach my $file (@required) {
if ( ( !-x "/bin/$file" ) && ( !-x "/usr/bin/$file" ) ) {
@@ -840,7 +840,7 @@ sub downloadPackagesToDirectory {
print $msg;
# download - unless already present.
- system("wget --quiet -O $dir/$key $links{ $key }") unless -e "$dir/$key";
+ system("fetch -w10 -qo $dir/$key $links{ $key }") unless -e "$dir/$key";
next PACKAGE;
}
print "[Harmless] Failed to find download link for $package\n";
@@ -1147,7 +1147,7 @@ sub unpackPackages {
# Run the unpacking command.
#
my $cmd =
- "rpm2cpio $file | (cd $CONFIG{'directory'} ; cpio --extract --make-directories --no-absolute-filenames --preserve-modification-time) 2>/dev/null >/dev/null";
+ "bsdtar xPf $file --chroot -C $CONFIG{'directory'}";
if ( $file =~ /(fedora|centos|redhat|mandriva)-release-/ ) {
my $rpmname = basename($file);
$postcmd =

View File

@ -0,0 +1,27 @@
--- scripts.common/20-dev-zero.sh~
+++ scripts.common/20-dev-zero.sh
@@ -30,15 +30,19 @@ fi
#
# Create the node
#
+if [ ! -e "${prefix}/dev/null" ]; then
+ mount -t devfs none "${prefix}/dev"
+ devfs -m "${prefix}/dev" rule apply hide
+ devfs -m "${prefix}/dev" rule apply path null unhide
+fi
+
if [ ! -e "${prefix}/dev/zero" ]; then
- mknod -m 666 "${prefix}/dev/zero" c 1 5
+ devfs -m "${prefix}/dev" rule apply path zero unhide
fi
if [ ! -e "${prefix}/dev/random" ]; then
- mknod -m 666 "${prefix}/dev/random" c 1 8
- chown root:root "${prefix}/dev/random"
+ devfs -m "${prefix}/dev" rule apply path random unhide
fi
if [ ! -e "${prefix}/dev/urandom" ]; then
- mknod -m 666 "${prefix}/dev/urandom" c 1 9
- chown root:root "${prefix}/dev/urandom"
+ devfs -m "${prefix}/dev" rule apply path urandom unhide
fi

13
sysutils/rinse/pkg-descr Normal file
View File

@ -0,0 +1,13 @@
Rinse is a simple tool which is designed to carry out the installation
of a new RPM-based distribution.
Using rinse you can easily setup simple chroot() systems running
different RPM-based distributions, such as Centos, Scientific Linux or
openSUSE.
The purpose and usage are analogous to the 'debootstrap' utility
familiar to users of Debian GNU/Linux. It was primarily designed to
work with the xen-tools software, which creates new guest images for
running inder the Xen hypervisor.
WWW: http://collab-maint.alioth.debian.org/rinse/

71
sysutils/rinse/pkg-plist Normal file
View File

@ -0,0 +1,71 @@
etc/bash_completion.d/rinse
%%ETCDIR%%/centos-4.packages
%%ETCDIR%%/centos-5.packages
%%ETCDIR%%/centos-6.packages
%%ETCDIR%%/centos-7.packages
%%ETCDIR%%/fedora-10.packages
%%ETCDIR%%/fedora-12.packages
%%ETCDIR%%/fedora-13.packages
%%ETCDIR%%/fedora-14.packages
%%ETCDIR%%/fedora-15.packages
%%ETCDIR%%/fedora-16.packages
%%ETCDIR%%/fedora-17.packages
%%ETCDIR%%/fedora-18.packages
%%ETCDIR%%/fedora-19.packages
%%ETCDIR%%/fedora-7.packages
%%ETCDIR%%/fedora-8.packages
%%ETCDIR%%/fedora-9.packages
%%ETCDIR%%/fedora-core-4.packages
%%ETCDIR%%/fedora-core-5.packages
%%ETCDIR%%/fedora-core-6.packages
%%ETCDIR%%/opensuse-10.1.packages
%%ETCDIR%%/opensuse-10.2.packages
%%ETCDIR%%/opensuse-10.3.packages
%%ETCDIR%%/opensuse-11.0.packages
%%ETCDIR%%/opensuse-11.1.packages
%%ETCDIR%%/opensuse-11.2.packages
%%ETCDIR%%/opensuse-11.3.packages
%%ETCDIR%%/opensuse-12.1.packages
%%ETCDIR%%/opensuse-12.3.packages
%%ETCDIR%%/opensuse-13.1.packages
%%ETCDIR%%/rhel-5.packages
@sample %%ETCDIR%%/rinse.conf.sample
%%ETCDIR%%/slc-5.packages
%%ETCDIR%%/slc-6.packages
%%DATADIR%%/centos-4/post-install.sh
%%DATADIR%%/centos-5/post-install.sh
%%DATADIR%%/centos-6/post-install.sh
%%DATADIR%%/centos-7/post-install.sh
%%DATADIR%%/common/10-resolv.conf.sh
%%DATADIR%%/common/15-mount-proc.sh
%%DATADIR%%/common/20-dev-zero.sh
%%DATADIR%%/fedora-10/post-install.sh
%%DATADIR%%/fedora-12/post-install.sh
%%DATADIR%%/fedora-13/post-install.sh
%%DATADIR%%/fedora-14/post-install.sh
%%DATADIR%%/fedora-15/post-install.sh
%%DATADIR%%/fedora-16/post-install.sh
%%DATADIR%%/fedora-18/post-install.sh
%%DATADIR%%/fedora-19/post-install.sh
%%DATADIR%%/fedora-7/post-install.sh
%%DATADIR%%/fedora-8/post-install.sh
%%DATADIR%%/fedora-9/post-install.sh
%%DATADIR%%/fedora-core-4/post-install.sh
%%DATADIR%%/fedora-core-5/post-install.sh
%%DATADIR%%/fedora-core-6/post-install.sh
%%DATADIR%%/opensuse-10.1/post-install.sh
%%DATADIR%%/opensuse-10.2/post-install.sh
%%DATADIR%%/opensuse-10.3/post-install.sh
%%DATADIR%%/opensuse-11.0/post-install.sh
%%DATADIR%%/opensuse-11.1/post-install.sh
%%DATADIR%%/opensuse-11.2/post-install.sh
%%DATADIR%%/opensuse-11.3/post-install.sh
%%DATADIR%%/opensuse-12.1/post-install.sh
%%DATADIR%%/opensuse-12.3/post-install.sh
%%DATADIR%%/opensuse-13.1/post-install.sh
%%DATADIR%%/rhel-5/post-install.sh
%%DATADIR%%/slc-5/post-install.sh
%%DATADIR%%/slc-6/post-install.sh
man/man8/rinse.8.gz
sbin/rinse
@dir /var/cache/rinse