#27 Update .spec

2.8.1
closed-accepted
Packaging (4)
6
2013-03-28
2013-03-21
Kouhei Sutou
No

The current .spec doesn't follow the latest installed files. There are
the following errors:

RPM build errors:
File not found by glob: /home/opendkim-build/rpm/BUILDROOT/opendkim-2.8.1-1.x86_64/usr/bin/*

RPM build errors:
Installed (but unpackaged) file(s) found:
/usr/include/strl/strl.h
/usr/lib64/libstrl.so.1
/usr/lib64/libstrl.so.1.0.0

The attached patch fixes them.

Discussion

1 2 > >> (Page 1 of 2)
  • Kouhei Sutou
    Kouhei Sutou
    2013-03-21

    Update .spec

     
    • assigned_to: nobody --> cm-msk
     
  • There are sometimes files in "bin", depending on what build options are used. For example, enabling Lua will produce bin/miltertest; enabling stats and OpenDBX will produce bin/opendkim-spam.

    Can the spec file make that a non-fatal error, or put some logic in there to check for the presence of a file before trying to copy files?

    Otherwise, patch applied.

     
  • Kouhei Sutou
    Kouhei Sutou
    2013-03-22

    Maybe "%if" syntax can do it but there are more works for supporting Lua and/or OpenDBX.
    We need to add "Require:" and "BuildRequires:" parameters for dependency packages but there are no paramerters for them.

    I think that we re-add "%{_bindir}/*" after we support Lua and/or OpenDBX.
    I hope that those tasks are discussed with separated tasks because we cannot use the current .spec without this patch. It is a problem what we need to solve before those tasks.

    Could you apply this patch?

     
  • Kouhei Sutou
    Kouhei Sutou
    2013-03-23

    It doesn't works when .spec generated by "configure --with-lua" is used. The configure command line in the .spec doesn't have --with-lua but the .spec requires bin/*.

    % sudo yum install -y lua-devel
    % ./configure --with-lua
    % make dist
    % rpmdev-setuptree
    % cp opendkim-2.8.1.tar.gz rpm/SOURCES/
    % rpmbuild -ba contrib/spec/opendkim.spec # bin/* error

    I've attached the v2 patch. It supports --with-lua but --with-odbx and --with-libjanson aren't supported. Because CentOS 6 doesn't have packages for them.

     
  • Updated again so that ./configure alters the configure command in the spec file based on those same three argument groups. Pushed to "develop".

     
  • Sorry, missed your second patch. Looking now.

     
  • I've reviewed your second diff. Please have a look at what I just put on "develop". It handles the case you have (or should), and also will work when you do have jansson and opendbx packages.

    The spec file there is in use as-is for other distributions. If we need to make CentOS-specific changes directly to it, I'd rather create a separate directory in contrib for CentOS, and then you can change whatever you like in there.

     
  • Kouhei Sutou
    Kouhei Sutou
    2013-03-23

    I looked your cojmmit in "develop" branch. It almost good but there are some problems:

    # "Requires:" and "BuildRequires" are missing. If "Requires:" is missed, user can install opendkim RPM without required RPM such as lua RPM. If "BuildRequires" is missed, user who build his RPM may fail to build by missing dependency RPM such as lua-devel.
    # --enable-reputation configure option is missed.
    # --without-libxml2 option may be required. We cannot use both libxml2 and libjansson. So if build system has libxml2, "configure --with-libjansson" build may be failed. Configure will detect libxml2 automatically.

    I created v3 patch set(v3-000X-*.patch) and attached again. It fixes those problems. (Jansson is not used.)
    I will stop to create opendkim.spec.in based patch because it seems that you want configure.ac based solution is desired.

     
  • As I said, if you would prefer to modify opendkim.spec.in, then we should make a separate one for CentOS because the one we have now is working fine for other distributions.

     
  • In your last patch, why is "have_bin" set if --enable-reputation is provided? No new programs are added to bin for that flag. Same with --enable-stats. These add things to sbin, but not bin.

    I've modified configure.ac and opendkim.spec.in to support what you said is missing. If there are more changes you need, then I'm inclined to fork opendkim.spec.in specifically for CentOS with all of your requested changes, and leave the original alone.

     
  • Kouhei Sutou
    Kouhei Sutou
    2013-03-24

    More of same for configure.in based approach

     
    Attachments
  • Kouhei Sutou
    Kouhei Sutou
    2013-03-24

    I confirmed the latest "develop" branch and found some more problems. I've attached a patch for fixing them. Please check it.

    Summary:

    Removing "lib" prefix from libjansson and libjansson-devel. Fedora's RPM package doesn't have "lib" prefix.
    FYI: CentOS doesn't have RPM pacakge for Jansson. It seems that Suse also doesn't have the package: http://download.opensuse.org/distribution/12.1/repo/oss/suse/x86_64/

    Removing 'installbin="yes"' from 'test x"$xml2_found" = x"yes"': If libxml2 is used for reputation, autobuild isn't installed. So we don't have bin/*. This fixes the following error:

    RPM build errors:
    File not found by glob: /home/opendkim-build/rpm/BUILDROOT/opendkim-2.8.2-1.x86_64/usr/bin/*

    Adding "--without-libjansson": If it is added, Jansson is used rather than libxml2 on Jansson installed environment.

    Removing a space after "Requires:" and "BuildRequires:": "$specrequires" and "$specbuildrequires" has a leading space. So a space after "Requires:" and "BuildRequires:" are needless. (This is just a cosmetic fix.)

    For "%{_includedir}/*": This is for fixing the following RPM errors:
    error: Installed (but unpackaged) file(s) found:
    /usr/include/repute/repute.h
    /usr/include/ut/ut.h

    RPM build errors:
    Installed (but unpackaged) file(s) found:
    /usr/include/repute/repute.h
    /usr/include/ut/ut.h

    Thanks for handling my bug report! :-)

    P.S.
    About my last patch.

    "have_bin" and --eanble-reputation problem is my falut. Sorry. "have_bin" isn't needed.
    "have_bin" for "--enable-stats" is right because --with-odbx is also specified.

    About whether CentOS specific or not. My last patch isn't CentOS specific. Distribution specific things are

    * dependency packages exist on the distribution
    * dependency package names are maybe different

    The first thing can be resolved by enable_stats and enable_reputation variables. They can be used by --define rpmbuild parameter like 'rpmbuild -ba --define "enable_stats 1" opendkim.spec'.
    The second thing may require more works but it seems that the current dependecy packages (Lua, OpenDBX and Jansson) have same names in major RPM based distributions. (I confirmed CentOS, Fedora and OpenSUSE.) And the second thinig isn't resolved in configure.in based approach.

    And thanks again. :-)

     
  • Is the --without-jansson addition necessary? There's already a test that will abort if both libjansson and libxml2 are specified.

    The rest looks fine. Pushed to "develop".

     
  • Kouhei Sutou
    Kouhei Sutou
    2013-03-24

    Thanks for merging it.

    Consider about the following case:

    * Have Jansson
    * Run configure --enable-reputation --without-libjansson
    * Run make dist
    * Run rpmbuild with .tar.gz and .spec

    In the case, configure in rpmbuild finds Jansson and uses it rather than libxml2.

     
  • This is a bug elsewhere. The intent is that if you say --enable-reputation --with-libxml2, it will ignore any libjansson that might be present. I'll fix that.

     
  • This is now fixed on "develop". You shouldn't need --without-libjansson now in your example any longer.

     
    • priority: 5 --> 6
     
  • Kouhei Sutou
    Kouhei Sutou
    2013-03-24

    v2: More of same for configure.in based approach

     
    Attachments
  • Kouhei Sutou
    Kouhei Sutou
    2013-03-24

    Thanks. It works but more works left.

    1:

    Removing 'installbin="yes"' from 'test x"$xml2_found" = x"yes"': If libxml2
    is used for reputation, autobuild isn't installed. So we don't have bin/*.
    This fixes the following error:

    RPM build errors:
    File not found by glob:
    /home/opendkim-build/rpm/BUILDROOT/opendkim-2.8.2-1.x86_64/usr/bin/*

    2:
    Remove arguments from --with-libxml2 and --with-jansson to ensure those values are "yes" not "auto". If we configure with "--enable-reputation and --with-libxml2=auto", Jansson will be used on Jansson available environment even if we specify --with-libxml2.

    3:
    Fix a typo: --with-jansson misses "lib". It should be "--with-libjansson".

    I attached a patch v3 patch.

     
  • Kouhei Sutou
    Kouhei Sutou
    2013-03-24

    v3: More of same for configure.in based approach

     
    Attachments
1 2 > >> (Page 1 of 2)