directories not owned by a package

Hi there,
need help, the build log says:
Code:


   60s] ... checking filelist
   60s] fusioninventory-agent-task-esx-2.6-lp152.5.1.noarch.rpm: directories not owned by a package:
   60s]  - /usr/share/fusioninventory/lib/FusionInventory/Agent/Task
   60s] fusioninventory-agent-task-collect-2.6-lp152.5.1.noarch.rpm: directories not owned by a package:
   60s]  - /usr/share/fusioninventory/lib/FusionInventory/Agent/Task
   60s] fusioninventory-agent-task-inventory-2.6-lp152.5.1.noarch.rpm: directories not owned by a package:
   60s]  - /usr/share/fusioninventory/lib/FusionInventory/Agent/Task
   60s] fusioninventory-agent-task-deploy-2.6-lp152.5.1.noarch.rpm: directories not owned by a package:
   60s]  - /usr/share/fusioninventory/lib/FusionInventory/Agent/Task
   60s] fusioninventory-agent-task-network-2.6-lp152.5.1.noarch.rpm: directories not owned by a package:
   60s]  - /usr/share/fusioninventory/lib/FusionInventory/Agent/Task
   60s] fusioninventory-agent-task-wakeonlan-2.6-lp152.5.1.noarch.rpm: directories not owned by a package:
   60s]  - /usr/share/fusioninventory/lib/FusionInventory/Agent/Task

…which ends in a build failure. How can i capture this?
Sorry to ask, i’m not the owner of the Plugin, nor a programmer, just trying to adapt…

Hi and welcome to the Forum :slight_smile:
You need to use the %dir directive in the %files section, eg;


%files
...
....
%dir %{_datadir}/%{name}/

Assuming your package name is fusioninventory.

hi malcom,
thanks for your fast answer, but i don’t really know what to do here


%files
%doc Changes THANKS LICENSE README.md
%{_bindir}/fusioninventory-agent
%{_bindir}/fusioninventory-injector
%{_bindir}/fusioninventory-remoteinventory
%{_mandir}/man1/fusioninventory-agent.1*
%{_mandir}/man1/fusioninventory-injector.1*
%{_mandir}/man1/fusioninventory-remoteinventory.1*
%{_localstatedir}/log/fusioninventory-agent
%{_localstatedir}/lib/fusioninventory-agent
%{_datadir}/fusioninventory
%dir %{_sysconfdir}/fusioninventory
%config(noreplace) %{_sysconfdir}/fusioninventory/agent.cfg
%config(noreplace) %{_sysconfdir}/fusioninventory/inventory-server-plugin.cfg
%config(noreplace) %{_sysconfdir}/fusioninventory/server-test-plugin.cfg
%config(noreplace) %{_sysconfdir}/fusioninventory/ssl-server-plugin.cfg
%config(noreplace) %{_sysconfdir}/fusioninventory/proxy-server-plugin.cfg
%config(noreplace) %{_sysconfdir}/fusioninventory/proxy2-server-plugin.cfg
%config(noreplace) %{_sysconfdir}/logrotate.d/fusioninventory-agent
%config(noreplace) %{_sysconfdir}/cron.daily/fusioninventory-agent
%config(noreplace) %{_sysconfdir}/sysconfig/fusioninventory-agent
%{_unitdir}/fusioninventory-agent.service
%exclude %{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task
%exclude %{_datadir}/fusioninventory/lib/FusionInventory/Agent/SNMP.pm
%exclude %{_datadir}/fusioninventory/lib/FusionInventory/Agent/SNMP
%exclude %{_datadir}/fusioninventory/lib/FusionInventory/Agent/SOAP

%files task-inventory
%{_bindir}/fusioninventory-inventory
%{_mandir}/man1/fusioninventory-inventory.1*
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/Inventory.pm
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/Inventory

%files task-wakeonlan
%{_bindir}/fusioninventory-wakeonlan
%{_mandir}/man1/fusioninventory-wakeonlan.1*
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/WakeOnLan.pm
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/WakeOnLan

%files task-network
%{_bindir}/fusioninventory-netdiscovery
%{_bindir}/fusioninventory-netinventory
%{_mandir}/man1/fusioninventory-netdiscovery.1*
%{_mandir}/man1/fusioninventory-netinventory.1*
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/NetInventory.pm
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/NetInventory
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/NetDiscovery.pm
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/NetDiscovery
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/SNMP.pm
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/SNMP

%files task-esx
%{_bindir}/fusioninventory-esx
%{_mandir}/man1/fusioninventory-esx.1*
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/ESX.pm
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/ESX
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/SOAP

%files task-deploy
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/Deploy.pm
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/Deploy

%files task-collect
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/Collect.pm
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/Collect

Hi

For example (add %dir %{_datadir}/fusioninventory);


%files task-inventory
%{_bindir}/fusioninventory-inventory
%{_mandir}/man1/fusioninventory-inventory.1*
%dir %{_datadir}/fusioninventory
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/Inventory.pm
%{_datadir}/fusioninventory/lib/FusionInventory/Agent/Task/Inventory

You may have to drill down multiple levels with this command as well is in each of the sub packages complaining:(

malcoml, i think i can do that, but see this another problem here.


install -d -m 755 %{buildroot}%{_sysconfdir}/sysconfig
cat > %{buildroot}%{_sysconfdir}/sysconfig/fusioninventory-agent <<EOF
# fusioninventory agent options
OPTIONS=""
EOF

install -d -m 755 %{buildroot}%{_sysconfdir}/cron.daily
cat > %{buildroot}%{_sysconfdir}/cron.daily/fusioninventory-agent <<EOF
#!/bin/sh
. /etc/sysconfig/fusioninventory-agent
%{_bindir}/fusioninventory-agent $OPTIONS > /dev/null 2>&1
EOF
chmod 755 %{buildroot}%{_sysconfdir}/cron.daily/fusioninventory-agent

get this error:


(Badness: 10000) /etc/sysconfig/fusioninventory-agent is not allowed in SUSE
   50s] Please use %{_fillupdir}/sysconfig.<pkgname>                    and call
   50s] %fillup_and_insserv for new sysconfig files.

Thanks for any help

Hi
Do you have a Build Service link to the project? You need to look at this…: openSUSE:Packaging Conventions RPM Macros - openSUSE Wiki the file should be installed in /usr/share/fillup-templates/.

Likewise, cron is on the way out, future proof by switching it to a systemd service tied to the default systemd timer so it runs when needed…