I have a project that requires post-install hooks for deployment. My method is to use setuptools to generate the skeleton rpm spec file and tar the source files.
The problem is that I don't know how to control permissions with this method. The spec file looks like:
%install
python setup.py install --single-version-externally-managed --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
%files -f INSTALLED_FILES
%defattr(755,%{user},%{user})
This works out reasonably well: in that all files get set set to the appropriate user and permissions. But the directories don't have the attributes set on them. I can't tell whether this is a problem, but it does seem strange: all the directories are owned by root with 755 permissions. Does anyone know a good (reasonably standard) way to make the directories owned by user
? I ask because my company tends to prefer packaging applications that will deploy under an application-specific role-account. When I use setuptools to put the results in site-packages, .pyc
files are copied over. But if I want to create a config file directory off the path, it seems like a good amount to work around.