Override PopupSmarty.php for upgrade-safe implementation

I am working on:
SuiteCRM Version 7.11.4
Sugar Version 6.5.25 (Build 344)

I want to overrideinclude/Popups/PopupSmary.php for customization.
I copied that file at custom/include/Popups/PopupSmarty.php but it is not picking up that file.

Also I am trying it for specific module e.g. Contacts and copied that file at location custom/modules/Contacts/include/Popups/PopupSmarty.php but it is not working at there too.

Any idea how to achieve this? Help highly appreciated.

Thanks.