Skip to content
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

binary builds on openSUSE build service and locally #76

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

mbhangui
Copy link
Contributor

These files have been added for openSUSE build service on https://build.opensuse.org/project/show/home:notqmail

Description of the important files
notqmail.spec - The RPM spec file
notqmail-rpmlintrc - Containing rules to ignore few non-compliance errors (mostly FHS) on obs.
notqmail-permission.* - These files are needed for SUSE Enterprise Linux (AFAIK)
qmail-send.service - systemd unit file to start qmail-send
notqmail.dsc - packages that opensuse build service should pull before doing a notqmail build
debian/rules - The debian rules file
deban/control - debian packaging control file
debian/preinst,postinst, prerm, postrm - debian pre/post installation and deinstallation scripts

@alanpost alanpost added this to the 1.08 milestone Aug 22, 2019
@alanpost
Copy link
Contributor

It's certainly fine to use the same PR, but will you separate the debian and redhat packaging in to separate commits?

@alanpost
Copy link
Contributor

The debian/ directory belongs in the root of notqmail.git, not inside the open the opensuse_buildservice directory. That is the location it is expected when you run dpkg-buildpackage and friends locally.

@mbhangui
Copy link
Contributor Author

The debian/ directory belongs in the root of notqmail.git, not inside the open the opensuse_buildservice directory. That is the location it is expected when you run dpkg-buildpackage and friends locally.

OK. I will move the the spec file and the debian subdirectory to the root.

There are two ways of doing it. One is having debian subdirectory in the netqmail source tar ball and the other is by having a single tar file named debian.tar.gz. If I have the debian directory in the root, one cannot have debian.tar.gz. My plan is to do the following

  1. Modify Makefile to create debian.tar.gz in the opensuse_buildservice directory
  2. Have a _service file on opensuse build service notqmail directory which will pull notqmail.spec, notqmail.dsc, notqmail-rpmlintr, notqmail-permssion.* files, debian.dsc and debian.tar.gz. obs will then automatically pull all these files when triggerred using the web ui or using the osc command.
  3. A way to automatically trigger the build when anything is updated (just like travis). I am yet to figure this out.
  4. A script to automatically create the changelog from the CHANGES file.

Let me think of a way where both can be achieved and I will reorganize the files accordingly

  1. Building the RPM or debian locally so that any user can build the packages locally by just executing the commands rpmbuild or dpkg-buildpackage
    and
  2. Building the RPM and debian packages on the obs

@alanpost alanpost self-requested a review August 22, 2019 15:06
@mbhangui mbhangui changed the title added files for binary builds on openSUSE build service binary builds on openSUSE build service and locally Aug 22, 2019
@DerDakon DerDakon modified the milestones: 1.09, 1.08 Nov 18, 2019
@schmonz
Copy link
Member

schmonz commented Dec 26, 2019

Bump, @mbhangui and others. How can we help get this done and merged for 1.08?

@mbhangui
Copy link
Contributor Author

Bump, @mbhangui and others. How can we help get this done and merged for 1.08?
I just need to upload the latest tar.gz and do the build. I will do this tomorrow

@DerDakon
Copy link
Member

Maybe just wait until 1.08 is out, the build is done and we are satisfied with it, and then merge it. I would like to avoid that we have a bunch of 1.07.9999 build with patches or weird tarballs and all that. YMMV.

@DerDakon
Copy link
Member

I took the opportunity to rebase this on current master, adapt to some 1.08 changes, and add a second optional commit that drops some things that we want to remove in 1.09 even from the 1.08 packages.

@DerDakon
Copy link
Member

I upgraded one of my servers using this RPM this morning and everything went fine. Some thoughts:

-is it the default to enable a newly installed service?
-what happens if a user like me overrides the service by placing a modified copy in /etc/systemd, should we disable this on package removal?
-/var/qmail/queue/lock/tcpto will show as modified when using "rpm --verify notqmail" because it is modified by the running services. Is there a way that we can mark it as "this file will be modified"? Mark as configuration file?

@mbhangui
Copy link
Contributor Author

-is it the default to enable a newly installed service?
Yes it is the default with almost all standard daemons (atleast on Fedora & CentOS). I have once in a while tried out Ubuntu and Debian. There too, these services get installed for startup by default. A good example is MySQL.

-what happens if a user like me overrides the service by placing a modified copy in /etc/systemd, should we disable this on package removal?

I don't have a definite answer to this. But in postinst, most packages do

systemctl disable servicename

-/var/qmail/queue/lock/tcpto will show as modified when using "rpm --verify notqmail" because it is modified by the running services. Is there a way that we can mark it as "this file will be modified"? Mark as configuration file?

I had this issue in indimail-mta. So what I did was

  1. have /var/indimail/queue in the spec file
  2. create the queue during postinstall of the package
  3. Files which can be created later but actuall belong to the package can be marked as ghost. e.g.
%ghost %config(noreplace,missingok)                %{qsysconfdir}/tcp/tcp.smtp

