New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes required for RPM Build #59
Comments
The url for the notqmail package on obs is at |
Running instchown in this sort of package builds isn't actually required, one could instead specify the needed users/groups in the rpm file. When you are not root don't call it. The instchown DESTDIR thing IMHO also belongs into 1.07 as that is most of the purpose of exactly that change. The systemd service file can just be copied in the spec file, no need to touch hier.c for this. What is wrong with the queue in rpm? |
Does this work:
|
+1 to providing a separate queue-create-and-fix program that can be avoided at build time and invoked at package-install time. I worked around this in pkgsrc by calling instpackage twice: once with DESTDIR to stage and package (and pkgsrc omits the queue from the package since it’s outside PREFIX), and a second time at package-install, ignoring errors, just before calling instchown on the installed files. Can you say more about why instchown needs DESTDIR support? I didn’t need it for pkgsrc, so I’m wondering what’s different in other systems. |
Good idea. Yes. We can modify the Makefile and skip calling instchown when the user is not root.
Yes. The RPM build fails without the changes.
That was my original plan. But on second thoughts I thought all startup related files belong in /var/qmail/boot. Also systemd is so ubiquitous now. We need to add it in the documentation somewere on how to start qmail-send, svscan, etc using systemd. I will put it as part of the spec/rules file with few echo statements.
The timestamp of the directories and files in the queue directories keep on changing. If these directory/files, belonging to /var filesystem are part of the RPM package, it creates a problem when we do rpm --verify notqmail. All of these show as having been modified, indicating changes made to the RPM package. |
@schmonz without the DESTDIR support, while building the RPM, instchown tries to create directories in /var/qmail, which fails because rpmbuild is running with a non-privileged userid. |
It failed. The full list of acceptable license is here The one that comes closest to Public Domain is this |
Okay, that helps me ask a more precise question: why does instchown need to run while building the RPM? I would expect installing the RPM package to
Here's the notqmail-ready version of my install script for pkgsrc. Another question, are you using instpackage (possibly via the new "package" Makefile target) when building the RPM? |
Ok. This is what i will do
Do the following in postinst
I see that you are also running config-fast. That would complete the notqmail setup for binary installations. I will follow your steps.
Yes. It gets called because I do a make setup to install the binaries in BUILD_ROOT/var/qmail |
Aha! If my mental model of building packages applies to the RPM world, |
It is the same here. That's why I skip all calls to chown (because non of the users exist on the machine where RPM is being built). The user/group creation is done in postinst /usr/bin/getent group nofiles > /dev/null || /usr/sbin/groupadd nofiles || true /usr/bin/getent passwd alias > /dev/null || /usr/sbin/useradd -M -g nofiles -d %{qmaildir}/alias -s /sbin/nologin alias || true |
The debian builds have got completed successfully. I installed one of them (debian 7) and it worked. Now I still have few things left on the plate
From ubuntu:xenial
MAINTAINER cprogrammer
\# Freshen RUN apt-get -y update
RUN export HOSTNAME=indimail.org DEBIAN_FRONTEND=noninteractive \
&& mkdir -p /root \
&& apt-get -y update \
&& apt-get install -y wget gnupg2 \
&& wget -nv https://download.opensuse.org/repositories/home:mbhangui/Debian_9.0/Release.key -O - | apt-key add - \
&& echo 'deb http://download.opensuse.org/repositories/home:/mbhangui/xUbuntu_17.04/ /' > /etc/apt/sources.list.d/indimail.list \
&& apt-get -y update \
&& apt-get -y install \
debianutils \
less \
man-db \
net-tools \
openssh-server \
openssl \
procps \
systemd \
systemd-sysv \
telnet \
strace \
lsof
vim \
&& apt-get -y install mrtg indimail \
&& /usr/sbin/svctool --config=cert --postmaster=postmaster@indimail.org --common_name=indimail.org >/dev/null \
&& echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config \
&& unset HOSTNAME
COPY .alias .bash_profile .bashrc .exrc .gfuncs .glogout .indent.pro .vimrc /root/ |
BTW the debian builds include ubuntu. Also I can turn on the builds for ARM architecture on OBS. But I doubt if anyone will be looking forward to have notqmail on raspberrypi and clones. I use daemontools, ucspi-tcp, qmail built on obs for my very low jitter music mpd player based on volumio/dietpi https://www.allo.com/sparky/piano-dac-2-1.html |
I have modified the RPM build (log here:
|
The RPM build for few of the RPM distros failed for lack of sysuser-tools. I will link notqmail with an existing project on obs for sysuser-tools package. That will take care of the build. @DerDakon The debian/ubunto distros come with sysuser-tools. I linked sysuser-tools project from openSUSE:Factory to home:notqmail, but the build for sysuser-tools failed on most of the RPM distros (except for FC30). So we will have to try a different approach to create the qmail users. Maybe #if defined statments to use the usual useradd command where the sysuser-tools are missing. |
@DerDakon Looks like Fedora, CentOS & RHEL, using useradd in the spec file scripts is the only way to package the users. I will do reading on packaging guidlines for suse distributions (on tumbleweed they do have sysuser-tools. So it looks like suse will also add this package in the future). Edit: Same goes for suse distributions. They have pwdutils instead of shadow-utils |
The builds have got completed successfuly for all the distros. I had to put conditional inclusion of sysuser-tools
|
Thanks for caring about this. This was what I was about to do, but I was too tired and went to bed instead. |
I was able to install the openSUSE 15.0 rpm and actually start the qmail-send daemon now. I broke much of it when I moved the documentation around, this leads to instchown failing early because it can't touch it. I added a patch for that in the meantime. Another problem is that when I update from one build to another the user accounts are deleted, so the runtime user lookup code fails hard. I have only solved this by hard-uninstalling (to ignore the system dependencies to smtp_daemon) the rpm and then just installing it again. |
Great
I will fix the deletion of user accounts on upgrade. This could be because, the postun script should exit when doing upgrade. |
I just realized that there is no need for instchown for RPM builds. RPM spec has the permissions for each and every file. As long as the user accounts are created in the %pre scriptlet, the permissions will be correct. inschown is needed only for the debian builds. I will remove the call to instchown in the spec file. This is one of the reaons I find RPM packaging superior to the debian way of doing things. Just one file to mess around with. For my first debian build, it had taken enormous effort to create a successful build. |
I have just updated the spec file with the changes. Let me know if the new build upgrades successfully Edit: I missed out skipping service deletion in %preun for upgrades. Added that just now and issued a new build |
The problem with the users getting deleted on update is still existent in revision 50. |
Also instchown is still installed (which is good atm) as the queue is created with wrong permissions on sendmutex and friends, so qmail-start would fail. |
That could be because the postun of the previous package got called. The postun of the previous package didn't have the following lines. The current package that you have will have the below lines and hence when you do the next upgrade, the users shouldn't get deleted # we are doing upgrade
|
You are right, reinstalling the same package again leaves the users in place. |
I fixed basically all permissions, my check is at the moment:
Since that works fine now I have entirely dropped instchown from the rpms. |
lovely.
|
In the notqmail.spec file, there are a couple references to notqmail URLs: see_base and the URL field. Will you modify both of these, along with other places we have a URL, to be https://notqmail.org/ ? That location is a temporary redirect to the URLs as you have them, but it's temporary: it might change in the future whereas our domain will not. |
Done |
Awesome, thank you. I'll get myself signed up to that service as soon as I'm able--I appreciate your being attentive here where I can leave comments until I do so. I'm not sure that https://notqmail.org/wiki works, probably the /wiki slug should be / like this, instead: We could certainly cause /wiki to work, however, if that is the superior option. |
@alanpost if you have a opensuse id, i will add that id to the list of collaborators for notqmail. |
@mbhangui, I have created an account on build.opensuse.org. alynpost. Note the 'y', which differs from my account name here in GitHub. Thank you for adding me to the notqmail project. |
Fixed debian builds by modifying notqmail.dsc with the proper tar file name notqmail-1.07.tar.xz instead of notqmail-1.07.tar.gz |
Thanks, I broke it but was too tired to fix it. Thanks for cleaning up after me. |
Closing this because the build was accomplished without changing any existing code. |
I would like to pull all the (relevant) files from build.opensuse.org in to the codebase, bringing in-tree deb and rpm build rules for notqmail. I'd be happy to have a PR for that work--a separate PR for each package type. |
There is a way where obs can pull the files from github using a file named _service. Something like this (the below is just an example and I will change the url and filenames).
The question I have for @alanpost , @DerDakon , @schmonz is the following
or
|
No need for a separate repository, you can create a directory or the appropriate files in notqmail.git.
If we have a choice, I'd rather a longer name than obs--spelling out the vendor/third-party rather than abbreviating it, and if it's only a single file or so (I'm unclear on that part) just put it in the root of the repository. Did that answer your question? |
It answers my question. But it will be multiple files (just the spec file & rpmlintrc for .rpm and multiple files in debian subdirectory for .deb). Let me think of a name for a directory which will represent openSUSE build service. The files in the debian subdirectory will be the following |
So I spent some time setting up opensuse build service (obs) for notqmail. The RPM builds are available at
https://software.opensuse.org//download.html?project=home%3Anotqmail&package=notqmail
This is work in progress and I still have to start creating the necessary files needed for debian builds (rules, changelog, notqmail.dsc, etc).
The good thing is that notqmail will build on all the known linux distros. So far notqmail was found to build successfully on the following distros
centos7, centos6, rhel7, rhel6, FC30, opensuse Tumbleweed, opensuse leap 15.1, opensuse leap 15.0, suse linux enterprise 15 (& SP1), suse linux enterprise 12 (sp1, sp2, sp3, sp4)
To build binary packages, following are the issues (all suppressed by creating rpmlintrc file) and by modifying instchown.c,
The text was updated successfully, but these errors were encountered: