Bug 1226701 - aoetools udev rules should be moved to /usr/lib/udev/rules.d
Summary: aoetools udev rules should be moved to /usr/lib/udev/rules.d
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: aoetools
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ed Cashin
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1226704
TreeView+ depends on / blocked
 
Reported: 2015-05-31 19:41 UTC by Zbigniew Jędrzejewski-Szmek
Modified: 2015-08-15 14:45 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-08-15 14:45:33 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Zbigniew Jędrzejewski-Szmek 2015-05-31 19:41:22 UTC
Description of problem:
/etc/udev/rules.d is administrator territory. Please move the rules file to  /usr/lib/udev/rules.d (aka %{_udevrulesdir}).

Version-Release number of selected component (if applicable):
aoetools-36-5.fc22.x86_64

Comment 1 Ed Cashin 2015-06-01 00:52:02 UTC
OK.  I'll start on this.  Can you please provide a link to the doc you're referring to with %{_udevrulesdir}?  I'd like to make sure I've read it.

Comment 2 Zbigniew Jędrzejewski-Szmek 2015-06-01 02:31:18 UTC
Please see udev documentation: http://www.freedesktop.org/software/systemd/man/udev.html#Rules%20Files .

Comment 3 Ed Cashin 2015-06-02 01:40:42 UTC
Can you please comment on backwards compatibility?  I tried using %{_udevrulesdir} on RHEL 6.6 expecting it to expand, but it did not.  I suppose that I could check whether it's defined.  If it is not, then it's an older system, so I can set it to the old value for backwards compatibility.

Comment 4 Zbigniew Jędrzejewski-Szmek 2015-06-02 02:09:36 UTC
It was added in systemd-196, after udev was merged with systemd. In RHEL6 there's no systemd and udev from before the merge. So this change should not be applied to rhel < 7. All current versions of Fedora are fine though (F20+).

Comment 5 Ed Cashin 2015-06-10 01:27:07 UTC
OK.  I had to rebuild a lot of my dev environment for fedoraproject, and now I'm delayed by the fedoraproject.org storage downtime, but I'm still working on this.

Comment 6 Ed Cashin 2015-06-15 00:55:09 UTC
Does the RPM from this scratch build look good to you?

https://koji.fedoraproject.org/koji/taskinfo?taskID=10036981

Comment 7 Zbigniew Jędrzejewski-Szmek 2015-06-29 14:52:08 UTC
Sorry for the late reply.

