NevilleGoddard wrote:Can we use the ports tree from GitHub?
Not ready for general use, but:
assuming a filesystem structure like below:
Code: Select all
/builder/ports/
/builder/gbsd-ports/
/builder/options/
run the script below, name it
ports-init and eventually place it in /root/bin:
Code: Select all
#!/bin/sh
# helper frontend to setup a package building environment
# (C) 2017 GhostBSD project - asxbsd
get_fbsd_ports()
{
if [ -d /builder/ports/.git ]
then
cd /builder/ports
git pull
else
git clone https://github.com/GhostBSD/freebsd-ports /builder/ports
fi
}
get_gbsd_ports()
{
if [ -d /builder/gbsd-ports/.git ]
then
cd /builder/gbsd-ports
git pull
else
git clone https://github.com/GhostBSD/ports /builder/gbsd-ports
fi
}
merge_ports()
{
cd /builder/gbsd-ports
for dir in *
do
if [ ${dir} = "README.md" ]; then continue; fi
cp -a ${dir} /builder/ports/
cd /builder/ports/${dir}
> Makefile.tmp
for category in *
do
if [ "$category" = "Makefile" ]; then continue ; fi
if [ ! -f "$category/Makefile" ]; then continue ; fi
echo " SUBDIR += $category" >> Makefile.tmp
done
echo "" >> Makefile.tmp
echo ".include <bsd.port.subdir.mk>" >> Makefile.tmp
mv Makefile.tmp Makefile
cd /builder/gbsd-ports
done
}
get_options()
{
if [ -d /builder/options/.git ]
then
cd /builder/options
git pull
else
git clone https://github.com/GhostBSD/ports-options /builder/options
fi
}
#### MAIN ####
get_fbsd_ports
get_gbsd_ports
merge_ports
get_options
after running the script you will have the merged tree in /builder/ports and the options (if any) in /builder/options.