Closed BClark09 closed 7 years ago
Error on Fedora 24:
[root@linus opt]# dnf install openhab2
Last metadata expiration check: 0:00:28 ago on Fri Feb 17 14:50:12 2017.
Error: nothing provides adduser needed by openhab2-2.1.0.20170217150518-1.noarch
(try to add '--allowerasing' to command line to replace conflicting packages)
[root@linus opt]# dnf install --allowerasing openhab2
Last metadata expiration check: 0:02:27 ago on Fri Feb 17 14:50:12 2017.
Error: nothing provides adduser needed by openhab2-2.1.0.20170217150518-1.noarch
adduser exists on the system, provided by shadow-utils package:
[root@linus opt]# which adduser
/usr/sbin/adduser
[root@linus opt]# rpm -q -f /usr/sbin/adduser
shadow-utils-4.2.1-8.fc24.i686
In https://github.com/openhab/openhab-linuxpkg/pull/37/files I see:
requires('adduser')
One way to fix might be (though might not be right for non-RH/Fedora/CentOS distros, I'm unsure):
if (pType == 'Rpm') {
requires('shadow-utils')
} else {
requires('adduser')
}
I don't know if gradle exposes this at the build.gradle level, but Fedora packaging guidelines use Requires(pre): shadow-utils
and useradd
:
https://fedoraproject.org/wiki/Packaging:UsersAndGroups#Dynamic_allocation
Hmm, even getting passed that the openhab user doesn't exist because there's no RPM based addgroup. Bare with me for a bit.
The latest version seems to work for testing.
@BClark09 I did the rpm packaging some weeks ago for a project at work. I've used the packaging of elasticsearch as template: You will need to add more deb/rpm specific handling into the script files as you can see here: https://github.com/elastic/elasticsearch/tree/master/distribution/src/main/packaging/scripts I suggest to stick with addgroup and adduser for debian like the elasticsearch guys did.
The script files are called with a different set of arguments depending if the executor is rpm or deb. Therefore you can distinguish between rpm and deb installations.
The yum repo packages still give me the adduser error - guessing the rpm in the repo has not been updated yet?
Hmm, what happens when you
dnf clean all
dnf update
?
Just a cosmetic thing, but you want way to rename it to openHAB rather then openHABRepo. Only issue I ran into was a LOT of warnings like:
warning: user openhab does not exist - using root warning: group openhab does not exist - using root
Should not the .spec file create the user if it does not exist? Also, should think about signing the rpms.
Was not able to install addons:
Transaction check error: file /usr/share/openhab2 from install of openhab2-addons-0:2.1.0.20170218132317-1.noarch conflicts with file from package openhab2-0:2.1.0.20170218132317-1.noarch
Also some errors with remove:
Running transaction Erasing : openhab2-2.1.0.20170218132317-1.noarch 1/1 postrm called with unknown argument `0' warning: %postun(openhab2-0:2.1.0.20170218132317-1.noarch) scriptlet failed, exit status 1 Non-fatal POSTUN scriptlet failure in rpm package openhab2-2.1.0.20170218132317-1.noarch Verifying : openhab2-2.1.0.20170218132317-1.noarch 1/1
Removed: openhab2.noarch 0:2.1.0.20170218132317-1
Complete!
Thanks for testing both, this is really helpful!
Just a cosmetic thing, but you want way to rename it to openHAB rather then openHABRepo
Good point! Will change that when I come to writing it up in docs.
warning: user openhab does not exist - using root warning: group openhab does not exist - using root
Right, I see that RPM and APT use different terms for [pre/post][inst/rm] and was trying to use the same ones. I've submitted another package to the repo to address this. Does this fix all the known errors (besides not being able to install addons)?
Also, should think about signing the rpms.
They will be signed with the same GPG key as the Deb files are when testing is complete.
@theoweiss Have just seen your comment, sorry. Now that the basics are working I will follow the same style as you have showed.
@BClark09 - dnf clean worked, but repos don't normally require that step to find newer packages.
The following worked and installled openhab2-2.1.0.20170218221203-1.noarch.rpm:
dnf clean
dnf install --nogpgcheck openhab2
Error on installing openhab2-addons:
Error: Transaction check error:
file /usr/share/openhab2 from install of openhab2-addons-0:2.1.0.20170218221203-1.noarch conflicts with file from package openhab2-0:2.1.0.20170218221203-1.noarch
Hi @Stormwind99 and @sipvoip. I have completed the work on the rpm packages, and all known issues are resolved. Would you be able to test them for me? To do so you'll need to first
yum remove openhab2
yum update
yum install openhab2
yum install openhab2-addons
if you want to simulate an upgrade, then you can pick the other version (has the same rpm setup as the latest) on the repo, simply by running the command:
yum install openhab2-2.1.0.20170225003526
Please let me know how you get on, I have tested a new install and upgrade of all packages on Fedora 25, but would like confirmation before I start moving to a full repo with GPG signing.
@theoweiss, assuming that others are able to confirm my tests would you be happy for this PR (based on this diff to be merged?
Both packages installed without error for me in Fedora 24:
dnf remove openhab2
dnf update
dnf install --nogpgcheck openhab2
dnf install --nogpgcheck openhab2-addons
On Centos 7, I tested openhab2 first, and then addons, and also tested just installed addons and having yum realize it needed to pull openhab2 also. yum remove openhab2 also works, tho I don't know why anyone would want to remove openHab. ;-)
<> nathan stratton
On Sat, Feb 25, 2017 at 11:30 AM, Jason Spangler notifications@github.com wrote:
Both packages installed without error for me:
dnf remove openhab2 dnf update dnf install --nogpgcheck openhab2 dnf install --nogpgcheck openhab2-addons
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openhab/openhab-linuxpkg/pull/37#issuecomment-282494889, or mute the thread https://github.com/notifications/unsubscribe-auth/ABMUEirvtdPRhjkBjMFcQ4S-XAEn-iK4ks5rgFdBgaJpZM4MEZeV .
Thanks @Stormwind99 and @sipvoip for testing! And thanks @theoweiss for reviewing, I've added the documentation now so will merge and test a gpg signed version!
Requires testing to confirm the following before merge:
To help test, please use the following
/etc/yum.repos.d/openHAB.repo
install with:
Closes #36
Signed-off-by: Ben Clark ben@benjyc.uk