Bug 2013814 - Review Request: libxo - A Library for Generating Text, XML, JSON, and HTML Output
Summary: Review Request: libxo - A Library for Generating Text, XML, JSON, and HTML Ou...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Brian Lane
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-10-13 20:03 UTC by kchim
Modified: 2022-02-12 01:18 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-02-12 01:14:47 UTC
Type: ---
Embargoed:
bcl: fedora-review+


Attachments (Terms of Use)
libxo.spec (2.02 KB, text/plain)
2021-12-03 15:31 UTC, kchim
no flags Details
libxo-1.6.0-1.fc35.src.rpm (697.32 KB, application/octet-stream)
2021-12-03 15:33 UTC, kchim
no flags Details
libxo.spec (2.02 KB, application/octet-stream)
2021-12-13 14:59 UTC, kchim
no flags Details
libxo-1.6.0-1.fc35.src.rpm (697.31 KB, application/octet-stream)
2021-12-13 15:01 UTC, kchim
no flags Details
libxo.spec (2.02 KB, text/plain)
2021-12-13 15:06 UTC, kchim
no flags Details
libxo.spec (2.14 KB, text/plain)
2021-12-17 08:20 UTC, kchim
no flags Details
libxo-1.6.0-1.fc35.src.rpm (697.32 KB, application/octet-stream)
2021-12-17 08:21 UTC, kchim
no flags Details
libxo-1.6.0-1.fc35.x86_64.rpm (207.31 KB, application/octet-stream)
2021-12-17 12:46 UTC, kchim
no flags Details
libxo.spec (1.99 KB, text/plain)
2021-12-20 07:55 UTC, kchim
no flags Details
libxo-1.6.0-1.fc35.src.rpm (697.30 KB, application/octet-stream)
2021-12-20 07:56 UTC, kchim
no flags Details
libxo-1.6.0-1.fc35.x86_64.rpm (207.31 KB, application/octet-stream)
2021-12-20 07:57 UTC, kchim
no flags Details
libxo.spec (1.89 KB, text/plain)
2022-01-27 12:25 UTC, kchim
no flags Details
libxo-1.6.0-1.fc35.x86_64.rpm (207.12 KB, application/octet-stream)
2022-01-27 12:26 UTC, kchim
no flags Details
libxo-1.6.0-1.fc35.src.rpm (697.27 KB, application/x-rpm)
2022-01-27 12:27 UTC, kchim
no flags Details

Description kchim 2021-10-13 20:03:18 UTC
https://drive.google.com/file/d/1jGSkKo9-QDiCiLsSd5qagjgBbkHKyhEh/view?usp=sharing: libxo.spec

https://drive.google.com/file/d/1v6m8Q_unoGhqbQKzRam4yeLz_7XoyYu0/view?usp=sharing: srpm built from `libxo.spec` using `rpmbuild -ba`

Description: The libxo library allows an application to generate text, XML, JSON, and HTML output using a common set of function calls. The application decides at run time which output style should be produced. The application calls a function "xo_emit" to product output that is described in a format string. A "field descriptor" tells libxo what the field is and what it means.

Fedora Account System Username: kanitha

Comment 1 Brian Lane 2021-10-14 17:32:48 UTC
Hi, this still needs a bit of work. You can find most of these things by running 'fedora-review -r -n libxo' in the directory with your .src.rpm file.

The biggest problem I see is that the package isn't using the same source tarfile from upstream, it looks like it has been modified and repackaged. When possible upstream releases should be used as-is, and modified by the %prep stage in the spec or by applying patches.

Some smaller issues:
 * Use the %{version} macro when referring to the version number in the spec. eg. the Source0 line, this makes it easier to update to the next version, you just need to edit the number in one place.
 * BuildRequires needs gcc added. Fedora is moving towards smaller buildroots and more explicit requirements. It works right now, but in the future you can't assume it will be present without requiring it.
 * In %prep use the %autosetup macro instead of %setup, this will apply any PatchXXX files automatically
 * The Patch0 should have a short description of why it is needed, either as a comment in the spec, or in the patch itself if it is from a git commit.
 * A number of the files are ending up in both libxo and libxo-devel:
  - include files should all be in -devel only
  - the library documentation in man3 should all be in -devel only
  - the .a and .pc files should only be in -devel
  - you don't need to have the man3 directory name in the %file section, the manpage directories are already present, just refer to the files or a suitable wildcard.
 * The .so files should not be wildcarded, this can lead to unexpected problems when the version number changes.
   Instead refer to them as their full filename, or eg. libenc*so.0 libenc*so.0.0.0


I also noticed that the src.rpm is using an el8 release. While it's possible to do this process on RHEL/CentOS it would be better to do it with Fedora. You can use a VM or a podmain container on RHEL if you need to.


Here's the output of fedora-review (with my manual observations selected with X instead of x):


Package Review
==============

