error: File must begin with "/": %{_unitdir}/

Hi,
maybe one of you has an idea…in the spec file I have specified:

%install

python setup.py install --prefix=%_prefix --root=%buildroot --record-rpm=filelist
# only for systemd
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
install -p -m 640 etc/%{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}

mkdir -p $RPM_BUILD_ROOT%{_unitdir}
install -p -m 644 %{SOURCE20} $RPM_BUILD_ROOT%{_unitdir}/%{name}.service


Both files are not added to the file list, so I put them in manually:


%files -f filelist
%defattr(-,root,root)
%{_unitdir}/%{name}.service
%attr(640,root,tryton) %config(noreplace)%{_sysconfdir}/%{name}.conf 

…this and some other variations cause the error message

 error: File must begin with "/": %{_unitdir}/trytond.service

This is strange, as the same Syntax works in other spec files…and of course, just adding a ‘/’ in front does not give the desired result.
Whats the point?

> maybe one of you has an idea…

BuildRequires: systemd-rpm-macros

…seems to be unknown in the OBS: unresolveable.
Its in Base:System, which I included in the Meta-infos of my project, but still no success…

On Tue, 25 Jun 2013 11:56:02 GMT DocB wrote:

> > BuildRequires: systemd-rpm-macros
>
> …seems to be unknown in the OBS: unresolveable.
> Its in Base:System, which I included in the Meta-infos of my project,
> but still no success…

It is in Factory standard repositiry.
https://build.opensuse.org/package/binaries?package=systemd-rpm-macros&project=openSUSE%3AFactory&repository=standard

Yes, that works for 12.3, but if I include Factory for the 12.2, it breaks the development. What do you suggest - just branch the systemd-rpm-tools into my project, or look for some other repo?

On Wed, 26 Jun 2013 10:16:02 GMT DocB wrote:

> Yes, that works for 12.3, but if I include Factory for the 12.2, it
> breaks the development. What do you suggest - just branch the
> systemd-rpm-tools into my project, or look for some other repo?

You need the file /etc/rpm/macros.systemd. What provides it?

For 12.2 and 12.3.
BuildRequires: systemd

For Factory.
BuildRequires: systemd-rpm-macros

OK, that fixed it, thanks!