That won't be easy because
apt-get uses a completely different naming scheme than those used in the ports collection. Sure you'll have Apache surfacing on both environments, but the right way to install Apache (the webserver itself, not some extension) is to use the official port name:
www/apache22. Or
www/apache24 if you're looking for Apache
2.4.x instead of Apache
2.2.x (which could provide another problem with automating this process).
In fact, I don't think the idea is feasible at all because of the many differences between both systems. For example; while Linux uses a package to provide
getty FreeBSD does not because this is part of the base system, so not something you need to manually install.
Personally I wouldn't worry. My suggestion would be to start by installing
ports-mgmt/portmaster. Because then you can most likely only focus on some of the major components which you want to install and simply let
portmaster sort out all the dependencies.
For example, when looking back at the previously mentioned
www/apache22:
Code:
root@smtp2:/usr/ports/www/apache22 # make all-depends-list
/usr/ports/devel/autoconf
/usr/ports/devel/libtool
/usr/ports/textproc/expat2
/usr/ports/devel/apr1
/usr/ports/devel/pcre
/usr/ports/converters/libiconv
/usr/ports/lang/perl5.16
/usr/ports/devel/m4
/usr/ports/misc/help2man
/usr/ports/devel/gmake
/usr/ports/devel/autoconf-wrapper
/usr/ports/databases/gdbm
/usr/ports/databases/mysql51-client
/usr/ports/databases/db42
/usr/ports/devel/p5-Locale-gettext
/usr/ports/devel/gettext
Here you see a list of all the ports which Apache needs to both build and run. Don't use this as an example because these dependencies heavily depend on the way you configure your port(s).
But in this example it would mean that if I install
www/apache22 I'd automatically get those other ports as well, such as Perl, Apr and the MySQL client.
So there really is no need to tell your system that it should install both Apache
and Perl; simply tell it to install Apache and the rest will be installed automatically.
As such I wouldn't bother trying to set this up, I think it won't save you as much time as you think it will.