Created attachment 188827 [details]
I am trying to use rpm for software that is not in the centos repositories and I noticed USE_LINUX_RPM could be more efficient/cleaner:
- Move the MASTER_SITES check to an upper level instead of checking within the centos 6 or centos 7 cases.
- I was tempted to also define the MASTER_SITES and DIST_SUBDIR before checking the centos version but I realize you may want to add other repositories there in the future.
At quick glance it looks fine to me, let's add tijl to the review. This is not maintained by portmgr
Several ports set MASTER_SITES (e.g. to EPEL) and also want DIST_SUBDIR=centos. The subdirectory is for all rpm targetting CentOS, not just official CentOS packages. USE_LINUX_RPM is really tailored for linux-c?-* ports. If you are creating such a port you can put the distfile in the centos subdirectory. If you are creating another port which happens to be distributed as an rpm take a look at astro/google-earth. The main difference from a regular port is that you need a do-install target.
(In reply to Tijl Coosemans from comment #2)
Ugh ... I did this patch long ago and it is disappointing that it wasnt considered at all.
At the time I was trying to port KingSoft's Office and some Microsoft stuff (an R variant that includes accelerated math libraries) which offer RPMs but of course are not directly related to RedHat or CentOS.
The idea was that after setting the repository and the directory I was able to fetch both the X64 and i386 distfiles. It saved me a lot of trouble and didn't interfere with the existing CentOS support.
You should reconsider.
But I just explained that it does interfere. An example is audio/linux-c7-openal-soft. It sets MASTER_SITES and expects linux.mk to set DIST_SUBDIR. That doesn't happen with your patch. USE_LINUX_RPM is designed for linux-c?-* ports. For application ports take a look at astro/google-earth. It also downloads an i386 and amd64 rpm by setting DISTFILES_<arch>.
(In reply to Tijl Coosemans from comment #4)
Ahh well.. I just haven't looked at this in a while (2017!).