Today I have built successfully binary builds for all the distros configured in OBS. Added Ubuntu 20.04 and openSUSE leap 15.2. I have done some modifications to the spec file and tested the installation on ubuntu 20.04 and CentOS7. I also tested the delivery. I had to make changes to fix few errors. The errors were all related to installing the systemd unit file.

Meanwhile I have also created docker & podman container images for notqmail. I will create a pull request for the same. The podman/docker images will use the opensuse build service to build the container.

@mbhangui
Copy link
Contributor Author

Oh I forgot to mention. I have created a _service file for obs. Having such a file enables obs to pull the source archive directly from github

<services>
  <service name="download_url">
    <param
        name="host">github.com</param>
    <param name="protocol">https</param>
    <param name="path">/notqmail/notqmail/releases/download/notqmail-1.08/notqmail-1.08.tar.xz</param>
  </service>
</services>

@mbhangui
Copy link
Contributor Author

I did some screw up. I pushed one commit which was supposed to be committed in the opensuse_buildservice branch to the docker branch. I don't know how to fix it

@DerDakon
Copy link
Member

You can do something like "git checkout docker; git reset --hard HEAD^; git push --force" which would wipe the last commit from that given branch.

@mbhangui
Copy link
Contributor Author

Yes. That worked

@mbhangui
Copy link
Contributor Author

@DerDakon can you check the docker pull request. I see older commits that were related to opensuse_buildservice there. I don't understand how those have gone there because the docker pull request is something I just created few minutes back.

I have created the dockerfiles created for ubuntu and centos but don't want to push it till this is cleaned up.

Copy link
Member

@schmonz schmonz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At a glance, without trying to deeply understand these packaging systems, it is plainly evident how much effort you put into understanding these packaging systems. Thank you for going to the trouble: it will help our users (and especially future users) quite a bit. We see some opportunities to lower the future maintenance cost of this packaging code but mostly no urgency, we can do them at leisure as we continue to live with this integrated packaging automation.

open-build-service/.gitignore Show resolved Hide resolved
open-build-service/HOWTO-OBS.md Show resolved Hide resolved
open-build-service/HOWTO-OBS.md Outdated Show resolved Hide resolved
open-build-service/create_archive Outdated Show resolved Hide resolved
open-build-service/create_debian Show resolved Hide resolved
open-build-service/notqmail.dsc.in Outdated Show resolved Hide resolved
open-build-service/notqmail.spec.in Outdated Show resolved Hide resolved
open-build-service/notqmail.spec.in Show resolved Hide resolved
open-build-service/notqmail.spec.in Show resolved Hide resolved
open-build-service/system-users-qmail.conf Show resolved Hide resolved
open-build-service/notqmail.spec.in Outdated Show resolved Hide resolved
open-build-service/notqmail-permissions.easy Show resolved Hide resolved
open-build-service/notqmail-rpmlintrc Show resolved Hide resolved
open-build-service/notqmail.spec.in Outdated Show resolved Hide resolved
open-build-service/notqmail.spec.in Show resolved Hide resolved
open-build-service/notqmail.spec.in Outdated Show resolved Hide resolved
open-build-service/notqmail.spec.in Outdated Show resolved Hide resolved
open-build-service/notqmail.spec.in Show resolved Hide resolved
open-build-service/notqmail.spec.in Outdated Show resolved Hide resolved
open-build-service/notqmail.spec.in Outdated Show resolved Hide resolved
1. HOWTO-OBS.md: updated description and fixed typo
2. create_archive: use git archive command to generate source.tar.gz
3. create_rpm, create_debian: added description on usage
4. debian/control: updated description
5. notqmail.spec: updated description
6. notqmail.spec: fixed instpackage, instchown path
7. notqmail.spec: removed rmdir of doc and man directories
8. notqmail.dsc: updated home page
9. create /usr/lib/systemd/system using install -D
10. notqmail-rpmlintrc: removed addFilter(".* unversioned-explicit-self-provides")
11. system-users-qmail.conf: added comments on usage and applicability.
1. HOWTO-OBS.md: updated with actual examples to build RPM and debian
   packages
2. Makefile: Updated dependencies for _service, notqmail.spec,
   notqmail.dsc, debian/changlog
3. conf-email: Fixed format for email to make debian build happy
4. create_archive: display the git archive command before execution
5. create_debian: updated comments with packages required to build debian
   package for notqmail
6. create_rpm: use git archive command and simplified script
7. debian/postinst: added missing call to instpackage for first time
   installation
8. debian/postinst: replaced all occurences of /var/qmail with $qmaildir
   variable
9. debian/rules: fixed files missing in doc directory
   /usr/share/doc/notqmail
10. notqmail.spec.in: added packager
11. notqmail.spec.in: replaced occurrences of /var/qmail with %{qmaildir}
    macro
12. notqmail.spec.in: do instpackage, instchown for first time installation
    only and just instchown for upgrades
@DerDakon DerDakon modified the milestones: 1.09, 1.09.1 May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants