Below is part of my .spec file: --------------------------------------------------
%install install -Dm644 mattermost.service %{buildroot}/usr/lib/systemd/system/mattermost.service install -Dm644 mattermost-user.conf %{buildroot}/usr/lib/sysusers.d/mattermost.conf
%files %{_libdir}/systemd/system/mattermost.conf %{_libdir}/sysusers.d/mattermost.conf
----------------------------------------------
which throw two errors when building:
error: File not found: /home/makerpm/rpmbuild/BUILDROOT/mattermost-3.4-1.fc24.x86_64/usr/lib64/systemd/system/mattermost.conf error: File not found: /home/makerpm/rpmbuild/BUILDROOT/mattermost-3.4-1.fc24.x86_64/usr/lib64/sysusers.d/mattermost.conf
I understand I installed these two files in /usr/lib/ (which is what I want), as said by the below output: ---------------------------------------------------------- + install -Dm644 mattermost.service /home/makerpm/rpmbuild/BUILDROOT/mattermost-3.4-1.fc24.x86_64/usr/lib/systemd/system/mattermost.service + install -Dm644 mattermost-user.conf /home/makerpm/rpmbuild/BUILDROOT/mattermost-3.4-1.fc24.x86_64/usr/lib/sysusers.d/mattermost.conf ----------------------------------------------------------
BUT Fedora is looking for them in /usr/lib64, right ?
So %{_libdir} seems to point to /usr/lib64 rather than to /usr/lib as mentioned in wiki[0].
Am I right? Shall I then write this in %files ? :
/usr/lib/systemd/system/mattermost.conf /usr/lib/sysusers.d/mattermost.conf
Thank you for help.
[0]https://fedoraproject.org/wiki/How_to_create_an_RPM_package
On Thu, 03 Nov 2016 11:42:43 +0000 arnaud gaboury wrote:
So %{_libdir} seems to point to /usr/lib64 rather than to /usr/lib as mentioned in wiki[0].
The default is that 32 bit libraries are in /usr/lib, 64 bit libraries are in /usr/lib64 (for intel architectures at least)
On Thu, Nov 3, 2016 at 6:42 AM, arnaud gaboury arnaud.gaboury@gmail.com wrote:
Below is part of my .spec file:
%install install -Dm644 mattermost.service %{buildroot}/usr/lib/systemd/ system/mattermost.service install -Dm644 mattermost-user.conf %{buildroot}/usr/lib/sysusers. d/mattermost.conf
First install line change to %{buildroot}%{_unitdir} for the systemd file and the second to use %{buildroot}%{_sysusersdir} for the conf file.
Also, be consistent, use the macros both in %install and in %files.
Richard
On Thu, Nov 3, 2016 at 1:47 PM Richard Shaw hobbes1069@gmail.com wrote:
On Thu, Nov 3, 2016 at 6:42 AM, arnaud gaboury arnaud.gaboury@gmail.com wrote:
Below is part of my .spec file:
%install install -Dm644 mattermost.service %{buildroot}/usr/lib/systemd/system/mattermost.service install -Dm644 mattermost-user.conf %{buildroot}/usr/lib/sysusers.d/mattermost.conf
First install line change to %{buildroot}%{_unitdir} for the systemd file and the second to use %{buildroot}%{_sysusersdir} for the conf file.
Also, be consistent, use the macros both in %install and in %files.
Do you mean this ? :
-------------------------------------------------- %install install -Dm644 mattermost.service %{buildroot}%{_unitdir}/system/mattermost.service install -Dm644 mattermost-user.conf %{buildroot}%{_sysuserdir}/mattermost.conf
%files %{_unitdir}/system/mattermost.service %{_sysuserdir}/mattermost.conf ------------------------------------------------------------------
Where do these macro come from ? Any doc link ?
Thank you
Richard
users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org
On Thu, Nov 3, 2016 at 11:49 AM, arnaud gaboury arnaud.gaboury@gmail.com wrote:
On Thu, Nov 3, 2016 at 1:47 PM Richard Shaw hobbes1069@gmail.com wrote:
On Thu, Nov 3, 2016 at 6:42 AM, arnaud gaboury arnaud.gaboury@gmail.com wrote:
Below is part of my .spec file:
%install install -Dm644 mattermost.service %{buildroot}/usr/lib/systemd/ system/mattermost.service install -Dm644 mattermost-user.conf %{buildroot}/usr/lib/sysusers. d/mattermost.conf
First install line change to %{buildroot}%{_unitdir} for the systemd file and the second to use %{buildroot}%{_sysusersdir} for the conf file.
Also, be consistent, use the macros both in %install and in %files.
Do you mean this ? :
%install install -Dm644 mattermost.service %{buildroot}%{_unitdir}/ system/mattermost.service install -Dm644 mattermost-user.conf %{buildroot}%{_sysuserdir}/ mattermost.conf
%files %{_unitdir}/system/mattermost.service %{_sysuserdir}/mattermost.conf
Almost, you can test the macro definitions like so:
$ rpm -E %_unitdir /usr/lib/systemd/system $ rpm -E %_sysusersdir /usr/lib/sysusers.d
So no need to add "system" to the directory.
Where do these macro come from ? Any doc link ?
I'm pretty sure the systemd one comes with the systemd package, not sure about sysusersdir. I've never needed that one before I only found it like this:
$ rpm --showrc | grep sysuser -14: _sysusersdir /usr/lib/sysusers.d -14: sysusers_create systemd-sysusers %{?*} >/dev/null 2>&1 || : -14: sysusers_create_inline echo %{?*} | systemd-sysusers - >/dev/null 2>&1 || :
Thanks, Richard
On 3 November 2016 at 16:49, arnaud gaboury arnaud.gaboury@gmail.com wrote:
Where do these macro come from ? Any doc link ?
Thank you
Read the section about macros here: