Mapserver for rocky linux 9

Hello

For many years i used centos linux and today i wanna migrate to rocky linux 9, I have to use at my work mapserver software so I try to prepare rpm package for rocky linux but without success, For centos 7 i prepare it in this way: [SOLVED]Build rpm package mapserver 7.6.2 - CentOS

Could you help me to prepare spec file for rocky linux 9 based on: GitHub - pablomp/mapserver-7.0.7-Spec: Spec file for building MapServer RPMs

Or show me some tips what i have to change and where to prepare correct spec file. Maybe it is possible to add this (mapserver) rpm to epel repository for rocky linux?

Do not use rpmbuild directly to build an RPM, you should be using mock.

You’ve not provided enough information to help troubleshoot why it isn’t working for you. The main problem I see with the spec file is that it is using an unversioned python (python-devel, and __python macro). It needs to be explicit.

The other issue I see is that this version is older than what is in Fedora (7.0.7 is quite old, though 7.6.2 is mentioned in that CentOS forum post). Fedora has 7.6.4. Downloading the source RPM from Fedora and building with mock yields positive results:

# dnf install epel-release -y
# dnf install mock -y
# wget https://dl.fedoraproject.org/pub/fedora/linux/releases/36/Everything/source/tree/Packages/m/mapserver-7.6.4-11.fc36.src.rpm
# mock -r rocky+epel-9-x86_64 mapserver-7.6.4-11.fc36.src.rpm
. . .
Wrote: /builddir/build/RPMS/php-mapserver-debuginfo-7.6.4-11.el9.x86_64.rpm
Wrote: /builddir/build/RPMS/python3-mapserver-debuginfo-7.6.4-11.el9.x86_64.rpm
Wrote: /builddir/build/RPMS/mapserver-debuginfo-7.6.4-11.el9.x86_64.rpm
Wrote: /builddir/build/RPMS/mapserver-7.6.4-11.el9.x86_64.rpm
Wrote: /builddir/build/RPMS/php-mapserver-7.6.4-11.el9.x86_64.rpm
Wrote: /builddir/build/RPMS/mapserver-ruby-7.6.4-11.el9.x86_64.rpm
Wrote: /builddir/build/RPMS/mapserver-java-7.6.4-11.el9.x86_64.rpm
Wrote: /builddir/build/RPMS/mapserver-debugsource-7.6.4-11.el9.x86_64.rpm
Wrote: /builddir/build/RPMS/mapserver-libs-debuginfo-7.6.4-11.el9.x86_64.rpm
Wrote: /builddir/build/RPMS/mapserver-libs-7.6.4-11.el9.x86_64.rpm
Wrote: /builddir/build/RPMS/python3-mapserver-7.6.4-11.el9.x86_64.rpm
Wrote: /builddir/build/RPMS/mapserver-perl-7.6.4-11.el9.x86_64.rpm
Wrote: /builddir/build/RPMS/mapserver-devel-7.6.4-11.el9.x86_64.rpm

With that being said, you can possibly request mapserver to be added to EPEL: https://docs.fedoraproject.org/en-US/epel/epel-package-request/

The main problem I see with the spec file is that it is using an unversioned python (python-devel, and __python macro). It needs to be explicit.

can you help me to resolve it?

the newest version is mapserver 8 (Download — MapServer 8.0.0 documentation)

CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_CXX_FLAGS_RELEASE
    CMAKE_C_FLAGS_RELEASE
    CMAKE_Fortran_FLAGS_RELEASE
    CMAKE_INSTALL_DO_STRIP
    INCLUDE_INSTALL_DIR
    LIB_INSTALL_DIR
    LIB_SUFFIX
    ORACLE_INCLUDE_DIR
    SHARE_INSTALL_PREFIX
    SYSCONF_INSTALL_DIR
    WITH_GDAL
    WITH_OGR
    WITH_PHP
    WITH_PROJ


-- Build files have been written to: /root/rpmbuild/BUILD/mapserver-8.0.0/build/redhat-linux-build
+ make
make: *** No targets specified and no makefile found.  Stop.
error: Bad exit status from /var/tmp/rpm-tmp.LqaCPk (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.LqaCPk (%build)

when i try to build rpm i receive this information

for centos 7 i manged to built mapserver 7.6.4 version but the newest is too complicated and centos 7 will be no longer support than to 2024 so i try to migrate to rocky 9 and build it for rocky 9, in my situation i have no choice

You are right, 7.6.4 built correctly but when i try to the newest version I have got this problem

RPM build errors:
    File not found: /builddir/build/BUILDROOT/mapserver-8.0.0-2.el9.x86_64/usr/lib64/python3.9/site-packages/*mapscript*
Finish: rpmbuild mapserver-8.0.0-2.fc38.src.rpm
Finish: build phase for mapserver-8.0.0-2.fc38.src.rpm
ERROR: Exception(mapserver-8.0.0-2.fc38.src.rpm) Config(rocky+epel-9-x86_64) 3 minutes 23 seconds
INFO: Results and/or logs in: /var/lib/mock/rocky+epel-9-x86_64/result
ERROR: Command failed:
 # /usr/bin/systemd-nspawn -q -M f0997dd921e842b5a8a45cbd62228224 -D /var/lib/mock/rocky+epel-9-x86_64/root -a -u mockbuild --capability=cap_ipc_lock --bind=/tmp/mock-resolv.1j_l0x1a:/etc/resolv.conf --bind=/dev/loop-control --bind=/dev/loop0 --bind=/dev/loop1 --bind=/dev/loop2 --bind=/dev/loop3 --bind=/dev/loop4 --bind=/dev/loop5 --bind=/dev/loop6 --bind=/dev/loop7 --bind=/dev/loop8 --bind=/dev/loop9 --bind=/dev/loop10 --bind=/dev/loop11 --console=pipe --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOME=/builddir --setenv=HOSTNAME=mock --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin --setenv=PROMPT_COMMAND=printf "\033]0;<mock-chroot>\007" --setenv=PS1=<mock-chroot> \s-\v\$  --setenv=LANG=C.UTF-8 --resolv-conf=off bash --login -c /usr/bin/rpmbuild -bb --noclean --target x86_64 --nodeps /builddir/build/SPECS/mapserver.spec

could you look at this?

The package above (that works) says ‘fc36’, but this one says ‘fc38’, are you sure ‘fc38’ matches with Rocky9

I’m not sure if fc38 matches with rocky 9, but how to check it?Do you think that it can be impossible to build rpm package with the newest version mapserver for rocky linux 9?

what’s strange today i try to build package mapserver for fc37 and mistake is the same like for fc38.
For fc37 is mapserver 7.6.4.17 and for fc38 is 8.0.0.2. The only version that i manged to build correctly in rocky linux 9 is still version 7.6.4.11 fo fc36. I wonder what i do wrong?

Nothing really, but you can’t just assume that any package built for any version of fedora will somehow work on Rocky.

If ‘mapserver’ means ‘https://mapserver.org/’ and ‘GitHub - MapServer/MapServer: Source code of the MapServer project. Please submit pull requests to the 'main' branch.’, it’s annoying that they jumble up all the code and the build system, and don’t explain the build in the readme. You have to guess which file to look at, and I’m guessing it’s ‘INSTALL.CMAKE’ in capitals, which gives a good overview of how it’s supposed to work. The only sensible thing I can see, is where it tells you to do an ‘out-of-source’ build.

There’s also a forum post about building from source, e.g. setting up build dirs, and installing ‘devel’ packages, step, 1, 2, 3
Gaming in Rocky - #25 by gerry666uk

In the meantime, maybe they’ll add it to ‘epel’ or something.