Spec URL: http://pecameron.fedorapeople.org/xtrkcad.spec Patch0: http://pecameron.fedorapeople.org/xtrkcad-5.2.2GA-p0.patch Patch1: http://pecameron.fedorapeople.org/xtrkcad-5.2.2GA-p1.patch SRPM URL: http://pecameron.fedorapeople.org/xtrkcad-5.2.2-1.fc36.src.rpm Description: XTrkCad is a CAD program for designing Model Railroad layouts. XTrkCad supports any scale, has libraries of popular brands of x turnouts and sectional track (plus you add your own easily), can automatically use spiral transition curves when joining track XTrkCad lets you manipulate track much like you would with actual flex-track to modify, extend and join tracks and turnouts. Additional features include tunnels, 'post-it' notes, on-screen ruler, parts list, 99 drawing layers, undo/redo commands, benchwork, 'Print to BitMap', elevations, train simulation and car inventory. xtrkcad is available on Windows, OSX, and Linux. It is hosted on: https://sourceforge.net/projects/xtrkcad-fork Some notes: 1) patch 0 makes graphical startup (xtrkcad.desktop/icon) work. Change is committed upstream. 2) patch1 updates the GLPv2 license text to latest release. xtrkcad has been GPLv2 from the beginning. The license files contain the license text available at that time. The licenses has be updated and committed upstream. 3) Documentation is provided (via html) from the Help button in the application. It is in the rpm. There is no man page or doc. 4) An early version of xtrkcad is/was part of Centos. Fedora Account System Username: pecameron
Nobody seems to be assigned to this. Is there something I need to do find a reviewer? This is my first new package and I am not familiar with the process steps or timing of when things happen. Thanks for the help.
> BuildRoot: %{_tmppath}/%{name}-root Not used in Fedora. > %install > rm -rf $RPM_BUILD_ROOT/* Don't. https://docs.fedoraproject.org/en-US/packaging-guidelines/#_tags_and_sections > BuildRequires: gcc, gcc-c++, cmake >= 2.4.7, pkgconfig, gtk2-devel > BuildRequires: libzip, libzip-devel, pandoc, desktop-file-utils > BuildRequires: gettext, gettext-devel, glibc-devel It's a matter of style, and hence - subjective - but I'd reformat this to put each dependency on a separate line. Similarly with the %install section - you can put empty lines between the commands, it'll work fine. > BuildRequires: libzip, libzip-devel > BuildRequires: gettext, gettext-devel Requiring the base packages is not needed; -devel packages are required to pull in the base package as a direct dependency. https://docs.fedoraproject.org/en-US/packaging-guidelines/#_requiring_base_package > cmake -D CMAKE_INSTALL_PREFIX:PATH=%{_prefix} -D CMAKE_BUILD_TYPE=Debug . > %make_build Can you try doing "%cmake" and then "%cmake_build"? > make DESTDIR=$RPM_BUILD_ROOT install Same here - try using "%cmake_install". https://docs.fedoraproject.org/en-US/packaging-guidelines/CMake/ > mv %{buildroot}/%{_datadir}/%{name}/pixmaps/xtrkcad.png %{buildroot}/%{_datadir}/icons I believe this should go into either "%{buildroot}%{_datadir}/pixmaps", or into "%{buildroot}%{_datadir}/icons/hicolor/SIZE/apps/". The latter also mandates adding "Requires: hicolor-icon-theme".
Artur, Thanks for reviewing this package. I have addressed your comments and uploaded the modified xtrkcad.spec and src rpm files. Hopefully this is closer to what you are thinking. I have a problem with %cmake, %cmake_build. %cmake produces some shared libraries libxtrkcad-cornu.so, etc instead of the expected static libs. Is there an option that can change this. Would you mind assigning yourself to the bug?
Hi Artur, I figured out how to get past the shared library problem. I added another patch, xtrkcad-5.2.2GA-p2.patch, and updated the spec and srpm. Phil
Hi Artur, When you get a chance could you review my latest changes? Thanks! Phil
> Patch0: xtrkcad-5.2.2GA-p0.patch > Patch1: xtrkcad-5.2.2GA-p1.patch > Patch2: xtrkcad-5.2.2GA-p2.patch These should be either given some more descriptive names, or some comments explaining why they're needed. > Patch1: xtrkcad-5.2.2GA-p1.patch Don't. The license text should be included verbatim. Please submit this patch upstream and drop it from the SRPM. > mkdir -p %{buildroot}/%{_datadir}/pixmaps > mv %{buildroot}/%{_datadir}/%{name}/pixmaps/xtrkcad.png \ > %{buildroot}/%{_datadir}/pixmaps/xtrkcad.png 1. Consider using tabs or spaces to make follow-up lines more prominent when splitting commands across multiple lines. 2. This leaves behind the empty "%{buildroot}/%{_datadir}/%{name}/pixmaps/" directory. Remove it. The package allows building documentation using doxygen - consider doing this and putting documentation in a sub-package. If you add "BuildRequires: doxygen" and change "%cmake" to "%cmake -DXTRKCAD_USE_DOXYGEN", you will end up with the documentation installed in "%{buildroot}%{_datadir}/%{name}/html".
Hi Artur, I updated the files based on your comments: http://pecameron.fedorapeople.org/xtrkcad.spec http://pecameron.fedorapeople.org/xtrkcad-5.2.2-1.fc36.src.rpm http://pecameron.fedorapeople.org/xtrkcad-5.2.2GA-xtrkcad.desktop.patch http://pecameron.fedorapeople.org/xtrkcad-5.2.2GA-license.patch The license files have been updated upstream and are now current. This was done when I made the original patch.I am an upstream developer and I made the changes. They are in the current development (and next release) branch V5.3.0. When I remove the patch fedpkg --release rawhide lint errors on the old address in the GPL license file. Does this matter in getting the package into fedora? If not, I will delete the patch. I prefer to not create a separate doc package as it is more work keeping two packages in sync and moved through the process. Thanks for taking the time to review this. Phil
> Does this matter in getting the package into fedora? If not, I will delete the patch. It matters in the "should be reported upstream" sense, but it's not a blocker. > I prefer to not create a separate doc package as it is more work keeping two packages in sync and moved through the process. I meant creating a sub-package. You can read more here: - https://blog.svgames.pl/article/building-multiple-packages-with-rpm - https://ftp.rpm.org/max-rpm/ch-rpm-subpack.html - https://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch10s04.html tl;dr version is: > %package docs > Summary: Documentation for %{name} > BuildArch: noarch > > %description docs > This package contains user documentation for XTrkCad, > in HTML format. Later down the line, you just add > %files docs And list the files that should go in the "docs" subpackage.
Updated source rpm and spec.file Deleted license patch. Added docs sub-package. (Thanks for the tip) Please take a look. Phil
> # Following gets removed on next GA release > mkdir -p %{buildroot}/%{_datadir}/licenses/%{name} > mv %{buildroot}/%{_datadir}/%{name}/COPYING %{buildroot}/%{_datadir}/licenses/%{name}/COPYING This is not needed. The %license macro works as follows: - if the path is absolute, it is treated as pointing to a file in the buildroot - if the path is relative, it is treated as pointing to a file in the build directory, which is then copied where needed In other words, you do not need to copy the file to "%{buildroot}%{_datadir}/licenses/%{name}" yourself. The "%license app/COPYING" line will take care of that for you. > %package docs Sorry, it just occurred to me that the Packaging Guidelines say this should be "doc", not "docs". (i.e. singular, without the "s") https://docs.fedoraproject.org/en-US/packaging-guidelines/#_separate_documentation_packages > %files > ... > %{_datadir}/%{name}/applications > %{_datadir}/%{name}/logo.bmp > %{_datadir}/%{name}/xdg-open > %{_datadir}/%{name}/xtrkcad-setup > %{_datadir}/%{name}/xtrkcad.tip > %{_datadir}/%{name}/xtrkcad.upd > %{_datadir}/%{name}/xtrkcad.xtq > > %files docs > %{_datadir}/%{name}/demos > %{_datadir}/%{name}/examples > %{_datadir}/%{name}/html > %{_datadir}/%{name}/params This makes the %{_datadir}/%{name} directory not belong to any package. There are two ways you can fix this: 1. Add "%dir %{_datadir}/%{name}" to the main package. This makes the package own the directory, but not the files within. 2. Add "%{_datadir}/%{name}" to the main package to make it own the directory and the files within, and then use "%exclude %{_datadir}/%{name}/demos" to specify exceptions. https://docs.fedoraproject.org/en-US/packaging-guidelines/UnownedDirectories/ Also - is the "params" directory not needed by the application? The program *must* be able to run properly without the -doc package installed.
I made your suggested changes and updated the spec and src.rpm Please take a look Phil
Are any further changes needed? Hope to hear soon. Phil
Hello, Phil. Sorry for making you wait so long. So, first of all, there are a couple of bundled libraries in the upstream source. You adjust the License field to encompass these libraries as well. 1. cJSON: MIT license - app/bin/cJSON.h - app/bin/cJSON.c This is packaged for Fedora under the name "cjson". You should either: a) BuildRequire cjson-devel and swap the bundled version for the distro version. b) Add "Provides: bundled(cjson) = 1.7.8" to the spec. 2. dirent: MIT license - app/bin/include/dirent.h This file seems to be a compatibility header for MS Windows, and likely can be safely patched out from the Linux package. 3. xdg-open: MIT license - app/lib/xdg-open Can likely be replaced with a symlink to /usr/bin/xdg-open, as provided by the "xdg-utils" package. There is also a bundled copy of halibut, the text formatting system. (Also MIT-licensed, found in app/tools/halibut.) It is not installed as part of the final package, but it is compiled during the build process and used to process some files. Since halibut is packaged in Fedora ("halibut" package), it would be useful to look into the possibility of using the distro-provided program, instead of having xtrkcad build its own bundled copy. Next thing, the package provides a MIME info file under /usr/share/xtrkcad/applications/xtrkcad.xml. This should be moved to /usr/share/mime/packages/. The package also installs a "xtrkcad-setup" file in /usr/share/xtrkcad; looking at the script, it seems to be an installer for a local user. This can be removed.
http://pecameron.fedorapeople.org/xtrkcad.spec http://pecameron.fedorapeople.org/xtrkcad-5.2.2GA-xtrkcad.desktop.patch http://pecameron.fedorapeople.org/xtrkcad-5.2.2-1.fc37.src.rpm This packages the upstream release tarball which includes dirent.h, cJSON.c etc. xtrkcad executable no longer includes the MIT licensed pieces that you mentioned. The process of building it does use MIT licensed components. I included the MIT license in the spec file. I went through your notes and made some updates: 1) This version now uses the fedora cJSON package. 2) app/bin/include/dirent.h is only built for the Windows version, linux builds include /usr/include/dirent.h 3) xdg-open is not longer in the rpm. xtrkcad uses the fedora xdg-utils package. 4) halibut - the fedora package reports markup errors and does not properly build the documentation. For now the included halibut is used. 5) xtrkcad.xml has been moved to the proper location. 6) xtrkcad-setup is no longer in the rpm. I really appreciate the time you take reviewing this. Please take another look. Phil
I discussed comment #13 with teh developers. Xtrkcad is a multi-platform CAD package for designing model railroads that has been in development from before 2003. It is actively developed on Windows, iOS, ubuntu and fedora. The code base reflects needs of all the platforms. When a general release is done packages re created for Windows, iOS, ubuntu and an rpm. The packages are available to download from sourceforge and so far it has been downloaded over 13,700 times. Early on the developers chose halibut for the documentation but found it lacked a few key features. The halibut development team did not want to add the features for a variety of reasons and halibut was forked and modified. So we will never be able to use the fedora halibut.
> License: GPLv2+ MIT So... On one hand, the value here should be "GPLv2+ and MIT". It's important to use "and" or "or" here. https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/#_multiple_licensing_scenarios ...on the other hand, the license field applies only to the resulting RPM package. As such, the fact that halibut is MIT-licensed is irrelevant, as it is only used for processing some files during the build process, and neither the halibut executable, nor any halibut code is shipped in the resulting package. With cJSON unbundled (hint: you can try removing the cjson files during %prep to be 100% sure the system library is used), I think the resulting package is now GPLv2. > Requires: cjson This is not required. rpmbuild picks up the list of required .so files from the xtrkcad executable and builds the Requires list based on that.
Hi Artur, I made the changes you suggested and uploaded teh xtrkcad.spec and source rpm files. Please take a look. Thanks, Phil
Hi Artur, Any chance you can take a look at this? It been a while... phil
Hello, Phil. Sorry to make you wait so long. There are a couple of minor issues with the package, but overall it looks good. 1) app/tools/halibut/LICENCE should not be installed The License: field applies only to the resulting binary RPM. The bundled halibut is used only during the build process, but no halibut code is included in the xtrkcad executable. Hence, the halibut license file doesn't need to be installed. 2) Arch-ed rpms have a total of 6430720 bytes in /usr/share Consider moving the contents of /usr/share/xtrkcad to a subpackage, like xtrkcad-data. The main package should then have a Requires: on it. 3) Missing BuildRequires on "cmake(cmocka)" The program's test suite is based on cmocka, which is not BuildRequired. Building tests also needs to be enabled by using "-DXTRKCAD_TESTING=ON". Because of this, tests aren't built and hence nothing is really tested during %check. I've tried building the test suite and got linking errors when doing so, so it's possible that CMakeLists need to be patched in order to make it all work. (Alternatively, can just omit the tests and remove the check section entirely. If you do so, consider adding a short comment saying that the test suite is broken.) Package Review ============== Legend: [x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated ===== Issues ===== [!]: License file installed when any subpackage combination is installed. Note: file app/tools/halibut/LICENCE is installed, but halibut is used only during the build process and no halibut code is included in the resulting binary package. [!]: Large data in /usr/share should live in a noarch subpackage if package is arched. Note: Arch-ed rpms have a total of 6430720 bytes in /usr/share [!]: %check is present and all tests pass. %check is present, but no tests are being found. The test suite uses cmocka, which is not listed in BuildRequires. ===== MUST items ===== C/C++: [x]: Package does not contain kernel modules. [x]: Package contains no static executables. [x]: If your application is a C or C++ application you must list a BuildRequires against gcc, gcc-c++ or clang. [x]: Header files in -devel subpackage, if present. [x]: Package does not contain any libtool archives (.la) [x]: Rpath absent or only used for internal libs. 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. [!]: License file installed when any subpackage combination is installed. [x]: Package must own all directories that it creates. [x]: %build honors applicable compiler flags or justifies otherwise. [x]: Package contains no bundled libraries without FPC exception. Note: bundled code is present in the source tarball, but patched out and not used during build. [x]: Changelog in prescribed format. [x]: Sources contain only permissible code or content. [-]: 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. [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 does not own files or directories owned by other packages. [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]: Package contains desktop file if it is a GUI application. [x]: Package installs a %{name}.desktop using desktop-file-install or desktop-file-validate if there is such a file. [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]: Sources used to build the package match the upstream source, as provided in the spec URL. [x]: Spec file name must match the spec package %{name}, in the format %{name}.spec. [x]: File names are valid UTF-8. [x]: Large documentation must go in a -doc subpackage. Large could be size (~1MB) or number of files. Note: Documentation size is 0 bytes in 0 files. [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. [x]: 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. [x]: Patches link to upstream bugs/comments/lists or are otherwise justified. [-]: 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. Note: successful scratch build in koji for Rawhide can be found at: https://koji.fedoraproject.org/koji/taskinfo?taskID=84171921 [!]: %check is present and all tests pass. %check is present, but no tests are being found. The test suite uses cmocka, which is not listed in BuildRequires. [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]: 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: [!]: Large data in /usr/share should live in a noarch subpackage if package is arched. Note: Arch-ed rpms have a total of 6430720 bytes in /usr/share [x]: Rpmlint is run on debuginfo package(s). Note: No rpmlint messages. [x]: Rpmlint is run on all installed packages. Note: There are rpmlint messages (see attachment). [x]: Spec file according to URL is the same as in SRPM. Rpmlint ------- Checking: xtrkcad-5.2.2-1.fc37.x86_64.rpm xtrkcad-doc-5.2.2-1.fc37.noarch.rpm xtrkcad-debuginfo-5.2.2-1.fc37.x86_64.rpm xtrkcad-debugsource-5.2.2-1.fc37.x86_64.rpm xtrkcad-5.2.2-1.fc37.src.rpm xtrkcad.x86_64: W: spelling-error %description -l en_US benchwork -> bench work, bench-work, workbench xtrkcad.x86_64: W: no-documentation xtrkcad.x86_64: E: incorrect-fsf-address /usr/share/licenses/xtrkcad/COPYING xtrkcad.x86_64: E: incorrect-fsf-address /usr/share/xtrkcad/COPYING xtrkcad.x86_64: W: no-manual-page-for-binary xtrkcad xtrkcad-doc.noarch: W: no-documentation xtrkcad-doc.noarch: E: incorrect-fsf-address /usr/share/xtrkcad/html/GNUGPLicense.html xtrkcad.src: W: spelling-error %description -l en_US benchwork -> bench work, bench-work, workbench 5 packages and 0 specfiles checked; 3 errors, 5 warnings. Rpmlint (debuginfo) ------------------- Checking: xtrkcad-debuginfo-5.2.2-1.fc37.x86_64.rpm 1 packages and 0 specfiles checked; 0 errors, 0 warnings. Rpmlint (installed packages) ---------------------------- Cannot parse rpmlint output: Source checksums ---------------- https://sourceforge.net/projects/xtrkcad-fork/files/XTrackCad/Version 5.2.2/xtrkcad-source-5.2.2GA.tar.gz : CHECKSUM(SHA256) this package : a5b2caa29b34504338a7f1fd2412e8590b8add9be410611d09693a721b798524 CHECKSUM(SHA256) upstream package : a5b2caa29b34504338a7f1fd2412e8590b8add9be410611d09693a721b798524 Requires -------- xtrkcad (rpmlib, GLIBC filtered): libc.so.6()(64bit) libcairo.so.2()(64bit) libcjson.so.1()(64bit) libgdk-x11-2.0.so.0()(64bit) libgdk_pixbuf-2.0.so.0()(64bit) libglib-2.0.so.0()(64bit) libgobject-2.0.so.0()(64bit) libgtk-x11-2.0.so.0()(64bit) libm.so.6()(64bit) libpango-1.0.so.0()(64bit) libpangocairo-1.0.so.0()(64bit) libzip.so.5()(64bit) rtld(GNU_HASH) xdg-utils xtrkcad-doc (rpmlib, GLIBC filtered): xtrkcad-debuginfo (rpmlib, GLIBC filtered): xtrkcad-debugsource (rpmlib, GLIBC filtered): Provides -------- xtrkcad: application() application(xtrkcad.desktop) xtrkcad xtrkcad(x86-64) xtrkcad-doc: xtrkcad-doc xtrkcad-debuginfo: debuginfo(build-id) xtrkcad-debuginfo xtrkcad-debuginfo(x86-64) xtrkcad-debugsource: xtrkcad-debugsource xtrkcad-debugsource(x86-64) Generated by fedora-review 0.7.6 (b083f91) last change: 2020-11-10 Command line :/usr/bin/fedora-review -b 2040728 --cache Buildroot used: fedora-rawhide-x86_64 Active plugins: Shell-api, Generic, C/C++ Disabled plugins: PHP, Perl, Python, R, SugarActivity, fonts, Java, Ocaml, Haskell Disabled flags: EPEL6, EPEL7, DISTTAG, BATCH, EXARCH
Hi Artur, 1) I removed the halibut LICENSE file from the install. 2) I think we discussed docs and multiple rpms a while ago. I built a xtrkcad-doc rpm (5+Mb) for the docs and put the parameter files (1Mb) in the main rpm. Do you think this should be done differently? What would you like changed? 3) The demos are manually run as the test cases. The change to allow them to run in batch is in the next release. I commented out the %check and added a comment. I updated the spec file and srpm. Please take a look. What is the next step for me in this process? Does the bug need to be closed to move forward? Thanks again, Phil
> I built a xtrkcad-doc rpm (5+Mb) for the docs and put the parameter files (1Mb) in the main rpm. > Do you think this should be done differently? I focused too much on the install size. The docs are 17MiB unpacked and the parameter files are 6MiB unpacked. The parameter files could be moved to a third, separate sub-package. But since they seem to compress nicely, and the main package is just 1.6MiB, I don't think that's necessary. I think this is good to go now. PACKAGE APPROVED. > What is the next step for me in this process? Take a look at the linked guide - you've just completed step six. https://docs.fedoraproject.org/en-US/package-maintainers/New_Package_Process_for_Existing_Contributors/
(fedscm-admin): The Pagure repository was created at https://src.fedoraproject.org/rpms/xtrkcad