(In reply to Ed Cashin from comment #6)
> Does the RPM from this scratch build look good to you?
> 
> https://koji.fedoraproject.org/koji/taskinfo?taskID=10036981
Nope.

You need to add BuildRequires: systemd to have necessary macros defined.

Also, %global should be used instead of %define (https://fedoraproject.org/wiki/Packaging:Guidelines#.25global_preferred_over_.25define).

Also, there's left-over "echo ... > /tmp/_udevrulesdir".

While you're at it, you might want to use
%{!?_licensedir:%global license %%doc}
%license COPYING
to conform to new guidelines (https://fedoraproject.org/wiki/Packaging:LicensingGuidelines#License_Text).

Comment 8 Ed Cashin 2015-06-30 00:30:39 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #7)
> Sorry for the late reply.
> 
> (In reply to Ed Cashin from comment #6)
> > Does the RPM from this scratch build look good to you?
> > 
> > https://koji.fedoraproject.org/koji/taskinfo?taskID=10036981
> Nope.
> 
> You need to add BuildRequires: systemd to have necessary macros defined.

No, my intention was to leave that out, so that when the systemd macro is not there, it is set in the spec file to the backwards-compatible value.

> Also, %global should be used instead of %define
> (https://fedoraproject.org/wiki/Packaging:Guidelines#.
> 25global_preferred_over_.25define).

I'll check that out, thanks.

> Also, there's left-over "echo ... > /tmp/_udevrulesdir".

Yes, I got rid of that just after the scratch build.  Sorry for the distraction.

> While you're at it, you might want to use
> %{!?_licensedir:%global license %%doc}
> %license COPYING
> to conform to new guidelines
> (https://fedoraproject.org/wiki/Packaging:LicensingGuidelines#License_Text).

I'll check that out as well, thanks.

Comment 9 Zbigniew Jędrzejewski-Szmek 2015-06-30 00:43:28 UTC
(In reply to Ed Cashin from comment #8)
> > (In reply to Ed Cashin from comment #6)
> > > Does the RPM from this scratch build look good to you?
> > > 
> > > https://koji.fedoraproject.org/koji/taskinfo?taskID=10036981
> > Nope.
> > 
> > You need to add BuildRequires: systemd to have necessary macros defined.
> 
> No, my intention was to leave that out, so that when the systemd macro is
> not there, it is set in the spec file to the backwards-compatible value.
You are using the old value everywhere, because nothing defines
the new values. Check the koji build above.

You have to use something like (untested):
%if 0%{?fedora} || 0%{?rhel} >= 7
BuildRequires: systemd
%endif

Comment 10 Ed Cashin 2015-06-30 01:03:32 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #9)
> (In reply to Ed Cashin from comment #8)
> > > (In reply to Ed Cashin from comment #6)
> > > > Does the RPM from this scratch build look good to you?
> > > > 
> > > > https://koji.fedoraproject.org/koji/taskinfo?taskID=10036981
> > > Nope.
> > > 
> > > You need to add BuildRequires: systemd to have necessary macros defined.
> > 
> > No, my intention was to leave that out, so that when the systemd macro is
> > not there, it is set in the spec file to the backwards-compatible value.
> You are using the old value everywhere, because nothing defines
> the new values. Check the koji build above.
> 
> You have to use something like (untested):
> %if 0%{?fedora} || 0%{?rhel} >= 7
> BuildRequires: systemd
> %endif

It's defined with the syntax described here:

  https://www.redhat.com/archives/rpm-list/2002-January/msg00377.html

... when it isn't already defined.

There must have been something wrong with the scratch build you saw.  I've done another.  I'll give you a new link.

I don't want to embed knowledge of version info in there if there's a more simple way.

Comment 11 Zbigniew Jędrzejewski-Szmek 2015-06-30 01:45:13 UTC
(In reply to Ed Cashin from comment #10)
> (In reply to Zbigniew Jędrzejewski-Szmek from comment #9)
> > (In reply to Ed Cashin from comment #8)
> > > > (In reply to Ed Cashin from comment #6)
> > > > > Does the RPM from this scratch build look good to you?
> > > > > 
> > > > > https://koji.fedoraproject.org/koji/taskinfo?taskID=10036981
> > > > Nope.
> > > > 
> > > > You need to add BuildRequires: systemd to have necessary macros defined.
> > > 
> > > No, my intention was to leave that out, so that when the systemd macro is
> > > not there, it is set in the spec file to the backwards-compatible value.
> > You are using the old value everywhere, because nothing defines
> > the new values. Check the koji build above.
> > 
> > You have to use something like (untested):
> > %if 0%{?fedora} || 0%{?rhel} >= 7
> > BuildRequires: systemd
> > %endif
> 
> It's defined with the syntax described here:
> 
>   https://www.redhat.com/archives/rpm-list/2002-January/msg00377.html
> 
> ... when it isn't already defined.
> 
> There must have been something wrong with the scratch build you saw.  I've
> done another.  I'll give you a new link.
No, everything is as expected. If you do not add BuildRequires: systemd, /usr/lib/rpm/macros.d/macros.systemd will not be in the build filesystem, and %_udevrulesdir will not be defined, and your package will use the fallback value.

> I don't want to embed knowledge of version info in there if there's a more
> simple way.
No, there's is nothing like "BuildRecommends" :)

Comment 12 Ed Cashin 2015-06-30 01:48:39 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #11)
> (In reply to Ed Cashin from comment #10)
> > (In reply to Zbigniew Jędrzejewski-Szmek from comment #9)
> > > (In reply to Ed Cashin from comment #8)
> > > > > (In reply to Ed Cashin from comment #6)
> > > > > > Does the RPM from this scratch build look good to you?
> > > > > > 
> > > > > > https://koji.fedoraproject.org/koji/taskinfo?taskID=10036981
> > > > > Nope.
> > > > > 
> > > > > You need to add BuildRequires: systemd to have necessary macros defined.
> > > > 
> > > > No, my intention was to leave that out, so that when the systemd macro is
> > > > not there, it is set in the spec file to the backwards-compatible value.
> > > You are using the old value everywhere, because nothing defines
> > > the new values. Check the koji build above.
> > > 
> > > You have to use something like (untested):
> > > %if 0%{?fedora} || 0%{?rhel} >= 7
> > > BuildRequires: systemd
> > > %endif
> > 
> > It's defined with the syntax described here:
> > 
> >   https://www.redhat.com/archives/rpm-list/2002-January/msg00377.html
> > 
> > ... when it isn't already defined.
> > 
> > There must have been something wrong with the scratch build you saw.  I've
> > done another.  I'll give you a new link.
> No, everything is as expected. If you do not add BuildRequires: systemd,
> /usr/lib/rpm/macros.d/macros.systemd will not be in the build filesystem,
> and %_udevrulesdir will not be defined, and your package will use the
> fallback value.
> 
> > I don't want to embed knowledge of version info in there if there's a more
> > simple way.
> No, there's is nothing like "BuildRecommends" :)

OK, thanks for the explanation.  I will try your untested suggestion soon.

Comment 13 Ed Cashin 2015-07-04 02:06:18 UTC
I think your suggestion works as intended.  I used mock locally to check that epel-7 has the new udevrulesdir and epel-6 uses the old dir.  Then I did a koji build for rawhide, which looks good to me:

  https://kojipkgs.fedoraproject.org//work/tasks/6687/10286687/build.log
  http://koji.fedoraproject.org/koji/taskinfo?taskID=10244728

Please let me know whether this looks OK to you.

Comment 14 Zbigniew Jędrzejewski-Szmek 2015-07-04 16:49:06 UTC
Yes, location of 60-aoe.rules in aoetools-36-9.fc23.x86_64.rpm is correct.

Comment 15 Jan Kurik 2015-07-15 14:04:54 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.

(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23

Comment 16 Zbigniew Jędrzejewski-Szmek 2015-07-23 02:08:38 UTC
So what's the status here?

Comment 17 Ed Cashin 2015-07-23 10:12:38 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #16)
> So what's the status here?

Do I need to manually merge master into all the appropriate branches (f22, f21, ...)?  I see that f23 has the fix.  What branches do you recommend?

Comment 18 Zbigniew Jędrzejewski-Szmek 2015-07-23 12:56:13 UTC
You committed the changes to the master branch, but you didn't build the changed version. https://apps.fedoraproject.org/packages/aoetools shows that 36-6.fc23 is the latest version. Please do a non-scratch build build for master (rawhide) and update f23 branch to the same place and also build there.

Comment 19 Ed Cashin 2015-07-26 01:46:32 UTC
OK, thanks.  That has been done.


Note You need to log in before you can comment on or make changes to this bug.