Legend:
[x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated
[ ] = Manual review needed


Issues:
=======
- If your application is a C or C++ application you must list a
  BuildRequires against gcc, gcc-c++ or clang.
  Note: No gcc, gcc-c++ or clang found in BuildRequires
  See: https://docs.fedoraproject.org/en-US/packaging-guidelines/C_and_C++/
- Header files in -devel subpackage, if present.
  Note: libxo : /usr/include/libxo/xo.h libxo :
  /usr/include/libxo/xo_encoder.h
  See: https://docs.fedoraproject.org/en-US/packaging-
  guidelines/#_devel_packages
- Sources used to build the package match the upstream source, as provided
  in the spec URL.
  Note: Upstream MD5sum check error, diff is in /root/libxo/libxo/diff.txt
  See: https://docs.fedoraproject.org/en-US/packaging-guidelines/SourceURL/
- Static libraries in -static or -devel subpackage, providing -devel if
  present.
  Note: Package has .a files: libxo, libxo-devel. Illegal package name:
  libxo. Does not provide -static: libxo, libxo-devel.
  See: https://docs.fedoraproject.org/en-US/packaging-
  guidelines/#packaging-static-libraries


===== MUST items =====

C/C++:
[X]: Package does not contain kernel modules.
[X]: Package contains no static executables.
[x]: ldconfig not called in %post and %postun for Fedora 28 and later.
[x]: Package does not contain any libtool archives (.la)
[x]: Rpath absent or only used for internal libs.
[x]: Development (unversioned) .so files in -devel subpackage, if present.

Generic:
[X]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[X]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "Unknown or generated", "BSD 2-Clause License", "BSD 4-Clause
     License BSD 2-clause NetBSD License", "BSD 3-Clause License", "*No
     copyright* Public domain", "MIT License". 312 files have unknown
     license. Detailed output of licensecheck in
     /root/libxo/libxo/licensecheck.txt
[X]: License file installed when any subpackage combination is installed.
[!]: Package does not own files or directories owned by other packages.
     Note: Dirs in package are owned also by:
     /usr/share/man/man3(filesystem)
[X]: %build honors applicable compiler flags or justifies otherwise.
[X]: Package contains no bundled libraries without FPC exception.
[X]: Changelog in prescribed format.
[X]: Sources contain only permissible code or content.
[-]: Package contains desktop file if it is a GUI application.
[!]: Development files must be in a -devel package
[X]: Package uses nothing in %doc for runtime.
[X]: Package consistently uses macros (instead of hard-coded directory
     names).
[X]: Package is named according to the Package Naming Guidelines.
[X]: Package does not generate any conflict.
[X]: Package obeys FHS, except libexecdir and /usr/target.
[-]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[X]: Requires correct, justified where necessary.
[X]: Spec file is legible and written in American English.
[-]: Package contains systemd file(s) if in need.
[X]: Useful -debuginfo package or justification otherwise.
[X]: Package is not known to require an ExcludeArch tag.
[-]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 10240 bytes in 2 files.
[X]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %license.
[x]: Package requires other packages for directories it uses.
[x]: Package must own all directories that it creates.
[x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Dist tag is present.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package must not depend on deprecated() packages.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: Package does not use a name that already exists.
[x]: Package is not relocatable.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: File names are valid UTF-8.
[x]: Packages must not store files under /srv, /opt or /usr/local

===== SHOULD items =====

Generic:
[]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.
[ ]: Final provides and requires are sane (see attachments).
[X]: Package functions as described.
[X]: Latest version is packaged.
[X]: Package does not include license text files separate from upstream.
[!]: Patches link to upstream bugs/comments/lists or are otherwise
     justified.
[X]: The placement of pkgconfig(.pc) files are correct.
     Note: libxo : /usr/lib64/pkgconfig/libxo.pc
[-]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
     Note: gpgverify is not used.
[-]: Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[X]: Package should compile and build into binary rpms on all supported
     architectures.
[?]: %check is present and all tests pass.
[X]: Packages should try to preserve timestamps of original installed
     files.
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Fully versioned dependency in subpackages if applicable.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Uses parallel make %{?_smp_mflags} macro.
[x]: Sources can be downloaded from URI in Source: tag
[x]: SourceX is a working URL.
[x]: Spec use %global instead of %define unless justified.

===== EXTRA items =====

Generic:
[x]: Rpmlint is run on debuginfo package(s).
     Note: There are rpmlint messages (see attachment).
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Large data in /usr/share should live in a noarch subpackage if package
     is arched.
[x]: Package should not use obsolete m4 macros


Rpmlint
-------
Cannot parse rpmlint output:


Rpmlint (debuginfo)
-------------------
Cannot parse rpmlint output:



Rpmlint (installed packages)
----------------------------
Cannot parse rpmlint output:


Source checksums
----------------
https://github.com/Juniper/libxo/releases/download/1.6.0/libxo-1.6.0.tar.gz :
  CHECKSUM(SHA256) this package     : fca2d2d0c628d5a2b41e9dbe4ef1aa032e3680b2cb5c86a27e552a2eb8368bd7
  CHECKSUM(SHA256) upstream package : 9f2f276d7a5f25ff6fbfc0f38773d854c9356e7f985501627d0c0ee336c19006
diff -r also reports differences


Requires
--------
libxo (rpmlib, GLIBC filtered):
    /usr/bin/perl
    /usr/bin/pkg-config
    /usr/bin/sh
    ld-linux-x86-64.so.2()(64bit)
    libc.so.6()(64bit)
    libdl.so.2()(64bit)
    libxo.so.0()(64bit)
    rtld(GNU_HASH)

libxo-devel (rpmlib, GLIBC filtered):
    /usr/bin/pkg-config
    /usr/bin/sh
    libenc_cbor.so.0()(64bit)
    libenc_csv.so.0()(64bit)
    libenc_test.so.0()(64bit)
    libxo(x86-64)
    libxo.so.0()(64bit)

libxo-debuginfo (rpmlib, GLIBC filtered):

libxo-debugsource (rpmlib, GLIBC filtered):



Provides
--------
libxo:
    libenc_cbor.so.0()(64bit)
    libenc_csv.so.0()(64bit)
    libenc_test.so.0()(64bit)
    libxo
    libxo(x86-64)
    libxo.so.0()(64bit)
    pkgconfig(libxo)

libxo-devel:
    libxo-devel
    libxo-devel(x86-64)
    pkgconfig(libxo)

libxo-debuginfo:
    debuginfo(build-id)
    libenc_cbor.so.0.0.0-1.6.0-1.fc35.x86_64.debug()(64bit)
    libenc_csv.so.0.0.0-1.6.0-1.fc35.x86_64.debug()(64bit)
    libenc_test.so.0.0.0-1.6.0-1.fc35.x86_64.debug()(64bit)
    libxo-debuginfo
    libxo-debuginfo(x86-64)
    libxo.so.0.0.0-1.6.0-1.fc35.x86_64.debug()(64bit)

libxo-debugsource:
    libxo-debugsource
    libxo-debugsource(x86-64)



Generated by fedora-review 0.7.6 (b083f91) last change: 2020-11-10
Command line :/usr/bin/fedora-review -r -n libxo
Buildroot used: fedora-rawhide-x86_64
Active plugins: Generic, C/C++, Shell-api
Disabled plugins: Ocaml, fonts, Perl, SugarActivity, Python, Haskell, Java, PHP, R
Disabled flags: EPEL6, EPEL7, DISTTAG, BATCH, EXARCH

Comment 2 kchim 2021-11-10 10:55:49 UTC
@bcl Regarding this comment,

>>>
   The biggest problem I see is that the package isn't using the same source tarfile from upstream, it looks like it has been modified and repackaged. When possible upstream releases should be used as-is, and modified by the %prep stage in the spec or by applying patches.


I am not sure I understand the problem. I thought I already specified the upstream source in the spec file already. Could you give a bit more context?


Here is my actual spec file:

>>>
Name:           libxo
Version:        1.6.0
Release:        1%{?dist}
Summary:        A Library for Generating Text, XML, JSON, and HTML Output


License:        BSD
URL:            https://github.com/Juniper/libxo
Source0:        https://github.com/Juniper/libxo/releases/download/1.6.0/libxo-1.6.0.tar.gz
Patch0:         libxo-1.6.0-sysctl.patch

....

>>>

Comment 3 Brian Lane 2021-11-11 18:53:54 UTC
That just points to the upstream path for the tar, but it isn't downloaded at build time. The src.rpm includes a copy of it alongside the spec file.

You can examine this by running:

rpm2cpio libxo-1.6.0-1.el8.src.rpm | cpio -od

in a temporary directory, it will extract the contents:

libxo-1.6.0-sysctl.patch  libxo-1.6.0.tar.gz  libxo.spec

And if you run sha256sum on the tar included in the src.rpm it doesn't match the upstream tar's hash, which is what fedora-review means with this output:


https://github.com/Juniper/libxo/releases/download/1.6.0/libxo-1.6.0.tar.gz :
  CHECKSUM(SHA256) this package     : fca2d2d0c628d5a2b41e9dbe4ef1aa032e3680b2cb5c86a27e552a2eb8368bd7
  CHECKSUM(SHA256) upstream package : 9f2f276d7a5f25ff6fbfc0f38773d854c9356e7f985501627d0c0ee336c19006
diff -r also reports differences


Somehow the libxo-1.6.0.tar.gz you used when creating the src.rpm isn't the same as the upstream one. Sometimes downloading via the browser can grab the wrong one. The easiest way to get it is to use rpmspectool:

# rpmspectool get --sources ./libxo.spec
# sha256sum libxo-1.6.0.tar.gz
9f2f276d7a5f25ff6fbfc0f38773d854c9356e7f985501627d0c0ee336c19006  libxo-1.6.0.tar.gz

which matches the expected upstream hash.

Comment 4 David Cantrell 2021-12-03 15:11:27 UTC
Good tip.  The cpio command has a typo, you need to do:

rpm2cpio libxo-1.6.0-1.el8.src.rpm | cpio -id

I also always forget cpio options, so I favor using "rpmdev-extract" which will unpack an RPM or SRPM and create a subdirectory for it.

Comment 5 kchim 2021-12-03 15:31:04 UTC
Created attachment 1844618 [details]
libxo.spec

Reuploading the latest libxo.spec file.

Comment 6 kchim 2021-12-03 15:33:00 UTC
Created attachment 1844620 [details]
libxo-1.6.0-1.fc35.src.rpm

Latest source rpm file of libxo

Comment 7 kchim 2021-12-03 15:35:11 UTC
I have redownload the libxo-1.6.0.tar.gz file and confirm the checksum as well as made a change on the spec file per your comments. Please review it once again.

Thanks a lot.

Comment 8 Brian Lane 2021-12-08 19:59:11 UTC
The tar checksums now match correctly, but the spec file in the rpm is libxo_cp.spec not libxo.spec for some reason. It also looks like most of the issues from comment #1 still need to be addressed.

Comment 9 kchim 2021-12-13 14:59:58 UTC
Created attachment 1846099 [details]
libxo.spec

Latest libxo.spec file

Comment 10 kchim 2021-12-13 15:01:46 UTC
Created attachment 1846101 [details]
libxo-1.6.0-1.fc35.src.rpm

Latest libxo source rpm file

Comment 11 kchim 2021-12-13 15:06:12 UTC
Created attachment 1846102 [details]
libxo.spec

Latest libxo.spec file

Comment 12 kchim 2021-12-13 15:09:40 UTC
Here is the result after running `fedora-review -r -n libxo` against the source rpm file.

------------
INFO: Processing local files: libxo
INFO: Getting .spec and .srpm Urls from : Local files in /home/kchim/rpmbuild/SRPMS
INFO:   --> SRPM url: file:///home/kchim/rpmbuild/SRPMS/libxo-1.6.0-1.fc35.src.rpm
INFO: Using review directory: /home/kchim/rpmbuild/SRPMS/libxo
INFO: Downloading (Source0): https://github.com/Juniper/libxo/releases/download/1.6.0/libxo-1.6.0.tar.gz
INFO: Running checks and generating report
INFO: Results and/or logs in: /home/kchim/rpmbuild/SRPMS/libxo/results
INFO: Reading configuration from /etc/mock/site-defaults.cfg
INFO: Reading configuration from /etc/mock/fedora-rawhide-x86_64.cfg
INFO: Build completed
INFO: Installing built package(s)
INFO: Active plugins: Generic, Shell-api, C/C++
Last metadata expiration check: 0:00:04 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:00:09 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:00:11 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:00:12 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:00:14 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:00:16 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:00:17 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:00:19 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:00:21 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:00:22 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:00:24 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:00:26 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:00:27 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:00:29 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:00:31 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:00:32 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:00:52 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:00:53 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:00:55 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:00:57 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:00:58 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:01:00 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:01:02 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:01:04 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:01:05 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:01:07 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:01:09 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:01:11 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:01:14 ago on Mon Dec 13 15:44:04 2021.
Package basesystem-11-12.fc35.noarch contains no files
Package glibc-minimal-langpack-2.34.9000-27.fc36.x86_64 contains no files
Last metadata expiration check: 0:01:16 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:01:18 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:01:21 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:01:23 ago on Mon Dec 13 15:44:04 2021.
Last metadata expiration check: 0:01:25 ago on Mon Dec 13 15:44:04 2021.
INFO:  ExclusiveArch dependency checking disabled, enable with EXARCH flag

Review template in: /home/kchim/rpmbuild/SRPMS/libxo/review.txt
fedora-review is automated tool, but *YOU* are responsible for manually
reviewing the results and finishing the review. Do not just copy-paste
the results without understanding them.
------------


If I understand correctly the problem could be because of the issues with the dependencies packages `basesystem-11-12.fc35.noarch` and `glibc-minimal-langpack-2.34.9000-27.fc36.x86_64`. It is something new to me. Could you please explain what is going on here? 

Thanks!

Comment 13 Brian Lane 2021-12-13 23:29:55 UTC
(In reply to kchim from comment #12)
> Here is the result after running `fedora-review -r -n libxo` against the
> source rpm file.
> 
> Review template in: /home/kchim/rpmbuild/SRPMS/libxo/review.txt
> fedora-review is automated tool, but *YOU* are responsible for manually
> reviewing the results and finishing the review. Do not just copy-paste
> the results without understanding them.
> ------------
> 
> 
> If I understand correctly the problem could be because of the issues with
> the dependencies packages `basesystem-11-12.fc35.noarch` and
> `glibc-minimal-langpack-2.34.9000-27.fc36.x86_64`. It is something new to
> me. Could you please explain what is going on here? 
> 

Those are normal warnings, everything ran successfully.

Comment 14 kchim 2021-12-14 14:20:00 UTC
Thanks. Does that mean it is good to go?

Comment 15 Brian Lane 2021-12-14 16:53:00 UTC
No, you still haven't fixed the following issues from comment #1

 * Use the %{version} macro when referring to the version number in the spec. eg. the Source0 line, this makes it easier to update to the next version, you just need to edit the number in one place.
 * In %prep use the %autosetup macro instead of %setup, this will apply any PatchXXX files automatically
 * A number of the files are ending up in both libxo and libxo-devel:
  - include files should all be in -devel only
  - the library documentation in man3 should all be in -devel only
  - the .a and .pc files should only be in -devel
  - you don't need to have the man3 directory name in the %file section, the manpage directories are already present, just refer to the files or a suitable wildcard.
 * The .so files should not be wildcarded, this can lead to unexpected problems when the version number changes.
   Instead refer to them as their full filename, or eg. libenc*so.0 libenc*so.0.0.0

Comment 16 kchim 2021-12-16 10:35:12 UTC
I tried to use %autosetup but I kept running into this error:


=====
setting SOURCE_DATE_EPOCH=1628640000
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.8v9BmL
+ umask 022
+ cd /home/kchim/rpmbuild/BUILD
+ cd /home/kchim/rpmbuild/BUILD
+ rm -rf libxo-1.6.0
+ /usr/bin/gzip -dc /home/kchim/rpmbuild/SOURCES/libxo-1.6.0.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd libxo-1.6.0
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ /usr/bin/cat /home/kchim/rpmbuild/SOURCES/libxo-1.6.0-sysctl.patch
+ /usr/bin/patch -s --fuzz=0 --no-backup-if-mismatch -f
The text leading up to this was:
--------------------------
|diff -up libxo-1.6.0/libxo/xo_syslog.c.orig libxo-1.6.0/libxo/xo_syslog.c
|--- libxo-1.6.0/libxo/xo_syslog.c.orig	2021-10-08 15:38:30.662205414 +0200
|+++ libxo-1.6.0/libxo/xo_syslog.c	2021-10-08 15:39:05.869501902 +0200
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
error: Bad exit status from /var/tmp/rpm-tmp.8v9BmL (%prep)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.8v9BmL (%prep)
=====







Here is my update spec file:

=====
Name:           libxo
Version:        1.6.0
Release:        1%{?dist}
Summary:        A Library for Generating Text, XML, JSON, and HTML Output


License:        BSD
URL:            https://github.com/Juniper/libxo
Source0:        https://github.com/Juniper/libxo/releases/download/%{version}/libxo-%{version}.tar.gz

# Remove include line for header file not present in glibc
Patch0:         libxo-1.6.0-sysctl.patch

BuildRequires:  make
BuildRequires:  gcc

%description
The libxo library allows an application to generate text, XML, JSON, and HTML 
output using a common set of function calls. The application decides at run 
time which output style should be produced. The application calls a function
"xo_emit" to product output that is described in a format string.
A "field descriptor" tells libxo what the field is and what it means.


%package        devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%prep
%autosetup

%build
%configure
make %{?_smp_mflags}


%install
#remove .la files
%make_install
find %{buildroot} -type f -name "*.la" | xargs rm -f
rm -f %{buildroot}%{_docdir}/libxo/Copyright

%{?ldconfig_scriptlets}


%files
%license Copyright
%doc README.md INSTALL.md
%{_libdir}/libxo.so.0
%{_libdir}/libxo.so.0.0.0
%{_bindir}/libxo-config
%{_bindir}/xo
%{_bindir}/xohtml
%{_bindir}/xolint
%{_bindir}/xopo
%dir %{_libdir}/libxo
%dir %{_libdir}/libxo/encoder
%{_libdir}/libxo/encoder/*.enc
%{_libdir}/libxo/encoder/libenc*.so.0
%{_libdir}/libxo/encoder/libenc*.so.0.0.0
%{_datadir}/libxo
%{_mandir}/man1/*.1.gz
%{_mandir}/man5/*.5.gz
%{_mandir}/man7/*.7.gz

%files devel
%{_includedir}/*
%{_libdir}/libxo.so
%{_libdir}/libxo.so.0
%{_libdir}/libxo.so.0.0.0
%{_bindir}/libxo-config
%{_libdir}/*.a
%{_mandir}/man3/*.3.gz
%{_libdir}/pkgconfig/libxo.pc
%{_libdir}/libxo/encoder/*.a
%{_libdir}/libxo/encoder/libenc*.so
%{_libdir}/libxo/encoder/libenc*.so.0
%{_libdir}/libxo/encoder/libenc*.so.0.0.0

%changelog
* Wed Aug 11 2021 Kanitha Chim <kchim> - 1.6.0-1
- Initial package
====


Everything else works except for when I changed to use %autosetpu

Comment 17 Brian Lane 2021-12-16 17:38:32 UTC
You need to add -p1 so that it will strip off the first directory of the patch, it takes (mostly) the same arguments as the %setup macro.

Comment 18 kchim 2021-12-17 08:20:49 UTC
Created attachment 1846686 [details]
libxo.spec

An updated version of libxo.spec

Comment 19 kchim 2021-12-17 08:21:59 UTC
Created attachment 1846687 [details]
libxo-1.6.0-1.fc35.src.rpm

Source rpm file

Comment 20 kchim 2021-12-17 08:28:14 UTC
Thanks, Brian. That worked. I uploaded the latest spec file and source rpm.

Comment 21 kchim 2021-12-17 12:46:43 UTC
Created attachment 1846708 [details]
libxo-1.6.0-1.fc35.x86_64.rpm

Source rpm with for x86_64

Comment 22 Brian Lane 2021-12-17 17:01:21 UTC
Almost there! I missed the warning about -static before, sorry about that. I think this is the last that needs to be done:

 * Add --disable-static to %configure (this will keep it from building the .a static libs)
 * remove the *.a files from the devel package
 * remove the versioned .so files (libxo.so.0, etc.) from the -devel package -- they are shipped in the non-devel package.

And I think that should do it.

Comment 23 kchim 2021-12-20 07:55:04 UTC
Created attachment 1846988 [details]
libxo.spec

Latest libxo.spec

Comment 24 kchim 2021-12-20 07:56:06 UTC
Created attachment 1846989 [details]
libxo-1.6.0-1.fc35.src.rpm

Latest source rpm file

Comment 25 kchim 2021-12-20 07:57:09 UTC
Created attachment 1846990 [details]
libxo-1.6.0-1.fc35.x86_64.rpm

x86_64 arch

Comment 26 kchim 2021-12-20 07:57:59 UTC
I have updated the spec file per your comments. Please review. Thanks

Comment 27 Brian Lane 2021-12-20 18:58:33 UTC
Looks Good!

Comment 28 kchim 2022-01-06 14:39:33 UTC
Please let me know if the review process is completed or if there is anything I need to do. I'd also appreciate it if you could guide me the process to get sponsorship. Thanks!

Comment 29 Brian Lane 2022-01-10 23:45:05 UTC
(In reply to kchim from comment #28)
> Please let me know if the review process is completed or if there is
> anything I need to do. I'd also appreciate it if you could guide me the
> process to get sponsorship. Thanks!

https://docs.fedoraproject.org/en-US/package-maintainers/Package_Review_Process/

The next thing you need to do is to request sponsorship at https://pagure.io/packager-sponsors/issues

Comment 30 kchim 2022-01-27 08:21:51 UTC
(In reply to Brian Lane from comment #29)
> (In reply to kchim from comment #28)
> > Please let me know if the review process is completed or if there is
> > anything I need to do. I'd also appreciate it if you could guide me the
> > process to get sponsorship. Thanks!
> 
> https://docs.fedoraproject.org/en-US/package-maintainers/
> Package_Review_Process/
> 
> The next thing you need to do is to request sponsorship at
> https://pagure.io/packager-sponsors/issues

Thanks a lot, Brian. I just created a sponsorship request here: https://pagure.io/packager-sponsors/issue/516

Comment 31 Vitaly 2022-01-27 09:41:59 UTC
> make %{?_smp_mflags}

Use %make_build instead.

> %{?ldconfig_scriptlets}

Remove this line.

> %{_libdir}/libxo.so.0
> %{_libdir}/libxo.so.0.0.0

Use %{_libdir}/libxo.so.0* instead.

> %{_libdir}/libxo/encoder/libenc*.so.0
> %{_libdir}/libxo/encoder/libenc*.so.0.0.0

%{_libdir}/libxo/encoder/libenc*.so.0*

> %{_bindir}/libxo-config

This file belongs to both main and -devel packages. Chose one.

Comment 32 Vitaly 2022-01-27 09:47:25 UTC
> %{_mandir}/man1/*.1.gz

%{_mandir}/man1/*.1*

> %{_mandir}/man5/*.5.gz

%{_mandir}/man5/*.5*

> %{_mandir}/man3/*.3.gz

%{_mandir}/man3/*.3*

> %{_mandir}/man7/*.7.gz

%{_mandir}/man7/*.7*

Comment 33 kchim 2022-01-27 12:25:22 UTC
Created attachment 1857085 [details]
libxo.spec

Latest spec file 27-Jan-2022

Comment 34 kchim 2022-01-27 12:26:19 UTC
Created attachment 1857086 [details]
libxo-1.6.0-1.fc35.x86_64.rpm

Latest rpm file

Comment 35 kchim 2022-01-27 12:27:05 UTC
Created attachment 1857087 [details]
libxo-1.6.0-1.fc35.src.rpm

Latest source rpm file

Comment 36 kchim 2022-01-27 12:27:35 UTC
(In reply to Vitaly Zaitsev from comment #32)
> > %{_mandir}/man1/*.1.gz
> 
> %{_mandir}/man1/*.1*
> 
> > %{_mandir}/man5/*.5.gz
> 
> %{_mandir}/man5/*.5*
> 
> > %{_mandir}/man3/*.3.gz
> 
> %{_mandir}/man3/*.3*
> 
> > %{_mandir}/man7/*.7.gz
> 
> %{_mandir}/man7/*.7*

Modified spec file as of comments.

Comment 37 Vitaly 2022-01-27 12:38:05 UTC
LGTM now. I will sponsor you.

Comment 38 Gwyn Ciesla 2022-02-02 20:15:35 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/libxo

Comment 39 Fedora Update System 2022-02-03 15:07:12 UTC
FEDORA-2022-dbd820d712 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-dbd820d712

Comment 40 Fedora Update System 2022-02-03 15:07:13 UTC
FEDORA-2022-6a61e0d790 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2022-6a61e0d790

Comment 41 Fedora Update System 2022-02-04 02:15:00 UTC
FEDORA-2022-6a61e0d790 has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --advisory=FEDORA-2022-6a61e0d790 \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-6a61e0d790

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 42 Fedora Update System 2022-02-04 02:27:46 UTC
FEDORA-2022-dbd820d712 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --advisory=FEDORA-2022-dbd820d712 \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-dbd820d712

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 43 Fedora Update System 2022-02-12 01:14:47 UTC
FEDORA-2022-6a61e0d790 has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 44 Fedora Update System 2022-02-12 01:18:37 UTC
FEDORA-2022-dbd820d712 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.


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